/* ==========================================================================
   Fynbos Distillery - WordPress integration layer
   --------------------------------------------------------------------------
   Loaded after fynbos.css. Fits the design around what Kadence, WordPress and
   WooCommerce output themselves: layout wrappers, archive titles, the blog
   loop, the shop, single product, cart, checkout and account pages.
   ========================================================================== */

/* ---------- Kadence wrappers ------------------------------------------- */
body.fd-theme,
.fd-theme #wrapper,
.fd-theme #inner-wrap,
.fd-theme .site,
.fd-theme .content-bg,
.fd-theme .entry.content-bg,
.fd-theme .loop-entry.content-bg { background: transparent; box-shadow: none; }
body.fd-theme { background: var(--fd-night); }
.fd-theme .site-main.fd-main { padding: 0; margin: 0; }
/* Kadence adds 1.5em above every heading in .single-content; Fynbos sections space their own */
.fd-theme .fd-main .single-content h1,
.fd-theme .fd-main .single-content h2,
.fd-theme .fd-main .single-content h3,
.fd-theme .fd-main .single-content h4,
.fd-theme .fd-hero h1 { margin-top: 0; }
.fd-theme .fd-main .single-content .fd-legal__body h2 { margin-top: 1.8em; }
.fd-theme .fd-main .entry-content > * { max-width: none; margin-left: 0; margin-right: 0; }

/* Kadence styles #masthead itself (relative, white); restore the fixed, transparent Fynbos header */
body.fd-theme #masthead.site-header {
	position: fixed; top: 0; left: 0; right: 0; z-index: 900;
	background: transparent; box-shadow: none; border-bottom: 1px solid transparent;
}
body.fd-theme #masthead.site-header.is-scrolled { background: rgba(9, 12, 16, .88); backdrop-filter: blur(14px); border-bottom-color: var(--fd-line-dark); }

/* Kadence prints its own .site-branding .site-title colour/size inline; keep the Fynbos wordmark */
body.fd-theme #masthead .site-branding .site-title {
	color: var(--fd-cream); font-family: var(--fd-font-display); font-size: 22px; font-weight: 400;
	line-height: 1; letter-spacing: .28em; text-transform: uppercase; margin: 0;
}
body.fd-theme #masthead .site-branding .site-title small { color: var(--fd-gold); }
@media (max-width: 480px) {
	body.fd-theme #masthead .site-branding .site-title { font-size: 19px; letter-spacing: .22em; }
	body.fd-theme #masthead .site-branding .site-title small { font-size: 8.5px; letter-spacing: .42em; }
}

/* Admin bar offset for the fixed header */
body.fd-theme.admin-bar #masthead.site-header { top: 32px; }
@media (max-width: 782px) { body.fd-theme.admin-bar #masthead.site-header { top: 46px; } }

/* Screens without a full-bleed hero (single product, cart, checkout, account,
   plain pages) and pale heroes: the header gets its solid bar from the start.
   Without a hero, the content is also pushed below the header. */
body.fd-theme:not(.fd-has-hero) #masthead.site-header,
body.fd-theme:has(.fd-hero--light) #masthead.site-header { background: rgba(9, 12, 16, .92); backdrop-filter: blur(14px); border-bottom-color: var(--fd-line-dark); }
body.fd-theme:not(.fd-has-hero) #inner-wrap { padding-top: 120px; }

/* Our heroes replace Kadence's title areas */
body.fd-has-hero .post-archive-hero-section,
body.fd-has-hero .product-archive-hero-section,
body.fd-has-hero .entry-hero.page-hero-section,
body.fd-has-hero .post-archive-title,
body.fd-has-hero .product-archive-title,
body.fd-has-hero .woocommerce-products-header,
body.single-post.fd-has-hero .entry-hero.post-hero-section,
body.single-post.fd-has-hero .single-entry .entry-header,
body.single-post.fd-has-hero .article-post-thumbnail { display: none; }

/* Kadence's title band on other pages (cart, checkout, account, plain pages): dark, not cream */
.fd-theme .entry-hero,
.fd-theme .entry-hero .entry-hero-container-inner,
.fd-theme .entry-hero .hero-section-overlay { background: var(--fd-ink); }
.fd-theme .entry-hero .entry-header { min-height: 0; padding: clamp(36px, 5vw, 64px) 0; }
.fd-theme .entry-hero .entry-title { font-size: clamp(40px, 5vw, 72px); }
.fd-theme .entry-hero .kadence-breadcrumbs, .fd-theme .entry-hero .kadence-breadcrumbs a { color: var(--global-palette6); }

/* Current menu item from wp_nav_menu */
.main-navigation .current_page_item > a,
.main-navigation .current_page_parent > a,
.main-navigation .current-menu-ancestor > a { color: var(--fd-gold); }
.main-navigation .current_page_item > a::after,
.main-navigation .current_page_parent > a::after { transform: scaleX(1); }

/* Content areas Kadence renders (posts, products, cart...) */
.fd-theme .content-container.site-container { max-width: var(--fd-max); padding-left: var(--fd-gutter); padding-right: var(--fd-gutter); }
.fd-theme .content-area { margin-top: clamp(48px, 7vw, 96px); margin-bottom: clamp(64px, 9vw, 120px); }
/* Underline links inside blog post text only */
.fd-theme.single-post .single-content p a:not(.fd-btn):not(.fd-link),
.fd-theme.single-post .single-content li a { text-decoration: underline; text-underline-offset: 3px; }
.fd-theme .entry-content { color: var(--fd-text-dark); }
.fd-theme .entry-content h1, .fd-theme .entry-content h2, .fd-theme .entry-content h3,
.fd-theme .entry-title, .fd-theme .page-title { color: var(--global-palette9); }
/* ...except on the cream (paper) sections, where headings are dark ink */
.fd-theme .entry-content .fd-section--paper h1,
.fd-theme .entry-content .fd-section--paper h2,
.fd-theme .entry-content .fd-section--paper h3,
.fd-theme .entry-content .fd-section--paper h4 { color: var(--fd-ink); }
.fd-theme .entry-content .fd-section--paper h2 em,
.fd-theme .entry-content .fd-section--paper h3 em { color: var(--fd-gold-deep); }

/* ---------- Blog posts --------------------------------------------------- */
.fd-theme .single-entry .entry-content-wrap { padding: 0; }
.fd-theme.single-post .single-entry { max-width: 820px; margin-left: auto; margin-right: auto; }
.single-content .wp-block-quote { margin: 2em 0; padding-left: 32px; border-left: 1px solid var(--fd-gold); }
.single-content .wp-block-quote p { font-family: var(--fd-font-display); font-size: 30px; line-height: 1.3; font-style: italic; color: var(--fd-cream); }
.fd-theme .post-navigation { border-top: 1px solid var(--fd-line-dark); padding-top: 32px; margin-top: 56px; }
.fd-theme .post-navigation a { color: var(--fd-gold); }
.fd-theme .comments-area { display: none; }

/* Blog index (Kadence loop) */
.fd-theme .loop-entry { border: 0; }
.fd-theme .loop-entry .entry-content-wrap { padding: 22px 0 0; }
.fd-theme .loop-entry .entry-taxonomies a { color: var(--fd-gold); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; text-decoration: none; }
.fd-theme .loop-entry .entry-summary { color: var(--fd-text-dark); font-size: 15px; }
.fd-theme .loop-entry .post-more-link { font: 500 12px/1 var(--fd-font-body); letter-spacing: .24em; text-transform: uppercase; color: var(--fd-gold); text-decoration: none; padding-bottom: 6px; border-bottom: 1px solid currentColor; }
.fd-theme .pagination .page-numbers { color: var(--fd-cream); border-color: var(--fd-line-dark); }
.fd-theme .pagination .page-numbers.current { background: var(--fd-gold); color: var(--fd-ink); }

/* ---------- Shop / product loops --------------------------------------- */
.fd-filters--links { margin: 0 0 40px; }
.fd-filters--links .fd-filter { text-decoration: none; }
.fd-theme .woocommerce-result-count, .fd-theme .woocommerce-ordering select { color: var(--global-palette6); }
.fd-theme .woocommerce-ordering select { background: transparent; border: 1px solid var(--fd-line-dark); color: var(--fd-cream); padding: 8px 12px; }
.fd-theme .woocommerce-ordering select option { background: var(--fd-ink); color: var(--fd-cream); }

.fd-theme.woocommerce ul.products li.product,
.fd-theme .woocommerce ul.products li.product { text-align: left; background: transparent; }
.fd-theme ul.products li.product .woocommerce-loop-image-link,
.fd-theme ul.products li.product a.woocommerce-LoopProduct-link > img,
.fd-theme ul.products li.product .fd-lineup { display: block; aspect-ratio: 4 / 5; overflow: hidden; background-color: var(--fd-paper); }
.fd-theme ul.products li.product img { width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; margin: 0; transition: transform 1.4s var(--fd-ease); }
.fd-theme ul.products li.product:hover img { transform: scale(1.05); }
.fd-theme ul.products li.product .fd-lineup { width: 100%; }
.fd-theme ul.products li.product .product-details { padding: 20px 0 0; background: transparent; }
.fd-theme ul.products li.product .woocommerce-loop-product__title { font-family: var(--fd-font-display); font-size: 24px; color: var(--global-palette9); padding: 0; }
.fd-theme ul.products li.product .price,
.fd-theme .price { color: var(--fd-gold); font-family: var(--fd-font-display); font-size: 22px; }
.fd-theme .price del { color: var(--global-palette6); opacity: .7; }
.fd-theme .price ins { text-decoration: none; }
.fd-theme ul.products li.product .button,
.fd-theme ul.products li.product .added_to_cart {
	background: transparent; border: 1px solid rgba(255, 236, 204, .35); color: var(--fd-cream);
	font: 500 11px/1 var(--fd-font-body); letter-spacing: .22em; text-transform: uppercase; padding: 13px 18px; margin-top: 12px;
}
.fd-theme ul.products li.product .button:hover { border-color: var(--fd-gold); color: var(--fd-ink); }
.fd-theme .onsale { background: var(--fd-gold); color: var(--fd-ink); border-radius: 0; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }

/* Our own product cards ([fd_products]) */
.fd-card-action { font: 500 11px/1 var(--fd-font-body); letter-spacing: .22em; text-transform: uppercase; color: var(--fd-cream); }
.fd-card-action:hover { color: var(--fd-gold); }
.fd-products .fd-product__media img { width: 100%; height: 100%; object-fit: cover; }

/* Kadence paints loop cards white via .content-style-unboxed .content-bg… (related products, upsells) */
body.fd-theme ul.products li.product .product-details.content-bg,
body.fd-theme ul.products li.product .entry-content-wrap { background: transparent !important; box-shadow: none; padding-left: 0; padding-right: 0; }
/* Kadence hides the card button until hover (and can fade the price); keep both visible */
body.fd-theme ul.products li.product .product-action-wrap,
body.fd-theme ul.products.woo-archive-action-on-hover li.product .product-action-wrap,
body.fd-theme ul.products.woo-archive-action-on-hover li.product:hover .product-action-wrap {
	opacity: 1; visibility: visible; transform: none; position: static; margin-top: 12px; pointer-events: auto;
}
body.fd-theme ul.products li.product .price,
body.fd-theme ul.products.woo-archive-action-on-hover li.product .price,
body.fd-theme ul.products.woo-archive-action-on-hover li.product:hover .price { opacity: 1; transform: none; }
body.fd-theme ul.products li.product .button.add_to_cart_button,
body.fd-theme ul.products li.product .button.product_type_variable,
body.fd-theme ul.products li.product .button.product_type_simple {
	display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--fd-cream);
	border: 1px solid rgba(255, 236, 204, .35); border-radius: var(--fd-radius); padding: 13px 18px;
	font: 500 11px/1 var(--fd-font-body); letter-spacing: .22em; text-transform: uppercase;
}
body.fd-theme ul.products li.product .button.add_to_cart_button:hover,
body.fd-theme ul.products li.product .button.product_type_variable:hover { border-color: var(--fd-gold); color: var(--fd-gold); background: transparent; }

/* Two-across cards on phones: tighten the type and let the button fill the card */
@media (max-width: 820px) {
	body.fd-theme ul.products li.product .woocommerce-loop-product__title { font-size: 20px; }
	body.fd-theme ul.products li.product .price { font-size: 17px; }
	body.fd-theme ul.products li.product .button.add_to_cart_button,
	body.fd-theme ul.products li.product .button.product_type_variable,
	body.fd-theme ul.products li.product .button.product_type_simple {
		display: flex; justify-content: center; gap: 0; width: 100% !important; padding: 12px 8px; font-size: 10px; letter-spacing: .14em; white-space: nowrap;
	}
	body.fd-theme ul.products li.product .button .kadence-svg-iconset { display: none; }
	body.fd-theme ul.products li.product .product-action-wrap { padding: 0; width: 100%; }
	body.fd-theme .fd-rail li.product .fd-product__note { font-size: 13px; }
}

/* ---------- Breadcrumbs ------------------------------------------------- */
.fd-theme .kadence-breadcrumbs,
.fd-theme .woocommerce-breadcrumb { color: rgba(255, 236, 204, .72); font-size: 13px; letter-spacing: .04em; }
.fd-theme .kadence-breadcrumbs a,
.fd-theme .woocommerce-breadcrumb a { color: var(--fd-cream); text-decoration: none; }
.fd-theme .kadence-breadcrumbs a:hover,
.fd-theme .woocommerce-breadcrumb a:hover { color: var(--fd-gold); }

/* ---------- Single product --------------------------------------------- */
/* The static build's sticky gallery leaves a 110px offset in WordPress; keep it in normal flow */
body.fd-theme div.product .woocommerce-product-gallery { position: relative; top: auto; }
.fd-theme div.product .product_title { font-size: clamp(38px, 4.6vw, 64px); color: var(--global-palette9); }
.fd-theme div.product p.price, .fd-theme div.product span.price { font-size: 34px; color: var(--fd-gold); }
.fd-theme div.product .woocommerce-product-details__short-description { color: var(--fd-cream); font-size: 18px; }
.fd-theme div.product .woocommerce-product-gallery__image,
.fd-theme div.product .woocommerce-product-gallery__image--placeholder { background-color: var(--fd-paper); }
.fd-theme div.product .fd-lineup-wrap .fd-lineup { aspect-ratio: 4 / 5; width: 100%; }
.fd-theme div.product .flex-control-thumbs li img { opacity: .6; }
.fd-theme div.product .flex-control-thumbs li img.flex-active { opacity: 1; }
.fd-theme div.product form.cart .variations label { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--global-palette6); }
.fd-theme div.product form.cart .variations select { background: transparent; color: var(--fd-cream); border: 1px solid var(--fd-line-dark); padding: 12px; min-width: 180px; }
body.fd-theme div.product form.cart .variations select option { background: var(--fd-ink); color: var(--fd-cream); }
body.fd-theme div.product form.cart .variations select option:checked,
body.fd-theme div.product form.cart .variations select option:hover { background: var(--fd-gold); color: var(--fd-ink); }
body.fd-theme div.product form.cart .variations select option[value=""] { color: var(--global-palette6); }
.fd-theme div.product form.cart .reset_variations { color: var(--global-palette6); }
.fd-theme .quantity .qty { background: transparent; color: var(--fd-cream); border: 1px solid var(--fd-line-dark); min-height: 52px; }
/* Kadence boxes the tabs in a pale border on small screens */
body.fd-theme div.product .woocommerce-tabs { clear: both; padding-top: clamp(40px, 6vw, 72px); border: 0; }
body.fd-theme div.product .woocommerce-tabs ul.tabs { padding: 0; margin: 0 0 32px; border-bottom: 1px solid var(--fd-line-dark); display: flex; flex-wrap: wrap; gap: 4px 32px; }
body.fd-theme div.product .woocommerce-tabs ul.tabs::before,
body.fd-theme div.product .woocommerce-tabs ul.tabs::after,
body.fd-theme div.product .woocommerce-tabs ul.tabs li::before,
body.fd-theme div.product .woocommerce-tabs ul.tabs li::after { display: none; }
body.fd-theme div.product .woocommerce-tabs ul.tabs li,
body.fd-theme div.product .woocommerce-tabs ul.tabs li.active {
	background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin: 0 0 -1px; padding: 0;
}
body.fd-theme div.product .woocommerce-tabs ul.tabs li.active { border-bottom-color: var(--fd-gold); }
body.fd-theme div.product .woocommerce-tabs ul.tabs li a {
	display: block; padding: 14px 0; color: var(--global-palette6); font-family: var(--fd-font-display); font-size: 22px; font-weight: 400;
}
body.fd-theme div.product .woocommerce-tabs ul.tabs li.active a,
body.fd-theme div.product .woocommerce-tabs ul.tabs li a:hover { color: var(--global-palette9); }
body.fd-theme div.product .woocommerce-tabs .panel > h2:first-child { display: none; }
body.fd-theme div.product table.woocommerce-product-attributes { border: 0; }
body.fd-theme div.product table.woocommerce-product-attributes th,
body.fd-theme div.product table.woocommerce-product-attributes td {
	background: transparent; border: 0; border-bottom: 1px solid var(--fd-line-dark); padding: 14px 12px 14px 0; font-style: normal;
}
body.fd-theme div.product table.woocommerce-product-attributes th { color: var(--fd-gold); font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; width: 180px; }
body.fd-theme div.product table.woocommerce-product-attributes td p { margin: 0; color: var(--fd-cream); }
body.fd-theme #reviews #comments h2, body.fd-theme #reviews .woocommerce-noreviews { color: var(--fd-cream); }
.fd-theme div.product .woocommerce-tabs .panel { color: var(--fd-text-dark); }
.fd-theme div.product .woocommerce-tabs .panel h2, .fd-theme div.product .woocommerce-tabs .panel h3 { font-size: 26px; margin-top: 1.2em; }
.fd-theme .product_meta { font-size: 13px; color: var(--global-palette6); }
.fd-theme .product_meta a { color: var(--fd-gold); }
.fd-theme .related.products > h2, .fd-theme .upsells.products > h2 { font-size: clamp(30px, 3.4vw, 46px); margin-bottom: 32px; }

/* Primary WooCommerce buttons use the Fynbos amber button */
.fd-theme .single_add_to_cart_button,
.fd-theme .checkout-button,
.fd-theme #place_order,
.fd-theme .woocommerce-message .button,
.fd-theme .woocommerce button.button.alt,
.fd-theme .woocommerce a.button.alt {
	background: var(--fd-gold); color: var(--fd-ink); border: 1px solid var(--fd-gold); border-radius: var(--fd-radius);
	font: 500 12px/1 var(--fd-font-body); letter-spacing: .24em; text-transform: uppercase; padding: 18px 34px;
}
.fd-theme .single_add_to_cart_button:hover,
.fd-theme .checkout-button:hover,
.fd-theme #place_order:hover { background: var(--fd-cream); border-color: var(--fd-cream); color: var(--fd-ink); }
.fd-theme .woocommerce button.button,
.fd-theme .woocommerce a.button,
.fd-theme .woocommerce input.button {
	background: transparent; color: var(--fd-cream); border: 1px solid rgba(255, 236, 204, .35); border-radius: var(--fd-radius);
	font: 500 11px/1 var(--fd-font-body); letter-spacing: .2em; text-transform: uppercase; padding: 14px 22px;
}
.fd-theme .woocommerce button.button:hover,
.fd-theme .woocommerce a.button:hover { border-color: var(--fd-gold); color: var(--fd-gold); background: transparent; }

/* ---------- Cart, checkout, account ------------------------------------ */
.fd-theme .woocommerce table.shop_table,
.fd-theme .woocommerce table.shop_table td,
.fd-theme .woocommerce table.shop_table th,
.fd-theme .woocommerce-cart .cart-collaterals .cart_totals table,
.fd-theme #add_payment_method #payment,
.fd-theme .woocommerce-checkout #payment { border-color: var(--fd-line-dark); background: transparent; color: var(--fd-text-dark); }
.fd-theme .woocommerce table.shop_table th { color: var(--fd-gold); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500; }
.fd-theme .woocommerce table.shop_table a { color: var(--fd-cream); }
.fd-theme .woocommerce-checkout #payment div.payment_box { background: var(--fd-slate); color: var(--fd-cream); }
.fd-theme .woocommerce-checkout #payment div.payment_box::before { border-bottom-color: var(--fd-slate); }
.fd-theme .woocommerce form .form-row label,
.fd-theme .woocommerce-form-login label { color: var(--global-palette6); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.fd-theme .woocommerce form .form-row input.input-text,
.fd-theme .woocommerce form .form-row textarea,
.fd-theme .woocommerce form .form-row select,
.fd-theme .select2-container--default .select2-selection--single,
.fd-theme .woocommerce .coupon input.input-text {
	background: rgba(255, 236, 204, .04); color: var(--fd-cream); border: 1px solid var(--fd-line-dark); border-radius: var(--fd-radius); padding: 12px 14px;
}
.fd-theme .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--fd-cream); }
.fd-theme .select2-dropdown { background: var(--fd-ink); color: var(--fd-cream); border-color: var(--fd-line-dark); }
.fd-theme .woocommerce-message, .fd-theme .woocommerce-info, .fd-theme .woocommerce-error,
.fd-theme .woocommerce-noreviews, .fd-theme p.no-comments {
	background: var(--fd-ink); color: var(--fd-cream); border-top-color: var(--fd-gold); border-left: 0;
}
.fd-theme .woocommerce-message::before, .fd-theme .woocommerce-info::before { color: var(--fd-gold); }
.fd-theme .woocommerce-MyAccount-navigation ul li a { color: var(--fd-cream); }
.fd-theme .woocommerce-MyAccount-navigation ul li.is-active a { color: var(--fd-gold); }

/* Block-based cart & checkout (WooCommerce 8.3+) */
.fd-theme .wc-block-components-text-input input,
.fd-theme .wc-block-components-combobox .wc-block-components-combobox-control input,
.fd-theme .wc-blocks-components-select .wc-blocks-components-select__select,
.fd-theme .wc-blocks-components-select__container,
.fd-theme .wc-block-components-address-form input[type="text"] {
	background: rgba(255, 236, 204, .04) !important; color: var(--fd-cream) !important; border-color: var(--fd-line-dark) !important;
}
.fd-theme .wc-blocks-components-select__select option { background: var(--fd-ink); color: var(--fd-cream); }
.fd-theme .wc-blocks-components-select__expand { fill: var(--fd-cream); }
.fd-theme .wc-block-components-text-input label,
.fd-theme .wc-blocks-components-select__label { color: var(--global-palette6) !important; }
.fd-theme .wc-block-components-button:not(.is-link) { background: var(--fd-gold); color: var(--fd-ink); border-radius: var(--fd-radius); }
.fd-theme .wc-block-components-totals-wrapper, .fd-theme .wc-block-components-panel { border-color: var(--fd-line-dark); }
.fd-theme .wc-block-cart-items, .fd-theme .wc-block-cart-items td, .fd-theme .wc-block-cart-items th { border-color: var(--fd-line-dark); }

/* Price list + info sections under the shop sit full width after Kadence's content */
.fd-theme .fd-shop-after { clear: both; }
