/* -------------------------------------------------------------------------
   FEAR KNOT Designs — additions on top of the compiled storefront stylesheet.
   Contains only: styles for WooCommerce/WordPress generated markup that has no
   counterpart in the design, and functional rules (drawer, header states,
   reveal fallbacks, form controls).
   ---------------------------------------------------------------------- */

:root {
	--theme-header-height: 140px;
	--theme-radius: var(--radius);
}

/* [hidden] must win over any display utility on the element. */
[hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------- Header */
.theme-site-header .theme-header-bar {
	transition: background-color 500ms, border-color 500ms;
}

.site-logo-img {
	height: var(--logo-height, 88px) !important;
	width: auto !important;
	display: block;
}

@media (max-width: 639px) {
	.site-logo-img {
		height: calc(var(--logo-height, 88px) * 0.82) !important;
	}
}

.site-logo-text {
	display: block;
}

/* The transparent header uses the light artwork; the solid header uses the
   full-colour mark, exactly like the design's two logo files. */
.theme-logo-light {
	display: none;
}

.theme-site-header:not(.is-solid) .theme-logo-light {
	display: block;
}

.theme-site-header:not(.is-solid) .theme-logo-dark {
	display: none;
}

.theme-wordmark .site-logo-img {
	transition: opacity 500ms;
}

/* Inner pages use the solid header from the first paint. */
.theme-site-header.is-solid .theme-header-bar {
	background-color: hsl(var(--ivory) / 0.9);
	backdrop-filter: blur(24px);
	border-bottom-color: hsl(var(--foreground) / 0.1);
}

.theme-site-header:not(.is-solid) .theme-brand-link,
.theme-site-header:not(.is-solid) .site-logo-text {
	color: hsl(var(--background));
}

.theme-site-header.is-solid .theme-brand-link,
.theme-site-header.is-solid .site-logo-text {
	color: hsl(var(--foreground));
}

.theme-site-header:not(.is-solid) .theme-nav-link {
	color: hsl(var(--background) / 0.85);
}

.theme-site-header:not(.is-solid) .theme-nav-link:hover,
.theme-site-header:not(.is-solid) .theme-nav-link.is-active {
	color: hsl(var(--background));
}

.theme-site-header.is-solid .theme-nav-link {
	color: hsl(var(--foreground) / 0.75);
}

.theme-site-header.is-solid .theme-nav-link:hover,
.theme-site-header.is-solid .theme-nav-link.is-active {
	color: hsl(var(--primary));
}

.theme-nav-link .theme-nav-underline {
	opacity: 0;
	transform: translateX(-50%) scaleX(0);
}

.theme-nav-link.is-active .theme-nav-underline {
	opacity: 1;
	transform: translateX(-50%) scaleX(1);
}

.theme-site-header:not(.is-solid) .theme-menu-toggle,
.theme-site-header:not(.is-solid) .theme-cart-button {
	color: hsl(var(--background));
}

.theme-site-header:not(.is-solid) .theme-menu-toggle:hover,
.theme-site-header:not(.is-solid) .theme-cart-button:hover {
	background-color: hsl(var(--background) / 0.1);
}

.theme-site-header.is-solid .theme-menu-toggle,
.theme-site-header.is-solid .theme-cart-button {
	color: hsl(var(--foreground));
}

.theme-site-header.is-solid .theme-menu-toggle:hover,
.theme-site-header.is-solid .theme-cart-button:hover {
	background-color: hsl(var(--foreground) / 0.06);
}

/* Header offset for templates that do not carry their own top spacing classes.
   The product and archive templates keep the design's own pt-* utilities. */
.theme-inner-main {
	padding-top: calc(var(--logo-height, 88px) + 48px);
}

@media (min-width: 640px) {
	.theme-inner-main {
		padding-top: 140px;
	}
}

/* Checkout title sits under a fixed header, so it needs a larger offset than other inner pages. */
body.woocommerce-checkout .theme-inner-main {
	padding-top: calc(var(--theme-header-height) + 3rem);
}

.theme-home-main {
	padding-top: 0;
}

/* --------------------------------------------------------------- Reveals */
[data-reveal].is-revealed {
	opacity: 1;
	transform: translateY(0);
	will-change: auto;
}

/* Customizer preview and no-observer fallbacks must never hide content. */
body.is-customizer [data-reveal],
body.is-customizer .reveal-item {
	opacity: 1 !important;
	transform: none !important;
	transition: none !important;
}

html.no-intersection [data-reveal] {
	opacity: 1 !important;
	transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
	[data-reveal] {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}

/* Spinning text rings respect reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.theme-spin-group,
	.theme-spin-group * {
		animation: none !important;
	}
}

/* Card image link must be a block so inline whitespace never leaks into the
   grid cell, and it sits beneath the hover actions. */
.theme-product-card__image-wrapper > a {
	display: block;
}

/* ------------------------------------------------------------ Shop filter */
.is-hidden-by-default {
	display: none !important;
}

/* Search input reset so the design's border/padding survive the UA styles. */
.theme-field::-webkit-search-decoration,
.theme-field::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

/* ------------------------------------------------------------ Quantity UI */
.theme-quantity-wrapper input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
}

.theme-quantity-wrapper input[type="number"]::-webkit-outer-spin-button,
.theme-quantity-wrapper input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.theme-attr-select-hidden {
	display: none !important;
}

/* Single product: variation table reflow + pill styling. */
.single-product .grid,
.single-product .theme-product-gallery,
.single-product .theme-product-info {
	min-width: 0;
	max-width: 100%;
}

.single-product .theme-product-thumbnails {
	flex-wrap: wrap;
	max-width: 100%;
}

.single-product .variations,
.single-product .variations tbody,
.single-product .variations tbody tr,
.single-product .variations tbody td {
	display: block;
	width: 100%;
	border: 0;
	padding: 0;
	background: transparent;
}

.single-product .variations {
	border: 0;
	margin: 0 0 0.5rem;
}

.single-product .variations tbody td.label {
	padding-bottom: 0.25rem;
}

.single-product .variations tbody td.label label {
	font-size: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: hsl(var(--foreground) / 0.55);
	font-weight: 400;
}

.single-product .variations tbody td.value {
	padding-top: 0;
}

/* The pills render the visible label, so the native table label is hidden. */
.single-product .variations td.label {
	display: none;
}

.single-product .theme-add-to-cart-area .single_add_to_cart_button,
.single-product .theme-add-to-cart-area .theme-buy-now {
	flex: 1 1 auto;
	min-width: 160px;
}

.single-product .woocommerce-product-details__short-description,
.single-product .woocommerce-variation-description,
.single-product .posted_in {
	overflow-wrap: break-word;
	word-break: break-word;
}

.single-product .single_variation_wrap {
	margin-top: 0.5rem;
}

.single-product .woocommerce-variation-price {
	margin-bottom: 1rem;
	font-size: 20px;
	font-weight: 500;
	color: hsl(var(--foreground) / 0.9);
}

.single-product .woocommerce-variation-availability p {
	font-size: 14px;
	color: hsl(var(--foreground) / 0.65);
}

/* Disabled add-to-cart state (variable products and sold-out simple items). */
.single_add_to_cart_button.button:disabled,
.single_add_to_cart_button.button.disabled,
.add_to_cart_button.button:disabled,
.add_to_cart_button.button.disabled,
.single_add_to_cart_button.disabled,
.theme-buy-now:disabled,
.theme-buy-now.disabled {
	cursor: not-allowed !important;
	opacity: 0.4 !important;
	pointer-events: none !important;
}

.single_add_to_cart_button.button:disabled:hover,
.single_add_to_cart_button.button.disabled:hover,
.add_to_cart_button.button:disabled:hover,
.add_to_cart_button.button.disabled:hover,
.single_add_to_cart_button.disabled:hover,
.theme-buy-now:disabled:hover,
.theme-buy-now.disabled:hover {
	opacity: 0.4 !important;
}

/* WooCommerce's own spinner is replaced by the theme's loading state. */
.single-product .single_add_to_cart_button.loading::after,
.ajax_add_to_cart.loading::after {
	display: none !important;
}

.ajax_add_to_cart.theme-btn-loading {
	opacity: 0.6 !important;
	pointer-events: none !important;
	cursor: wait !important;
}

/* WooCommerce injects "View cart" after an AJAX add; the design has no such
   control, so it is hidden without touching designed links. */
.woocommerce-page a.added_to_cart.wc-forward,
.single-product a.added_to_cart.wc-forward,
body a.added_to_cart.wc-forward {
	display: none !important;
}

/* ---------------------------------------------------------- Cart drawer */
#theme-cart-overlay {
	position: fixed;
	inset: 0;
	z-index: 45;
	background-color: hsl(var(--foreground) / 0.35);
	backdrop-filter: blur(2px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 300ms ease;
}

body.cart-open #theme-cart-overlay {
	opacity: 1;
	pointer-events: auto;
}

#theme-cart-drawer {
	transform: translateX(100%);
	transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.cart-open #theme-cart-drawer {
	transform: translateX(0);
}

#theme-cart-drawer.is-updating > * {
	opacity: 0.6;
	pointer-events: none;
}

#theme-cart-drawer .woocommerce-message {
	display: none;
}

.theme-cart-count:empty {
	display: none;
}

.theme-cart-close:hover svg {
	transform: rotate(90deg);
	transition: transform 200ms ease;
}

/* ----------------------------------------------------- Floating badge */
.theme-floating-badge {
	transition: opacity 500ms ease;
}

.theme-badge-button {
	background-color: transparent;
	box-shadow: none;
	border: 0;
	padding: 0;
}

.theme-badge-button .theme-spin-group {
	animation-duration: 22s;
}

/* ------------------------------------------------------- FAQ accordions */
[data-faq-panel] {
	display: grid;
}

/* ------------------------------------------------------ Contact form */
.theme-field:focus {
	outline: none;
	border-color: hsl(var(--primary));
}

/* ------------------------------------------------------------ 404 / misc */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* ---------------------------------------- WooCommerce notices (styled) */
.woocommerce-notices-wrapper {
	width: 100%;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	background-color: hsl(var(--linen));
	color: hsl(var(--foreground));
	font-size: 14px;
	line-height: 1.6;
}

.woocommerce-error {
	border-color: hsl(var(--destructive) / 0.4);
	background-color: hsl(var(--destructive) / 0.06);
}

.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
	display: none;
}

/* Notices are already represented by the drawer on the single product page. */
.single-product .woocommerce-message,
.single-product .woocommerce-info {
	display: none;
}

/* ------------------------------------- WooCommerce Blocks: cart & notices */
/* Cross-sell grid and empty-cart controls are WooCommerce-generated markup
   with no counterpart in the design, so they copy the closest source element. */
.wc-block-grid__product,
.wp-block-woocommerce-cart .wc-block-grid__product {
	border: 0;
	padding: 0;
	font-family: 'Geist', system-ui, -apple-system, sans-serif;
}

.wc-block-grid__product-title,
.wp-block-woocommerce-cart .wc-block-grid__product-title,
.wc-block-grid__product-link .wc-block-grid__product-title {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 1.15rem;
	font-weight: 400;
	line-height: 1.375;
	color: hsl(var(--foreground));
	padding: 0.75rem 0 0;
	text-decoration: none;
}

a.wc-block-grid__product-link {
	text-decoration: none;
	color: hsl(var(--foreground));
}

a.wc-block-grid__product-link:hover .wc-block-grid__product-title {
	color: hsl(var(--primary));
}

.wc-block-grid__product-price {
	font-family: 'Geist', system-ui, -apple-system, sans-serif;
	font-size: 14px;
	font-weight: 500;
	color: hsl(var(--foreground) / 0.85);
}

.wc-block-grid__product-image img {
	border-radius: var(--radius);
}

.wp-block-button.wc-block-grid__product-add-to-cart {
	margin: 0.75rem 0 0;
}

.wp-block-button.wc-block-grid__product-add-to-cart .wp-block-button__link,
.wp-block-woocommerce-cart .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 9999px;
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	border: 1px solid hsl(var(--primary));
	padding: 0.55rem 1.5rem;
	font-family: 'Geist', system-ui, -apple-system, sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	transition: background-color 300ms;
}

.wp-block-button.wc-block-grid__product-add-to-cart .wp-block-button__link:hover,
.wp-block-woocommerce-cart .wp-block-button__link:hover {
	background-color: hsl(var(--primary) / 0.9);
	color: hsl(var(--primary-foreground));
}

/* The block's own "Return to shop" link and empty-cart call to action. */
.wp-block-woocommerce-cart .wc-block-cart__empty-cart__title {
	font-family: 'Geist', system-ui, -apple-system, sans-serif;
	font-size: 15px;
	color: hsl(var(--foreground) / 0.65);
}

body.woocommerce-cart .wc-block-components-button:not(.wc-block-components-button--link),
body.woocommerce-checkout .wc-block-components-button:not(.wc-block-components-button--link) {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	border-radius: 9999px;
	font-family: 'Geist', system-ui, -apple-system, sans-serif;
	font-size: 14px;
	font-weight: 500;
}

body.woocommerce-cart .wc-block-components-button:not(.wc-block-components-button--link):hover,
body.woocommerce-checkout .wc-block-components-button:not(.wc-block-components-button--link):hover {
	background-color: hsl(var(--primary) / 0.9);
	color: hsl(var(--primary-foreground));
}

body.woocommerce-cart .wc-block-components-button.wc-block-components-button--link,
body.woocommerce-checkout .wc-block-components-button.wc-block-components-button--link {
	color: hsl(var(--primary));
	font-family: 'Geist', system-ui, -apple-system, sans-serif;
	font-size: 14px;
}

/* ------------------------------------------------ WooCommerce blocks */
body.woocommerce-checkout .site-main .page-title,
body.woocommerce-cart .site-main .page-title,
body.woocommerce-account .site-main .page-title,
body.theme-thankyou-page .site-main .page-title {
	max-width: none;
}

body.woocommerce-checkout .wc-block-checkout,
body.woocommerce-cart .wp-block-woocommerce-cart,
body.woocommerce-account .woocommerce {
	width: 100%;
	max-width: none !important;
}

/* Single grid owner for the two-column checkout. Modern WooCommerce Blocks
   nests the sidebar layout inside an outer .wc-block-checkout wrapper, so the
   outer wrapper stays block and only the direct parent of the two columns
   becomes the grid. */
body.woocommerce-checkout .wc-block-checkout {
	display: block;
}

@media (min-width: 768px) {
	body.woocommerce-checkout .wc-block-components-sidebar-layout {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 2rem;
		align-items: start;
	}

	body.woocommerce-checkout .wc-block-checkout > .wc-block-components-notice-banner,
	body.woocommerce-checkout .wc-block-checkout > .wc-block-components-notices {
		grid-column: 1 / -1;
	}
}

body.woocommerce-checkout .wc-block-checkout__main,
body.woocommerce-checkout .wc-block-checkout__sidebar {
	min-width: 0;
	width: 100%;
	max-width: none;
}

body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-select select,
body.woocommerce-checkout .wc-blocks-components-select__select,
body.woocommerce-checkout .wc-block-components-textarea {
	width: 100% !important;
	max-width: none !important;
	border-radius: var(--radius) !important;
	border-color: hsl(var(--foreground) / 0.15) !important;
	background-color: hsl(var(--ivory)) !important;
	color: hsl(var(--foreground)) !important;
	font-family: 'Geist', system-ui, -apple-system, sans-serif !important;
	font-size: 14px !important;
}

body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-select select:focus,
body.woocommerce-checkout .wc-blocks-components-select__select:focus {
	border-color: hsl(var(--primary)) !important;
	box-shadow: none !important;
	outline: none !important;
}

body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-select label {
	color: hsl(var(--foreground) / 0.55) !important;
	font-family: 'Geist', system-ui, -apple-system, sans-serif !important;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button {
	background-color: hsl(var(--primary)) !important;
	color: hsl(var(--primary-foreground)) !important;
	border: 1px solid hsl(var(--primary)) !important;
	border-radius: 9999px !important;
	height: 3rem !important;
	font-family: 'Geist', system-ui, -apple-system, sans-serif !important;
	font-size: 14px !important;
	font-weight: 500 !important;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
	background-color: hsl(var(--primary) / 0.9) !important;
}

body.woocommerce-checkout .wc-block-checkout__sidebar {
	background-color: hsl(var(--linen));
	border: 1px solid hsl(var(--foreground) / 0.1);
	border-radius: calc(var(--radius) * 1.6);
	padding: 1.5rem;
}

body.woocommerce-checkout .wc-block-checkout__sidebar h2,
body.woocommerce-checkout .wc-block-components-title {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 400;
	color: hsl(var(--foreground));
}

body.woocommerce-checkout .wc-block-components-notice-banner {
	border-radius: var(--radius);
	border-color: hsl(var(--border));
	background-color: hsl(var(--linen));
	color: hsl(var(--foreground));
}

/* ------------------------------------------- Thank you / order details */
body.theme-thankyou-page {
	overflow-x: hidden;
}

body.theme-thankyou-page .woocommerce-order h2,
body.theme-thankyou-page .woocommerce-order-details__title,
body.theme-thankyou-page .woocommerce-column__title {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 400;
	font-size: 1.75rem;
	color: hsl(var(--foreground));
	padding: 0 0 1rem 0;
	display: block;
}

body.theme-thankyou-page .woocommerce-order-overview {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	list-style: none;
	margin: 0 0 2rem;
	padding: 1.5rem;
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	background-color: hsl(var(--linen));
}

body.theme-thankyou-page .woocommerce-order-overview li {
	margin: 0;
	font-size: 13px;
	color: hsl(var(--foreground) / 0.65);
}

body.theme-thankyou-page .woocommerce-order-overview li strong {
	display: block;
	margin-top: 0.25rem;
	font-size: 15px;
	color: hsl(var(--foreground));
}

body.theme-thankyou-page .woocommerce-order-details table {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: 14px;
}

body.theme-thankyou-page .woocommerce-order-details table th,
body.theme-thankyou-page .woocommerce-order-details table td {
	padding: 0.75rem 0.5rem;
	border-bottom: 1px solid hsl(var(--border));
	text-align: left;
	overflow-wrap: break-word;
}

body.theme-thankyou-page .woocommerce-order-details tfoot th {
	text-align: left;
}

body.theme-thankyou-page .woocommerce-order-details tfoot td {
	text-align: right;
}

body.theme-thankyou-page .woocommerce-customer-details {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-top: 2rem;
}

body.theme-thankyou-page .woocommerce-customer-details address {
	max-width: 480px;
	overflow-wrap: break-word;
	font-style: normal;
	font-size: 14px;
	line-height: 1.7;
	color: hsl(var(--foreground) / 0.75);
}

/* ---------------------------------------------- Classic checkout fallback */
body.woocommerce-checkout .form-row .input-text,
body.woocommerce-checkout .form-row select,
body.woocommerce-checkout .woocommerce-checkout .input-text {
	border-radius: var(--radius);
	border-color: hsl(var(--foreground) / 0.15);
	background-color: hsl(var(--ivory));
	font-family: 'Geist', system-ui, -apple-system, sans-serif;
	font-size: 14px;
}

/* ------------------------------------------------------- Cart / account */
body.woocommerce-cart .shop_table,
body.woocommerce-account .shop_table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

body.woocommerce-cart .shop_table th,
body.woocommerce-cart .shop_table td,
body.woocommerce-account .shop_table th,
body.woocommerce-account .shop_table td {
	padding: 0.9rem 0.5rem;
	border-bottom: 1px solid hsl(var(--border));
	text-align: left;
}

body.woocommerce-cart .button,
body.woocommerce-account .button {
	border-radius: 9999px;
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	border: 1px solid hsl(var(--primary));
	font-size: 14px;
	font-weight: 500;
	padding: 0.65rem 1.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ------------------------------------------------------ Entry typography */
/* Scoped so WooCommerce Blocks (cart, checkout, cross-sells) keep their own
   designed link and heading treatment. */
.entry-content h2:not([class*="wc-block"]):not(.wp-block-heading),
.entry-content h3:not([class*="wc-block"]):not(.wp-block-heading) {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 400;
	color: hsl(var(--foreground));
}

.entry-content p:not([class*="wc-block"]) a:not([class*="wc-block"]):not(.wp-block-button__link),
.entry-content ul:not([class*="wc-block"]) a:not([class*="wc-block"]),
.entry-content ol:not([class*="wc-block"]) a:not([class*="wc-block"]) {
	color: hsl(var(--primary));
	text-decoration: underline;
	text-underline-offset: 2px;
}

.entry-content ul:not([class*="wc-block"]),
.entry-content ol:not([class*="wc-block"]) {
	padding-left: 1.25rem;
	list-style: disc;
}

.entry-content > p {
	margin-bottom: 1rem;
}
