/* Flowix — Shop Features. Every piece is stylable under Customize → Style Every Element → Shop Features. */

/* ── Badges ── */
.fx-badges { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; z-index: 3; pointer-events: none; }
.fx-badge--low { background: var(--amber, #d89a3c); color: var(--amber-ink, #1c0f06); }
.fx-badge--oos { background: var(--tx-strong, #1c0f06); color: var(--bg-page, #fff); }
.fx-badge--custom { background: var(--fx-accent, var(--gold, #b85c3a)); color: #fff; }
.woocommerce ul.products li.product { position: relative; }
.woocommerce ul.products li.product > a { position: relative; display: block; }
.woocommerce div.product { position: relative; }
.woocommerce div.product > .fx-badges { top: 16px; left: 16px; }

/* ── Card buttons (wishlist, quick view) ── */
.fx-card-btns { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 4; }
.fx-card-btn {
	width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
	display: grid; place-items: center;
	background: var(--bg-surface, #fff); color: var(--tx-strong, #1c0f06);
	box-shadow: 0 4px 14px var(--shadow-warm, rgba(0,0,0,.12));
	opacity: 0; transform: translateX(8px);
	transition: opacity .25s, transform .25s, background .2s, color .2s;
}
.fx-card-btn:nth-child(2) { transition-delay: .05s; }
.product-card:hover .fx-card-btn, li.product:hover .fx-card-btn, .fx-card-btn:focus-visible, .fx-wl-btn.is-on { opacity: 1; transform: none; }
@media (hover: none) { .fx-card-btn { opacity: 1; transform: none; } }
.fx-card-btn:hover { background: var(--tx-strong, #1c0f06); color: var(--bg-page, #fff); }
.fx-card-btn svg { pointer-events: none; }
.fx-wl-btn.is-on { color: var(--terracotta, #c0392b); }
.fx-wl-btn.is-on svg { fill: currentColor; }
.fx-wl-btn.is-on:hover { background: var(--bg-surface, #fff); color: var(--terracotta, #c0392b); }
.fx-pop svg { animation: fx-pop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes fx-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.fx-card-btn.is-loading { animation: fx-pulse 0.8s infinite alternate; }
@keyframes fx-pulse { to { opacity: .45; } }

/* Colour dots on cards */
.fx-card-dots { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
li.product .fx-card-dots { justify-content: inherit; padding: 0 0 6px; }
.fx-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* ── Quick view ── */
html.fx-qv-lock { overflow: hidden; }
.fx-qv-modal { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 16px; }
.fx-qv-backdrop { position: absolute; inset: 0; background: rgba(15,10,5,.55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; }
.fx-qv-dialog {
	position: relative; width: min(960px, 100%); max-height: calc(100vh - 32px); overflow: auto;
	background: var(--bg-page, #fff); color: var(--tx-strong, #1c0f06); border-radius: var(--radius-lg, 8px);
	box-shadow: 0 30px 80px rgba(0,0,0,.35);
	opacity: 0; transform: translateY(20px) scale(.97); transition: opacity .25s, transform .25s;
}
.fx-qv-modal.is-open .fx-qv-backdrop, .fx-qv-modal.is-open .fx-qv-dialog { opacity: 1; transform: none; }
.fx-qv-close { position: absolute; top: 10px; right: 12px; z-index: 5; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--bg-surface, #fff); color: inherit; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.fx-qv { display: grid; grid-template-columns: 1fr 1fr; }
.fx-qv-media { position: relative; background: var(--bg-tint2, var(--bg-tint, #f6f1ea)); }
.fx-qv-main img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.fx-qv-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
.fx-qv-thumb { flex: 0 0 56px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; cursor: pointer; background: none; }
.fx-qv-thumb.is-on, .fx-qv-thumb:hover { border-color: var(--tx-strong, #1c0f06); }
.fx-qv-thumb img { display: block; width: 100%; height: 56px; object-fit: cover; }
.fx-qv-summary { padding: 36px 32px 28px; display: flex; flex-direction: column; gap: 10px; }
.fx-qv-title { margin: 0 30px 0 0; }
.fx-qv-summary .price { font-size: 1.3rem; }
.fx-qv-summary form.cart { margin: 8px 0 0; }
.fx-qv-more { margin-top: auto; font-weight: 600; font-size: .9rem; }
.fx-qv-dialog .fx-qv.product div.summary { width: auto !important; float: none !important; margin: 0 !important; }
.fx-qv .fx-qv-summary .woocommerce-product-details__short-description, .fx-qv-summary p { max-width: none; }
.fx-qv table.variations, .fx-qv table.variations tbody, .fx-qv table.variations tr, .fx-qv table.variations th, .fx-qv table.variations td { display: block; width: auto; padding: 0; text-align: left; }
.fx-qv table.variations tr { margin-bottom: 14px; }
.fx-qv table.variations th { margin-bottom: 8px; }
.fx-qv form.cart .woocommerce-variation-add-to-cart, .fx-qv form.cart:not(.variations_form) { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.fx-qv form.cart .fx-buy-now { margin-left: 0; }
@media (max-width: 700px) { .fx-qv { grid-template-columns: 1fr; } .fx-qv-summary { padding: 22px 18px; } }

/* ── Swatches ── */
.fx-swatch-wrap select { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; }
.fx-swatch-wrap { position: relative; }
.fx-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-swatch {
	--fx-sw: transparent;
	min-width: 36px; height: 36px; padding: 0; border: 1px solid var(--bd-light, #ddd); border-radius: 50%;
	background: var(--fx-sw); color: var(--tx-strong, #1c0f06); cursor: pointer; overflow: hidden;
	display: inline-grid; place-items: center; font: 600 .8rem/1 var(--font-ui, inherit);
	box-shadow: 0 0 0 2px var(--bg-page, #fff) inset; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.fx-swatches--rounded .fx-swatch { border-radius: 8px; }
.fx-swatches--square .fx-swatch { border-radius: 0; }
.fx-swatch.is-label { padding: 0 14px; border-radius: 999px; background: var(--bg-surface, #fff); box-shadow: none; }
.fx-swatches--rounded .fx-swatch.is-label { border-radius: 8px; }
.fx-swatches--square .fx-swatch.is-label { border-radius: 0; }
.fx-swatch.is-image img { width: 100%; height: 100%; object-fit: cover; }
.fx-swatch.is-image { width: 44px; height: 44px; }
.fx-swatch:hover { transform: translateY(-1px); border-color: var(--tx-strong, #1c0f06); }
.fx-swatch.is-selected { border-color: var(--tx-strong, #1c0f06); box-shadow: 0 0 0 2px var(--bg-page, #fff) inset, 0 0 0 2px var(--tx-strong, #1c0f06); }
.fx-swatch.is-label.is-selected { background: var(--tx-strong, #1c0f06); color: var(--bg-page, #fff); box-shadow: none; }
.fx-swatch.is-disabled { opacity: .3; cursor: not-allowed; position: relative; }
.fx-swatch.is-disabled::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: currentColor; transform: rotate(45deg); }
.fx-swatch-chosen { display: block; margin-top: 6px; font-size: .85rem; color: var(--tx-muted, #6b5a4c); min-height: 1.2em; }
.woocommerce div.product form.cart .variations td, .woocommerce div.product form.cart .variations th { vertical-align: top; padding-bottom: 14px; }

/* ── Sale countdown & urgency ── */
.fx-sale-cd { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 4px 0 16px; padding: 12px 14px; border-radius: var(--radius-md, 4px); background: color-mix(in srgb, var(--terracotta, #c0392b) 9%, transparent); color: var(--terracotta, #c0392b); font-weight: 600; }
.fx-sale-cd-label { display: inline-flex; align-items: center; gap: 6px; }
.fx-sale-cd .fx-countdown--inline { display: flex; gap: 6px; }
.fx-sale-cd .fx-cd-unit { display: inline-flex; align-items: baseline; gap: 1px; padding: 4px 7px; border-radius: 4px; background: var(--bg-page, #fff); color: var(--tx-strong, #1c0f06); font-variant-numeric: tabular-nums; }
.fx-sale-cd .fx-cd-num { font-size: 1rem; font-weight: 700; }
.fx-sale-cd .fx-cd-label { font-size: .7rem; opacity: .7; }
.fx-urgency { margin: 0 0 16px; }
.fx-urgency p { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-weight: 600; color: var(--terracotta, #c0392b); }
.fx-urgency-bar { display: block; height: 6px; border-radius: 6px; background: var(--bd-light, #eee); overflow: hidden; }
.fx-urgency-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--terracotta, #c0392b), var(--amber, #d89a3c)); }

/* ── Buy now ── */
form.cart .fx-buy-now, .woocommerce div.product form.cart .fx-buy-now {
	margin-left: 8px; padding: 15px 30px; flex: 1;
	background: var(--fx-accent, var(--gold, #b8893a)); border: 1px solid var(--fx-accent, var(--gold, #b8893a)); color: #fff !important;
	font: 700 .75rem/1 var(--font-ui, inherit); letter-spacing: .2em; text-transform: uppercase; cursor: pointer;
}
form.cart .fx-buy-now:hover { filter: brightness(1.08); }
.woocommerce-variation-add-to-cart-disabled .fx-buy-now { opacity: .5; pointer-events: none; }
li.product .fx-card-dots { padding: 0 18px 6px; }
form.cart.variations_form .fx-buy-now, form.cart .fx-buy-now { vertical-align: middle; }
@media (max-width: 480px) { form.cart .fx-buy-now { width: 100%; margin: 10px 0 0 !important; } }


/* ── Delivery & trust ── */
.fx-delivery { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 12px; padding: 12px 14px; border: 1px solid var(--bd-light, #e6ddd2); border-radius: var(--radius-md, 4px); }
.fx-delivery svg { flex: none; margin-top: 2px; color: var(--sage, #5d7a5a); }
.fx-delivery p { margin: 0; }
.fx-del-within { display: block; font-size: .85rem; color: var(--sage, #5d7a5a); font-weight: 600; }
.fx-del-within:empty { display: none; }
.fx-trust { list-style: none; margin: 12px 0 20px; padding: 0; display: grid; gap: 8px; }
.fx-trust li { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--tx-mid, #4a3a2e); }
.fx-trust svg { flex: none; color: var(--tx-strong, #1c0f06); }

/* ── Product page layout ── */
@media (min-width: 769px) {
	.fx-pp-gallery-right.woocommerce div.product div.images, .fx-pp-gallery-right .woocommerce div.product div.images { float: right; }
	.fx-pp-gallery-right.woocommerce div.product div.summary, .fx-pp-gallery-right .woocommerce div.product div.summary { float: left; }
	.fx-pp-sticky .woocommerce div.product div.summary, .fx-pp-sticky.woocommerce div.product div.summary { position: sticky; top: calc(var(--fx-header-h, 80px) + 20px); }
}
.fx-acc-head { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 16px 0; border: 0; border-bottom: 1px solid var(--bd-light, #e6ddd2); background: none; color: var(--tx-strong, #1c0f06); font: 600 1.05rem var(--font-display, inherit); text-align: left; cursor: pointer; }
.fx-acc-head::after { content: "+"; font-size: 1.4rem; font-weight: 300; transition: transform .2s; }
.fx-acc-head[aria-expanded="true"]::after { transform: rotate(45deg); }
.fx-pp-tabs-accordion .woocommerce-tabs .woocommerce-Tabs-panel { padding: 16px 0; margin: 0; border: 0; }
.fx-tab-title { margin: 32px 0 12px; }
.fx-pp-top { display: flow-root; position: relative; }
.fx-pp-top > .fx-badges { top: 16px; left: 16px; }
.fx-pp-tabs-accordion .woocommerce-Reviews-title, .fx-pp-tabs-open .woocommerce-tabs .woocommerce-Tabs-panel > h2:first-child, .fx-pp-tabs-accordion .woocommerce-tabs .woocommerce-Tabs-panel > h2:first-child { display: none; }

/* ── Free-delivery bar ── */
.fx-fsb { margin: 0 0 16px; }
.fx-fsb-msg { margin: 0 0 8px; font-size: .9rem; font-weight: 600; color: var(--tx-strong, #1c0f06); }
.fx-fsb-track { display: block; height: 8px; border-radius: 8px; background: var(--bd-light, #eee); overflow: hidden; }
.fx-fsb-fill { display: block; height: 100%; border-radius: inherit; background: var(--sage, #5d7a5a); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.fx-fsb.is-done .fx-fsb-fill { background: linear-gradient(90deg, var(--sage, #5d7a5a), var(--gold, #c8a04a)); }
.fx-fsb--note { padding: 10px 12px; border: 1px dashed var(--bd-light, #ccc); font-size: .85rem; color: var(--tx-muted, #6b5a4c); }
.fx-fsb--compact { margin: 0; min-width: 200px; }
.fx-fsb--compact .fx-fsb-msg { font-size: .75rem; margin-bottom: 4px; }
.fx-fsb--compact .fx-fsb-track { height: 4px; }
.mini-cart-body .fx-fsb { padding: 0 0 14px; border-bottom: 1px solid var(--bd-light, #eee); }

/* ── Added-to-cart toast ── */
.fx-toast {
	position: fixed; right: 20px; bottom: 20px; z-index: 99999; display: flex; gap: 12px; align-items: center;
	width: min(360px, calc(100vw - 32px)); padding: 12px; border-radius: var(--radius-lg, 8px);
	background: var(--bg-page, #fff); color: var(--tx-strong, #1c0f06); box-shadow: 0 18px 50px rgba(0,0,0,.22);
	opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .3s, transform .3s;
}
.fx-toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
.fx-toast img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; flex: none; }
.fx-toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .85rem; }
.fx-toast-body strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-toast-body span { color: var(--sage, #5d7a5a); font-weight: 600; }
.fx-toast-links { display: flex; gap: 12px; margin-top: 4px; }
.fx-toast-links a { font-weight: 700; text-decoration: underline; }
@media (max-width: 600px) { .fx-toast { right: 16px; bottom: 16px; } }

/* ── Load more ── */
.fx-loadmore { display: flex; justify-content: center; margin: 32px 0; }
.fx-new-item { opacity: 0; transform: translateY(12px); }
ul.products > *, .products-grid > * { transition: opacity .4s, transform .4s; }

/* ── Product lists (wishlist, recently viewed) ── */
.fx-plist.is-loading .fx-plist-grid { min-height: 200px; opacity: .5; }
.fx-plist-empty { text-align: center; padding: 40px 16px; color: var(--tx-muted, #6b5a4c); }
.fx-form-error { margin-bottom: 12px; }

/* Options table above the price/add-to-cart row (WooCommerce puts them side by side, which squeezes swatches). */
.woocommerce div.product form.variations_form, .fx-qv form.variations_form { display: block; }
.woocommerce div.product form.variations_form table.variations { width: 100%; margin-bottom: 8px; }
.woocommerce div.product form.variations_form .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.woocommerce div.product form.variations_form .woocommerce-variation-add-to-cart .fx-buy-now { margin-left: 0; }
.woocommerce div.product form.variations_form .woocommerce-variation-description p { margin: 0 0 12px; }
.fx-qv-media { align-self: start; }
.fx-qv .variations th, .fx-qv .variations td, .fx-qv .variations label { padding: 0 !important; margin: 0 !important; line-height: 1.4; }
.fx-qv table.variations th { margin-bottom: 8px !important; }
.fx-qv table.variations { margin: 6px 0 14px !important; }

/* Phones: quantity + Add to cart on one row, Buy now full width underneath. */
@media (max-width: 600px) {
	.woocommerce div.product form.cart:not(.variations_form), .woocommerce div.product form.cart .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; gap: 8px; }
	.woocommerce div.product form.cart .single_add_to_cart_button { flex: 1 1 auto; padding-left: 16px !important; padding-right: 16px !important; white-space: nowrap; }
	.woocommerce div.product form.cart .fx-buy-now { flex: 1 1 100%; margin: 0 !important; }
}


/* Free-delivery bar fill, in steps of 5%. */
.fx-fsb-fill--0 { width: 0%; }
.fx-fsb-fill--5 { width: 5%; }
.fx-fsb-fill--10 { width: 10%; }
.fx-fsb-fill--15 { width: 15%; }
.fx-fsb-fill--20 { width: 20%; }
.fx-fsb-fill--25 { width: 25%; }
.fx-fsb-fill--30 { width: 30%; }
.fx-fsb-fill--35 { width: 35%; }
.fx-fsb-fill--40 { width: 40%; }
.fx-fsb-fill--45 { width: 45%; }
.fx-fsb-fill--50 { width: 50%; }
.fx-fsb-fill--55 { width: 55%; }
.fx-fsb-fill--60 { width: 60%; }
.fx-fsb-fill--65 { width: 65%; }
.fx-fsb-fill--70 { width: 70%; }
.fx-fsb-fill--75 { width: 75%; }
.fx-fsb-fill--80 { width: 80%; }
.fx-fsb-fill--85 { width: 85%; }
.fx-fsb-fill--90 { width: 90%; }
.fx-fsb-fill--95 { width: 95%; }
.fx-fsb-fill--100 { width: 100%; }

/* Shop colours (classes and --fx-c come from flowix_shop_colors_css()) */
.fx-dot { background: var(--fx-c, transparent); }
.fx-badge--custom[class*="fx-c-"] { background: var(--fx-c); }
.fx-swatch.is-color { --fx-sw: var(--fx-c, transparent); }

/* Low-stock bar fill, in 5% steps */
.fx-urgency-fill.fx-w-5 { width: 5%; }
.fx-urgency-fill.fx-w-10 { width: 10%; }
.fx-urgency-fill.fx-w-15 { width: 15%; }
.fx-urgency-fill.fx-w-20 { width: 20%; }
.fx-urgency-fill.fx-w-25 { width: 25%; }
.fx-urgency-fill.fx-w-30 { width: 30%; }
.fx-urgency-fill.fx-w-35 { width: 35%; }
.fx-urgency-fill.fx-w-40 { width: 40%; }
.fx-urgency-fill.fx-w-45 { width: 45%; }
.fx-urgency-fill.fx-w-50 { width: 50%; }
.fx-urgency-fill.fx-w-55 { width: 55%; }
.fx-urgency-fill.fx-w-60 { width: 60%; }
.fx-urgency-fill.fx-w-65 { width: 65%; }
.fx-urgency-fill.fx-w-70 { width: 70%; }
.fx-urgency-fill.fx-w-75 { width: 75%; }
.fx-urgency-fill.fx-w-80 { width: 80%; }
.fx-urgency-fill.fx-w-85 { width: 85%; }
.fx-urgency-fill.fx-w-90 { width: 90%; }
.fx-urgency-fill.fx-w-95 { width: 95%; }
.fx-urgency-fill.fx-w-100 { width: 100%; }
