/* ==========================================================================
   PALCLE GALLERIA — shop-only corrections.

   assets/cf-main.css is the ported storefront stylesheet and stays untouched.
   This file only covers the parts of WooCommerce that the storefront never had to
   render (real cart rows, coupon form, cart totals, classic checkout, variation
   dropdowns) plus the handful of rules the Shopify sections carried in their own
   inline {% style %} blocks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Category page
   -------------------------------------------------------------------------- */

/* Grid children need an explicit min-width or a long product title makes the
   whole layout scroll sideways. */
.cf-shop__layout > .cf-shop__content,
.cf-shop__layout > .cf-shop__sidebar { min-width: 0; }
.cf-shop__content { overflow-wrap: anywhere; }

/* Price filter — carried over from the inline style block of cf-collection.liquid. */
.cf-filter--price .price_slider_amount { flex-wrap: wrap; }
.cf-filter--price .price_slider_amount input {
	flex: 1 1 0;
	min-width: 0;
	width: auto;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--cf-border-2);
	border-radius: 10px;
	font-size: 13px;
	font-family: inherit;
}
.cf-filter--price .price_slider_amount input:focus { outline: none; border-color: var(--cf-green); }
.cf-filter--price .price_slider_amount .button { flex: 0 0 auto; }

.cf-filters__head h3 .cf-icon { color: var(--cf-green); }

/* WooCommerce prints its notices above the toolbar on archives. */
.cf-shop__content > .woocommerce-notices-wrapper:empty { display: none; }

/* --------------------------------------------------------------------------
   Single product — variation dropdown
   -------------------------------------------------------------------------- */
.woocommerce div.product form.cart .variations select,
select.cf-select {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	max-width: 100%;
	height: 48px;
	padding: 0 38px 0 14px;
	border-radius: 12px;
	border: 1.5px solid var(--cf-border-2);
	background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23166534' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 12px center;
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	color: var(--cf-text-strong);
	cursor: pointer;
}
.woocommerce div.product form.cart .variations select:focus,
select.cf-select:focus {
	outline: none;
	border-color: var(--cf-green);
	box-shadow: 0 0 0 3px rgba(var(--cf-green-rgb), .12);
}
.woocommerce div.product form.cart .variations th.label { width: 1%; white-space: nowrap; padding-right: 14px !important; }
.woocommerce div.product form.cart .variations td.value { width: 99%; }
.woocommerce div.product form.cart a.reset_variations { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--cf-muted); }

/* The price lives in .cf-product__pricebox, which the variation script repaints —
   WooCommerce's in-form copy would be a second price on the page. */
.woocommerce div.product form.cart .woocommerce-variation-price { display: none; }
.woocommerce div.product form.cart .woocommerce-variation-description { font-size: 14px; color: var(--cf-muted); margin-bottom: 10px; }
.woocommerce div.product form.cart .woocommerce-variation-availability p { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--cf-danger); }
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart { width: 100%; flex-wrap: wrap; }
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart-disabled .single_add_to_cart_button {
	opacity: .5;
	cursor: not-allowed;
	pointer-events: none;
}
.woocommerce div.product form.cart p.stock.out-of-stock { color: var(--cf-danger); font-weight: 600; }

.cf-product__cats .posted_in { color: var(--cf-muted); }
.cf-product__cats .posted_in a { color: var(--cf-muted); }

/* Gallery: keep the 5-up thumb rail from overflowing its card on narrow phones. */
.woocommerce-product-gallery .flex-control-thumbs { max-width: 100%; }
.woocommerce-product-gallery__image--placeholder { display: flex; align-items: center; justify-content: center; background: var(--cf-light); border-radius: 14px; }

/* Related products sit inside the same .cf-main as the product. */
.woocommerce .related.products { margin-top: 8px; padding-bottom: 8px; }

/* --------------------------------------------------------------------------
   Cart page
   -------------------------------------------------------------------------- */
.cf-cart-page {
	background: #fff;
	border: 1px solid var(--cf-border);
	border-radius: var(--cf-radius-lg);
	padding: 20px;
}
.cf-cart-page .cf-mini-cart { height: auto; }
.cf-cart-page table.shop_table { width: 100%; margin: 0 0 18px; }
.cf-cart-page table.shop_table th { font-size: 13px; font-weight: 700; color: var(--cf-dark); text-align: left; }
.cf-cart-page table.shop_table td { vertical-align: middle; font-size: 14px; }
.cf-cart-page td.product-remove { width: 40px; }
.cf-cart-page td.product-thumbnail { width: 88px; }
.cf-cart-page td.product-thumbnail img {
	width: 72px;
	height: 72px;
	object-fit: contain;
	border-radius: 10px;
	border: 1px solid var(--cf-border);
	background: #fff;
}
.cf-cart-page td.product-name a { font-weight: 600; color: var(--cf-text-strong); }
.cf-cart-page td.product-name a:hover { color: var(--cf-green); }
.cf-cart-page td.product-name .variation {
	display: flex;
	flex-wrap: wrap;
	gap: 0 8px;
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--cf-muted);
}
.cf-cart-page td.product-name .variation dt { font-weight: 600; }
.cf-cart-page td.product-name .variation dd,
.cf-cart-page td.product-name .variation p { margin: 0; display: inline; }
.cf-cart-page .amount { color: var(--cf-green); font-weight: 700; }
.cf-cart-page del .amount { color: var(--cf-muted); font-weight: 400; font-size: 12px; }
.cf-cart-page a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	color: var(--cf-muted);
	background: var(--cf-light);
	text-decoration: none;
}
.cf-cart-page a.remove:hover { background: #fee2e2; color: var(--cf-danger); }
.cf-cart-page .quantity { height: 44px; }
.cf-cart-page td.actions { padding: 16px 14px !important; }
.cf-cart-page td.actions .coupon {
	display: inline-flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-right: 12px;
	vertical-align: middle;
}
.cf-cart-page td.actions .coupon .input-text {
	width: 190px;
	max-width: 100%;
	height: 44px;
	padding: 0 14px;
	border: 1.5px solid var(--cf-border-2);
	border-radius: 12px;
	font: inherit;
	font-size: 14px;
}
.cf-cart-page td.actions .coupon .input-text:focus { outline: none; border-color: var(--cf-green); }
.cf-cart-page td.actions .button { min-height: 44px; padding: 0 18px !important; }
.cf-cart-page .cart-collaterals { display: flex; flex-direction: column; gap: 20px; }
.cf-cart-page .cart_totals h2 { font-size: 1.15rem; color: var(--cf-dark); margin-bottom: 12px; }
.cf-cart-page .cart_totals table.shop_table { margin-bottom: 14px; }
.cf-cart-page .cart_totals .order-total .amount { font-size: 20px; }
.cf-cart-page .wc-proceed-to-checkout { display: flex; }
.cf-cart-page .wc-proceed-to-checkout .checkout-button {
	flex: 1;
	display: flex !important;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	font-size: 16px !important;
	background: var(--cf-accent) !important;
}
.cf-cart-page .return-to-shop { text-align: center; margin: 0; }
.cf-cart-page .woocommerce-mini-cart__empty-message { margin: 0 0 18px; }

@media (max-width: 720px) {
	.cf-cart-page { padding: 14px; }
	.cf-cart-page table.shop_table { border: 0; }
	.cf-cart-page table.shop_table thead { display: none; }
	.cf-cart-page table.shop_table tr {
		display: block;
		position: relative;
		padding: 10px 0;
		border-bottom: 1px solid var(--cf-border);
	}
	.cf-cart-page table.shop_table td {
		display: block;
		border: 0 !important;
		padding: 6px 0 !important;
		text-align: right;
	}
	.cf-cart-page table.shop_table td[data-title]::before {
		content: attr(data-title) ": ";
		float: left;
		font-weight: 600;
		color: var(--cf-dark);
	}
	.cf-cart-page td.product-remove { position: absolute; right: 0; top: 10px; width: auto; padding: 0 !important; }
	.cf-cart-page td.product-thumbnail { text-align: left; width: auto; }
	.cf-cart-page td.product-quantity .quantity { float: right; }
	.cf-cart-page td.actions { text-align: left; }
	.cf-cart-page td.actions .coupon { display: flex; width: 100%; margin: 0 0 12px; }
	.cf-cart-page td.actions .coupon .input-text { flex: 1 1 auto; width: auto; }
	.cf-cart-page td.actions button[name="update_cart"] { width: 100%; }
	/* cart_totals keeps its own two-column table; stop it collapsing to one line. */
	.cf-cart-page .cart_totals table.shop_table th,
	.cf-cart-page .cart_totals table.shop_table td { display: table-cell; text-align: left; padding: 10px 12px !important; }
	.cf-cart-page .cart_totals table.shop_table tr { display: table-row; padding: 0; }
	.cf-cart-page .cart_totals table.shop_table td::before { content: none; }
}

/* --------------------------------------------------------------------------
   Classic checkout
   -------------------------------------------------------------------------- */
.cf-checkout .col2-set {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 28px;
	margin-bottom: 28px;
}
.cf-checkout .col2-set .col-1,
.cf-checkout .col2-set .col-2 { float: none !important; width: auto !important; min-width: 0; }
.cf-checkout h3 { font-size: 1.15rem; color: var(--cf-dark); margin-bottom: 16px; }
.cf-checkout .cf-checkout__review,
.cf-checkout #customer_details {
	background: #fff;
	border: 1px solid var(--cf-border);
	border-radius: var(--cf-radius-lg);
	padding: 24px;
}
.cf-checkout #customer_details { margin-bottom: 24px; }
.cf-checkout .woocommerce-checkout-review-order-table { width: 100%; margin-bottom: 18px; }
.cf-checkout .woocommerce-checkout-review-order-table .amount { color: var(--cf-green); font-weight: 700; }
.cf-checkout #payment { background: var(--cf-light) !important; border-radius: 14px !important; padding: 6px 0; }
.cf-checkout #payment ul.payment_methods { border-bottom: 1px solid var(--cf-border) !important; }
.cf-checkout #payment div.form-row.place-order { padding: 16px !important; }
.cf-checkout #place_order {
	width: 100%;
	min-height: 54px;
	font-size: 16px !important;
	background: var(--cf-accent) !important;
}

@media (max-width: 1024px) {
	.cf-checkout .col2-set { grid-template-columns: 1fr; gap: 22px; }
	.cf-checkout .cf-checkout__review,
	.cf-checkout #customer_details { padding: 16px; }
}

/* --------------------------------------------------------------------------
   Small phones (down to 360px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
	.cf-toolbar { padding: 10px; gap: 10px; }
	.cf-toolbar__left,
	.cf-toolbar__right { width: 100%; justify-content: space-between; gap: 10px; }
	.woocommerce-result-count { font-size: 12.5px; }
	.woocommerce-ordering select { width: 100%; font-size: 13px; }
	.cf-shop__title { overflow-wrap: anywhere; }
	.woocommerce div.product div.images,
	.cf-product__gallery .woocommerce-product-gallery { padding: 10px; }
	.woocommerce-product-gallery .flex-control-thumbs { gap: 6px; }
	.woocommerce-product-gallery .flex-control-thumbs li { width: 56px !important; }
	.woocommerce div.product form.cart { gap: 10px; }
	.woocommerce div.product form.cart .woocommerce-variation-add-to-cart { gap: 10px; }
	.woocommerce .quantity .qty { width: 44px !important; }
	.cf-qty-btn { width: 34px; }
	.cf-product__price .price,
	.woocommerce div.product .cf-product__price p.price { font-size: 26px !important; }
	.cf-infobox,
	.cf-helpbox { padding: 14px; }
	.cf-cart-page .wc-proceed-to-checkout .checkout-button { font-size: 15px !important; }
}
