/*
 * Fivany base layer — applies the Opnar design tokens to Storefront's
 * global elements. Loaded after the parent stylesheet so these win.
 */

body,
button,
input,
select,
optgroup,
textarea,
.site-header,
.site-footer {
	font-family: var(--fv-font);
	font-size: var(--fv-fs-base);
	color: var(--fv-ink);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	background: var(--fv-bg);
	line-height: 1.6;
}

/*
 * Page rail — matches Opnar's layout container exactly:
 *   `max-w-[1440px] px-[10px] md:px-6`  (app/[locale]/layout.tsx)
 * i.e. 10px gutters on mobile, 24px from 768px up.
 *
 * `margin: auto` is not cosmetic. Storefront switches `.col-full` from
 * padding to a fixed em MARGIN below 66.5em, and again below 568px
 * (`margin: 0 1.41575em` ≈ 18px at our 13px base). That margin stacked on
 * top of this padding, so mobile content sat ~34px in from each edge
 * instead of 10px — losing ~14% of a 390px screen to empty gutters.
 *
 * `box-sizing: border-box` overrides Storefront's `content-box`, so the
 * 1440px cap includes the gutters rather than adding to them.
 */
.col-full {
	max-width: var(--fv-maxw);
	margin-left: auto;
	margin-right: auto;
	padding-left: 10px;
	padding-right: 10px;
	box-sizing: border-box;
}

@media (min-width: 768px) {
	.col-full {
		padding-left: var(--fv-pad-x);
		padding-right: var(--fv-pad-x);
	}
}

/* ── Headings ──────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6,
.entry-title,
.page-title {
	font-family: var(--fv-font);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.25;
	color: var(--fv-ink);
}

h1, .entry-title, .page-title { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }

/* ── Links ─────────────────────────────────────────────────────── */

a {
	color: var(--fv-accent);
	text-decoration: none;
	transition: color 0.15s ease;
}

a:hover {
	color: var(--fv-accent-hover);
}

/* ── Numerals go mono, everywhere ──────────────────────────────── */

.woocommerce-Price-amount,
.price,
.quantity input,
.order-total,
.woocommerce-Price-currencySymbol {
	font-family: var(--fv-mono);
	font-variant-numeric: tabular-nums;
}

/* ── Buttons ───────────────────────────────────────────────────── */

.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
button,
input[type="submit"] {
	background: var(--fv-accent);
	color: #fff;
	border: 0;
	border-radius: var(--fv-radius-md);
	font-family: var(--fv-font);
	font-weight: 600;
	font-size: 12.5px;
	letter-spacing: 0.01em;
	padding: 10px 18px;
	line-height: 1.2;
	transition: background 0.15s ease, transform 0.1s ease;
	cursor: pointer;
}

/*
 * Hover is for pointers only.
 *
 * A tap on a touch screen applies `:hover` and leaves it applied until
 * something else is touched. Every button on this site therefore stayed in
 * its hover colour after being pressed — harmless-looking until the product
 * page's Adding state tried to paint its button white and this rule kept
 * putting `--fv-accent-hover` back, which is the muted orange that appeared
 * on the phone and never on a desktop.
 *
 * Gating on `hover: hover` removes the effect from devices that cannot
 * really hover, where it was only ever a bug. Pointer devices are unchanged.
 *
 * `hover` alone, without `pointer: fine`: a laptop with a touchscreen reports
 * a coarse primary pointer while still having a mouse, and pairing the two
 * would have taken hover away from it as well.
 * `:active` below stays outside the query — a press is real on any device and
 * is what gives a tap its feedback.
 */
@media (hover: hover) {
	.woocommerce #respond input#submit:hover,
	.woocommerce a.button:hover,
	.woocommerce button.button:hover,
	.woocommerce input.button:hover,
	.woocommerce #respond input#submit.alt:hover,
	.woocommerce a.button.alt:hover,
	.woocommerce button.button.alt:hover,
	.woocommerce input.button.alt:hover,
	button:hover,
	input[type="submit"]:hover {
		background: var(--fv-accent-hover);
		color: #fff;
	}
}

.woocommerce a.button:active,
.woocommerce button.button:active,
button:active {
	transform: translateY(1px);
}

/* Secondary / ghost buttons — cream chip on a white surface. */
.woocommerce a.button.fv-ghost,
.woocommerce button.button.fv-ghost {
	background: var(--fv-cream);
	color: var(--fv-ink);
	border: 1px solid var(--fv-line);
}

.woocommerce a.button.fv-ghost:hover,
.woocommerce button.button.fv-ghost:hover {
	background: var(--fv-cream-hover);
	color: var(--fv-accent);
	border-color: var(--fv-accent);
}

/* ── Form fields ───────────────────────────────────────────────── */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
select,
textarea,
.select2-container .select2-selection--single {
	border: 1px solid var(--fv-line);
	border-radius: var(--fv-radius-md);
	background: var(--fv-surface);
	padding: 9px 12px;
	font-size: 13px;
	color: var(--fv-ink);
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
	/* Border colour only — no glow. The 3px accent halo these rules used to
	 * carry read as a hover/click "shadow effect"; the border change alone
	 * still shows which field is active. */
	border-color: var(--fv-accent);
	outline: 0;
}

/* ── Focus ─────────────────────────────────────────────────────────
 * Storefront paints
 *   a:focus, input:focus, textarea:focus, button:focus
 *     { outline: 2px solid #7f54b3 }
 * — its own purple brand colour — so clicking any link, field or button
 * flashed a violet ring. It also greys fields on focus
 * (`background-color: #ededed`).
 *
 * Both are replaced with a brand ring shown only for KEYBOARD focus.
 * `outline: none` alone would be an accessibility regression: mouse users
 * get no ring (what you want), keyboard users still get a clear one.
 */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
	outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--fv-accent);
	outline-offset: 2px;
	border-radius: var(--fv-radius-sm);
}

/* Undo Storefront's grey-on-focus fill. */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
.input-text:focus {
	background-color: var(--fv-surface);
}

/* Header fields sit inside their own pill, so they stay transparent. */
.fv-hdr input:focus,
.fv-hdr .srch input:focus,
.fv-hdr .m-srch .box input:focus {
	background-color: transparent;
	box-shadow: none;
	border-color: transparent;
}

/* ── Notices ───────────────────────────────────────────────────── */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	border-radius: var(--fv-radius-lg);
	border-top: 0;
	background: var(--fv-cream);
	color: var(--fv-ink);
	font-size: 12.5px;
	box-shadow: var(--fv-shadow-sm);
	border-left: 3px solid var(--fv-accent);
}

.woocommerce-message::before,
.woocommerce-info::before {
	color: var(--fv-accent);
}

.woocommerce-error {
	border-left-color: var(--fv-hot);
	background: #fff5f5;
}

.woocommerce-error::before {
	color: var(--fv-hot);
}

/* Storefront's default page-header block is heavier than Opnar's. */
.storefront-breadcrumb {
	background: transparent;
	padding: 12px 0 0;
	margin-bottom: 0;
	font-size: 11.5px;
	color: var(--fv-ink-3);
}

.storefront-breadcrumb a {
	color: var(--fv-ink-3);
}

.storefront-breadcrumb a:hover {
	color: var(--fv-accent);
}

/*
 * Page rhythm, matched to Opnar's `<main>`:
 *   px-[10px] pt-1 pb-3  md:px-6 md:pt-2 md:pb-8
 * i.e. 4px top / 12px bottom on mobile, 8px / 32px from 768px up. The
 * horizontal half of that lives in `.col-full` above.
 *
 * Storefront opens this region with `padding-top: 4.235801032em` (~68px)
 * and a 2.6em bottom margin — an order of magnitude looser than Opnar,
 * which is why the override sets all four rather than just trimming.
 *
 * The bottom padding is also what separates the last block from the
 * footer, so the footer carries no margin of its own.
 */
.site-main {
	padding-top: 4px;
	padding-bottom: 12px;
	margin-bottom: 0;
}

.site-content {
	padding-top: 0;
}

@media (min-width: 768px) {
	.site-main {
		padding-top: 8px;
		padding-bottom: 32px;
	}
}

/* ── Sticky header, unblocked ──────────────────────────────────────
 * The header already asked to be sticky (`.fv-hdr .hdr`, header.css) and
 * never was. Two things stopped it; this is one of them (the other is the
 * wrapper height, see `.fv-hdr` in chrome.css).
 *
 * Storefront's style.css sets `overflow-x: hidden` on `.site`, and an
 * ancestor with a non-visible overflow becomes a scroll container — the
 * sticky bar then pins to a box that scrolls away with the page, which
 * looks exactly like sticky doing nothing.
 *
 * `clip` rather than dropping the rule: it still contains horizontal
 * overflow, which is why Storefront set it, but unlike `hidden` it does not
 * create a scroll container, so sticky resolves to the viewport.
 *
 * Scoped to `.site` on purpose. Storefront sets the same on `body`, and
 * that one is harmless — overflow on `body` propagates to the viewport
 * rather than making body a scroll container — so it is left alone.
 * Verified by putting each back to `hidden` in turn: only `.site` broke it.
 *
 * Browsers without `overflow: clip` (Safari below 16) discard this and keep
 * Storefront's `hidden`: no sticky header, but no sideways scroll either —
 * the old behaviour, exactly.
 */
.site {
	overflow-x: clip;
}

/*
 * Clear the WordPress admin bar.
 *
 * It is fixed above 600px, so a header pinned to 0 slides underneath it and
 * loses its top edge — only staff ever see this, which is precisely why it
 * would go unreported. Below 600px the admin bar scrolls away with the page
 * and 0 is correct.
 */
@media screen and (min-width: 783px) {
	body.admin-bar .fv-hdr .d-top,
	body.admin-bar .fv-hdr .m-top {
		top: 32px;
	}
}

@media screen and (min-width: 601px) and (max-width: 782px) {
	body.admin-bar .fv-hdr .d-top,
	body.admin-bar .fv-hdr .m-top {
		top: 46px;
	}
}

/* ==========================================================================
   Assurance strip — the cash-on-delivery promises, shared across the funnel
   ==========================================================================

   One component, three surfaces. A buyer paying on delivery decides on
   certainty rather than price, so the same four facts follow them from the
   product page to the thank-you page and are never phrased differently in
   two places.

   Built as a label/value list rather than badges: badges compress a promise
   into a word ("COD"), and the specific half is the half that convinces —
   "ঢাকায় ৳60" persuades where "delivery available" does not.
*/

.fv-assure {
	margin: 14px 0 0;
	padding: 12px 14px;
	border: 1px solid var(--fv-line, #ece7e2);
	border-radius: var(--fv-radius-md, 4px);
	background: var(--fv-tint, #fff7f1);
}

.fv-assure-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.fv-assure-row {
	display: grid;
	grid-template-columns: 18px 1fr;
	align-items: start;
	gap: 10px;
	margin: 0;
}

.fv-assure-ic {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 18px;
	color: var(--fv-accent, #ff6b00);
}

.fv-assure-ic .i {
	width: 16px;
	height: 16px;
}

/*
 * Label above value, always.
 *
 * These were laid out side by side with the label sized to its own text,
 * which meant no two rows shared a left edge for their value and the long
 * delivery line wrapped back under its own label. Stacking costs a few
 * pixels of height and gives every row one flush left edge to scan down.
 */
.fv-assure-tx {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

/*
 * Bangla, not mono.
 *
 * The site labels data rows in uppercase JetBrains Mono, and that treatment
 * is wrong for this script twice over: Bangla has no case to upper, and the
 * tracking that makes a Latin label read as a label pulls Bangla conjuncts
 * apart. Hind Siliguri is already loaded for exactly this text.
 */
.fv-assure-tx .k {
	font-family: 'Hind Siliguri', var(--fv-sans, 'Inter', system-ui, sans-serif);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	color: var(--fv-ink-3, #8a8078);
}

.fv-assure-tx .v {
	font-family: 'Hind Siliguri', var(--fv-sans, 'Inter', system-ui, sans-serif);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
	color: var(--fv-ink, #1c1917);
	min-width: 0;
}

/*
 * The per-zone table.
 *
 * Charge and timeline answered together, one line per destination. A fixed
 * first column is what makes the two figures line up under each other —
 * which is the whole reason this is a table and not a "·"-joined sentence
 * that wrapped into an unreadable run-on on a phone.
 */
.fv-zones {
	display: grid;
	gap: 3px 12px;
	margin-top: 1px;
}

.fv-zones .z {
	display: grid;
	grid-template-columns: 84px 1fr;
	align-items: baseline;
	gap: 10px;
	min-width: 0;
}

.fv-zones .zn {
	font-family: 'Hind Siliguri', var(--fv-sans, 'Inter', system-ui, sans-serif);
	font-size: 13px;
	font-weight: 500;
	color: var(--fv-ink-2, #57534e);
}

/*
 * Charge and time, with real air between them.
 *
 * The separator is drawn by the stylesheet rather than sitting in the
 * string, so the gap on either side of it is a number that can be tuned —
 * and so a cramped screen wraps the pair onto two lines instead of jamming
 * them together.
 */
.fv-zones .zv {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 14px;
	min-width: 0;
}

.fv-zones .zc,
.fv-zones .ze {
	font-family: 'Hind Siliguri', var(--fv-sans, 'Inter', system-ui, sans-serif);
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.45;
	color: var(--fv-ink, #1c1917);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.fv-zones .ze {
	font-weight: 600;
	color: var(--fv-ink-2, #57534e);
}

/* The dot belongs to the gap, so it is centred in it rather than nudged
   against the word that follows. */
.fv-zones .ze::before {
	content: '·';
	margin-right: 14px;
	color: var(--fv-ink-3, #8a8078);
	font-weight: 400;
}

/* Wrapped onto its own line, the separator would dangle at the start. */
@media (max-width: 359px) {
	.fv-zones .ze::before {
		content: none;
	}
}

/* The free-delivery clause reads as a footnote to the table above it. */
.fv-assure-note {
	margin-top: 4px;
	font-family: 'Hind Siliguri', var(--fv-sans, 'Inter', system-ui, sans-serif);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--fv-accent, #ff6b00);
}

a.fv-assure-tx-link,
.fv-assure-tx a.v {
	color: var(--fv-accent, #ff6b00);
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}

.fv-assure-tx a.v:hover,
.fv-assure-tx a.v:focus-visible {
	text-decoration: underline;
}

/*
 * On the cart and checkout the strip is reassurance beside a decision
 * already made, so it recedes: no fill, tighter rows, quieter type.
 */
.fv-assure-cart,
.fv-assure-checkout {
	background: transparent;
	padding: 12px 0 0;
	border: 0;
	border-top: 1px solid var(--fv-line, #ece7e2);
}

@media (min-width: 768px) {
	.fv-assure-list {
		gap: 12px;
	}

	.fv-assure-tx .v {
		font-size: 14.5px;
	}

	.fv-zones .z {
		grid-template-columns: 96px 1fr;
	}
}

/*
 * Very narrow phones.
 *
 * Below about 360px the fixed zone column leaves too little for the value,
 * so the pair stacks instead of aligning — losing the column is better than
 * breaking "130৳ · ৩-৫ দিন" across two lines.
 */
@media (max-width: 359px) {
	.fv-zones .z {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

/* ==========================================================================
   Funnel focus — cart, checkout and order-received
   ========================================================================== */

/*
 * The category strip leaves the funnel.
 *
 * It is a department jump, and on these three pages every tap on it is a
 * customer leaving a basket behind. It also overflows the viewport here —
 * the last label was clipped mid-word on a 412px screen — so it was reading
 * as a broken element as well as a distraction. The product page already
 * drops it for the same reason (shop.css).
 */
@media (max-width: 1023px) {
	.woocommerce-cart .fv-hdr .m-cat,
	.woocommerce-checkout .fv-hdr .m-cat,
	.woocommerce-order-received .fv-hdr .m-cat {
		display: none;
	}
}

/*
 * One total, not two.
 *
 * WooCommerce's order-total row and the shop's "Payable Total" row call the
 * same helper, so the summary printed the identical figure twice under two
 * labels — which reads as a fee the customer has not spotted yet. The
 * emphasised row is the one that survives.
 */
.woocommerce-cart .cart_totals tr.order-total,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr.order-total {
	display: none;
}


/* Cart summary — the strip now renders inside .wc-proceed-to-checkout. */
.woocommerce-cart .cart_totals table.shop_table {
	margin-bottom: 0;
}

.woocommerce-cart .fv-assure-cart {
	margin: 12px 0 0;
}

/* ==========================================================================
   Cart toast
   ==========================================================================

   The "added to cart" confirmation, floating rather than displacing. It sits
   above the mobile nav bar (70px, z-index 70) and under the menu drawer
   (z-index 120), so it never covers navigation and is never covered by it.
*/

/*
 * Top of the page, under the header.
 *
 * `top` is a fallback only — the header is sticky and its height differs by
 * page (63px on a product page, 104px where the category strip shows, 67px
 * on the checkout), so assets/js/toast.js measures whichever bars are
 * actually on screen and sets the real offset. This value is what shows for
 * the instant before that runs, and if the script never does.
 */
.fv-toasts {
	position: fixed;
	z-index: 90;
	left: 12px;
	right: 12px;
	top: 74px;
	display: grid;
	gap: 8px;
	pointer-events: none;
}

.fv-toast {
	display: grid;
	grid-template-columns: 26px 1fr 24px;
	align-items: start;
	gap: 10px;
	padding: 12px 12px 12px 13px;
	border: 1px solid var(--fv-line, #ece7e2);
	border-left: 3px solid var(--fv-ok, #0f9d58);
	border-radius: var(--fv-radius-md, 4px);
	background: #fff;
	box-shadow: 0 8px 26px rgba(28, 25, 23, 0.14);
	pointer-events: auto;

	opacity: 0;
	/* Enters from above now that it hangs below the header. */
	transform: translateY(-10px);
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.fv-toast.is-in {
	opacity: 1;
	transform: none;
}

.fv-toast-ic {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--fv-ok, #0f9d58);
	color: #fff;
}

.fv-toast-ic svg {
	width: 15px;
	height: 15px;
}

.fv-toast-body {
	min-width: 0;
	font-family: 'Hind Siliguri', var(--fv-sans, 'Inter', system-ui, sans-serif);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.45;
	color: var(--fv-ink, #1c1917);
	/* WooCommerce wraps the product name in curly quotes; let it wrap. */
	overflow-wrap: anywhere;
}

/*
 * WooCommerce puts its "View cart" link first, as a full-width button. Here
 * it is the secondary half of a one-line confirmation, so it drops below the
 * sentence as a plain accent link.
 */
.fv-toast-body .button,
.fv-toast-body a.wc-forward {
	display: inline-block;
	order: 2;
	margin: 6px 0 0;
	padding: 0;
	background: none;
	border: 0;
	font-family: 'Hind Siliguri', var(--fv-sans, 'Inter', system-ui, sans-serif);
	font-size: 12.5px;
	font-weight: 700;
	color: var(--fv-accent, #ff6b00);
	text-decoration: underline;
	text-underline-offset: 2px;
	min-height: 0;
	line-height: 1.4;
}

.fv-toast-body .button:hover,
.fv-toast-body a.wc-forward:hover {
	background: none;
	color: var(--fv-accent, #ff6b00);
}

.fv-toast-x {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: var(--fv-radius-sm, 3px);
	background: transparent;
	color: var(--fv-ink-3, #8a8078);
	cursor: pointer;
}

.fv-toast-x svg {
	width: 14px;
	height: 14px;
}

.fv-toast-x:hover,
.fv-toast-x:focus-visible {
	background: var(--fv-cream, #faf7f4);
	color: var(--fv-ink, #1c1917);
}

/* Desktop: still under the header, pulled to the right and no wider than it needs. */
@media (min-width: 768px) {
	.fv-toasts {
		left: auto;
		right: 20px;
		width: min(380px, calc(100vw - 40px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.fv-toast {
		transition: none;
		transform: none;
	}
}
