/*
Theme Name:   Soul Foods India — Ivory & Turmeric
Theme URI:    https://soulfoodsindia.com
Author:       Soul Foods India
Description:  Warm, premium storefront for online.soulfoodsindia.com — serif editorial direction ("Ivory & Turmeric"). Built on WooCommerce's standard template hierarchy.
Version:      1.0.11
Requires PHP: 8.0
Text Domain:  sfi-ivory-turmeric
*/

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
    --sf-bg:            #FBF7F0;
    --sf-surface:       #FFFFFF;
    --sf-text:          #2B2420;
    --sf-muted:         #7A6E5E;
    --sf-border:        #E7DDC9;
    --sf-accent:        #B5502E;
    --sf-accent-hover:  #5C6B3F;
    --sf-accent-2:      #5C6B3F;
    --sf-dark:          #2B2420;
    --sf-footer-text:   #EFE7D6;
    --sf-footer-muted:  #C9BCA3;

    --sf-radius-card:   14px;
    --sf-radius-pill:   30px;
    --sf-radius-pill-sm:20px;
    --sf-radius-input:  8px;
    --sf-radius-thumb:  6px;

    --sf-font-display:  'Source Serif 4', serif;
    --sf-font-body:     'Work Sans', sans-serif;
}

/* ── Reset & base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--sf-bg);
    color: var(--sf-text);
    font: 400 15px/1.6 var(--sf-font-body);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

.sf-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 900px) {
    .sf-container { padding: 0 20px; }
}

h1, h2, h3 { font-family: var(--sf-font-display); margin: 0; }

/* ── Buttons & pills ───────────────────────────────────────────────────── */
.sf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--sf-radius-pill);
    padding: 15px 30px;
    font: 600 14px var(--sf-font-body);
    border: none;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.sf-btn-primary { background: var(--sf-accent); color: #fff; }
.sf-btn-primary:hover { background: var(--sf-accent-hover); }

.sf-btn-outline { background: transparent; border: 1px solid var(--sf-text); color: var(--sf-text); }
.sf-btn-outline:hover { background: var(--sf-text); color: #fff; }

.sf-btn-full { width: 100%; }

/* ── Placeholder image blocks (dev-only — real builds always have a real <img>) ── */
.sf-placeholder {
    background: repeating-linear-gradient(135deg, #F3EADA, #F3EADA 14px, #ECDFC7 14px, #ECDFC7 28px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    font: 600 9.5px/1.4 ui-monospace, Menlo, monospace;
    color: #9C8B6E;
    text-transform: uppercase;
}

/* ── Utility strip ─────────────────────────────────────────────────────── */
.sf-utility-strip {
    text-align: center;
    padding: 8px 40px 0;
    font: 500 11px var(--sf-font-body);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sf-muted);
    background: var(--sf-bg);
}

/* ── Header ────────────────────────────────────────────────────────────── */
.sf-header {
    padding: 20px 0;
    border-bottom: 1px solid var(--sf-border);
    background: var(--sf-surface);
}

.sf-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.sf-brand-group { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.sf-logo {
    font: 700 24px/1 var(--sf-font-display);
    color: var(--sf-text);
}

/* Uploaded logo (Appearance → Customize → Site Identity) — sized generously so a
   detailed badge/seal-style logo stays legible, not shrunk down to icon size. */
.sf-logo-image { display: flex; align-items: center; }
.sf-logo-image .custom-logo-link { display: block; }
.sf-logo-image img.custom-logo {
    height: 128px;
    width: auto;
    max-width: 320px;
    object-fit: contain;
}

.sf-header-minimal .sf-logo-image img.custom-logo { height: 104px; }

.sf-nav {
    display: flex;
    gap: 26px;
    font: 500 13px/1 var(--sf-font-body);
    color: #5B5142;
    flex-wrap: wrap;
}

.sf-nav a:hover { color: var(--sf-accent); }
.sf-nav .sf-nav-more { color: var(--sf-accent); }

.sf-header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    font: 500 13px var(--sf-font-body);
    color: var(--sf-text);
}

.sf-header-actions a:hover { color: var(--sf-accent); }

.sf-cart-pill {
    background: var(--sf-accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--sf-radius-pill-sm);
    font: 600 12px var(--sf-font-body);
}

.sf-cart-pill:hover { background: var(--sf-accent-hover); color: #fff; }

/* ── Mobile nav (hamburger + drawer panel) ────────────────────────────────
   Below ~860px the category nav (5 links + "More") no longer fits inline —
   .sf-nav's own flex-wrap never gets a chance to trigger because, as a wrapped
   item of .sf-header-inner, it's sized to its content's natural width rather
   than the viewport, so it just overflows instead of wrapping. Collapsing it
   into a toggled drawer avoids that entirely and reads better on a phone than
   a category nav wrapping across 2-3 ragged lines. */
.sf-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--sf-border);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    padding: 0;
}

.sf-nav-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    margin: 0 auto;
    background: var(--sf-text);
}

/* Desktop/default state: nav links + Search/Account/Cart sit inline on one row.
   This rule was missing entirely after the mobile hamburger drawer was added —
   .sf-nav-panel is a plain <div>, so without it, .sf-nav and .sf-header-actions
   (its two block-level children) were stacking vertically at ALL screen widths,
   not just falling back gracefully on mobile. The @media block below is what
   turns this into a toggled dropdown *only* under 860px. */
.sf-nav-panel {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

@media (max-width: 860px) {
    .sf-header-inner { position: relative; }

    .sf-nav-toggle { display: flex; }

    .sf-nav-panel {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: var(--sf-surface);
        border-bottom: 1px solid var(--sf-border);
        padding: 18px 20px 22px;
        z-index: 50;
        flex-direction: column;
        gap: 16px;
    }

    .sf-nav-panel.is-open { display: flex; }

    .sf-nav { flex-direction: column; gap: 14px; }

    .sf-header-actions { flex-direction: column; align-items: flex-start; gap: 12px; }
}

.sf-header-minimal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.sf-secure-label {
    font: 500 12.5px var(--sf-font-body);
    color: var(--sf-muted);
}

/* ── Breadcrumb ────────────────────────────────────────────────────────── */
.sf-breadcrumb {
    padding: 18px 0 0;
    font: 400 12.5px var(--sf-font-body);
    color: var(--sf-muted);
}

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

/* ── Hero ──────────────────────────────────────────────────────────────── */
.sf-hero {
    padding: 64px 0;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 52px;
    align-items: center;
}

.sf-hero-eyebrow {
    font: 600 12.5px var(--sf-font-body);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sf-accent);
    margin-bottom: 16px;
}

.sf-hero-title {
    font: 600 46px/1.1 var(--sf-font-display);
    margin-bottom: 20px;
}

.sf-hero-subhead {
    font: 400 16px/1.65 var(--sf-font-body);
    color: #5B5142;
    margin-bottom: 30px;
    max-width: 440px;
}

.sf-hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.sf-hero-image {
    height: 360px;
    border-radius: 18px;
    overflow: hidden;
}

.sf-hero-image img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
    .sf-hero { grid-template-columns: 1fr; }
}

/* ── Trust strip ───────────────────────────────────────────────────────── */
.sf-trust-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--sf-border);
    border-bottom: 1px solid var(--sf-border);
}

.sf-trust-stat {
    padding: 22px 40px;
    text-align: center;
    border-right: 1px solid var(--sf-border);
}

.sf-trust-stat:last-child { border-right: none; }

@media (max-width: 560px) {
    /* Fixed 40px horizontal padding per column was wider than an entire column
       on a phone screen (3 columns at ~130px each) — the strip was overflowing
       the viewport. Numbers/labels are short, so shrinking padding is enough;
       no need to stack to one column. */
    .sf-trust-stat { padding: 16px 10px; }
}

.sf-trust-number { font: 700 22px var(--sf-font-display); }
.sf-trust-label { font: 400 12px var(--sf-font-body); color: var(--sf-muted); }

/* ── Section heading row ──────────────────────────────────────────────── */
.sf-section { padding: 56px 0; }

.sf-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.sf-section-title { font: 700 27px var(--sf-font-display); }

.sf-view-all { font: 500 13px var(--sf-font-body); color: var(--sf-accent); }
.sf-view-all:hover { color: var(--sf-accent-hover); }

.sf-badge-dashed {
    font: 600 11px var(--sf-font-body);
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--sf-accent);
    border: 1px dashed var(--sf-accent);
    padding: 6px 12px;
    border-radius: var(--sf-radius-pill-sm);
}

/* ── Spotlight grid ────────────────────────────────────────────────────── */
.sf-spotlight-grid {
    display: grid;
    /* auto-fit + a fixed max (not 1fr) + justify-content:center is what actually
       centers a short row as a group. With auto-fill/1fr (the previous rule), unused
       tracks still reserve their 1fr share of width even with no card in them, so
       the real cards always land flush-left with the "empty" space trailing on the
       right — justify-content has nothing left to redistribute since the tracks
       already span 100% of the container by design. auto-fit collapses genuinely
       empty tracks to 0, and a bounded (non-1fr) max keeps cards from stretching
       wide to fill leftover space instead of being centered. */
    grid-template-columns: repeat(auto-fit, minmax(200px, 220px));
    justify-content: center;
    gap: 18px;
    width: 100%;
}

.sf-spotlight-card {
    background: var(--sf-surface);
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-card);
    overflow: hidden;
    transition: border-color .2s ease;
}

.sf-spotlight-card:hover { border-color: var(--sf-muted); }

.sf-spotlight-image { height: 130px; background: var(--sf-bg); }
/* object-fit: contain (not cover) — the box's width is responsive so its aspect
   ratio changes as the grid reflows; contain guarantees the image is never cropped
   regardless of screen size, at the cost of a little empty space on the sides if an
   upload doesn't match the 450x260 recommended ratio exactly. */
.sf-spotlight-image img { width: 100%; height: 100%; object-fit: contain; }

.sf-spotlight-body { padding: 14px; text-align: center; }

.sf-spotlight-type {
    font: 600 9.5px var(--sf-font-body);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sf-accent-2);
    margin-bottom: 6px;
}

.sf-spotlight-title { font: 600 15px var(--sf-font-display); margin-bottom: 4px; }
.sf-spotlight-subtitle { font: 400 11.5px var(--sf-font-body); color: var(--sf-muted); }

/* ── Product grid & card ───────────────────────────────────────────────── */
.sf-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    width: 100%; /* without this, width:auto doesn't reliably resolve to fill the
                    parent in this nested-layout context — the grid ends up sized
                    to roughly half its available space instead of filling it */
}

@media (max-width: 900px) {
    .sf-product-grid { grid-template-columns: repeat(2, 1fr); }
}

.sf-product-card,
.sws-product-card {
    background: var(--sf-surface);
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s ease;
}

.sf-product-card:hover,
.sws-product-card:hover { border-color: var(--sf-muted); }

.sf-product-image,
.sws-product-img-wrap {
    height: 160px;
    position: relative;
}

/* WooCommerce core ships ".woocommerce ul.products li.product a img { height:auto;
   width:100% }" — 3 classes + 4 elements — which out-ranks a plain 2-class selector
   here on the `height` property specifically. Real product photos (which carry
   width/height attributes) were rendering at their natural aspect ratio instead of
   being cropped to this card's fixed 160px band, pushing the name/price/button below
   the card's overflow:hidden boundary (invisible).
   A previous version of this fix added a ".woocommerce" ancestor requirement to
   out-rank WC's rule by class count — but the homepage's Featured Products section
   isn't itself a "WooCommerce page" (only Shop/Category/Product/Cart/Checkout get
   the .woocommerce body class), so on Home neither rule matched at all, leaving the
   image completely unstyled. Repeating .sf-product-card here instead (valid CSS —
   a compound selector can reference the same class more than once, and each
   occurrence still counts toward specificity) reaches the same 4-class total
   without depending on any ancestor that may or may not be present. */
.sf-product-card.sf-product-card.sf-product-card .sf-product-image img,
.sws-product-card.sws-product-card.sws-product-card .sws-product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-product-body,
.sws-product-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sf-product-cat {
    font: 500 9.5px var(--sf-font-body);
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #9C8B6E;
}

.sf-product-name,
.sws-product-name {
    font: 600 14px/1.3 var(--sf-font-body);
    margin: 0;
}

.sf-product-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sf-product-price,
.sws-product-price,
.sf-product-price .woocommerce-Price-amount {
    font: 700 15px var(--sf-font-display);
    color: var(--sf-accent);
}

.sf-add-btn,
.sws-btn-add-cart {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sf-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 600 16px var(--sf-font-body);
    border: none;
    cursor: pointer;
    text-align: center;
}

.sf-add-btn:hover,
.sws-btn-add-cart:hover { background: var(--sf-accent); color: #fff; }

.sws-oos-ribbon,
.sws-sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--sf-dark);
    color: #fff;
    font: 600 10px var(--sf-font-body);
    padding: 4px 10px;
    border-radius: var(--sf-radius-pill-sm);
}

.sws-wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,.85);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

/* Quantity stepper (shared: product cards, single product, cart) */
.sf-qty-stepper,
.sws-qty-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-pill);
    width: fit-content;
}

.sf-qty-stepper button,
.sws-qty-decrease,
.sws-qty-increase {
    background: none;
    border: none;
    padding: 11px 16px;
    font: 600 15px var(--sf-font-body);
    cursor: pointer;
}

.sf-qty-stepper input,
.sws-qty-input {
    width: 44px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--sf-border);
    border-right: 1px solid var(--sf-border);
    padding: 11px 0;
    font: 600 14px var(--sf-font-body);
    -moz-appearance: textfield;
}

.sf-qty-stepper input::-webkit-outer-spin-button,
.sf-qty-stepper input::-webkit-inner-spin-button,
.sws-qty-input::-webkit-outer-spin-button,
.sws-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Brand pills ───────────────────────────────────────────────────────── */
.sf-brand-pills { display: flex; gap: 12px; flex-wrap: wrap; }

.sf-brand-pill {
    background: var(--sf-bg);
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-pill);
    padding: 10px 20px;
    font: 500 13px var(--sf-font-body);
}

.sf-brand-pill:hover { border-color: var(--sf-accent); color: var(--sf-accent); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.sf-footer {
    background: var(--sf-dark);
    color: var(--sf-footer-text);
    padding: 44px 0;
}

.sf-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    font: 400 12.5px/1.7 var(--sf-font-body);
}

@media (max-width: 700px) {
    .sf-footer-grid { grid-template-columns: 1fr 1fr; }
}

.sf-footer-brand { font: 700 19px var(--sf-font-display); color: #fff; margin-bottom: 10px; }
.sf-footer-tag { color: var(--sf-footer-muted); }

.sf-footer-heading {
    font: 600 11px var(--sf-font-body);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sf-footer-muted);
    margin-bottom: 10px;
}

.sf-footer-grid a:hover { color: #fff; }

/* ── Shop layout (sidebar + grid) ──────────────────────────────────────── */
.sf-shop-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 32px;
    padding: 20px 0 48px;
}

@media (max-width: 900px) {
    .sf-shop-layout { grid-template-columns: 1fr; }
}

.sf-sidebar-heading {
    font: 600 13px var(--sf-font-body);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 14px;
}

.sf-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    font: 400 13.5px var(--sf-font-body);
    color: #4A4136;
    margin-bottom: 26px;
}

.sf-sidebar-list a.current,
.sf-sidebar-list .current { color: var(--sf-accent); font-weight: 600; }
.sf-sidebar-list a:hover { color: var(--sf-accent); }

.sf-shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.sf-result-count { font: 400 13px var(--sf-font-body); color: var(--sf-muted); }

.sf-sort-wrap select,
select.orderby {
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-input);
    padding: 9px 14px;
    font: 500 12px var(--sf-font-body);
    background: var(--sf-surface);
}

/* WooCommerce pagination restyle */
.sf-pagination,
.woocommerce-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    font: 500 13px var(--sf-font-body);
    color: #5B5142;
}

.woocommerce-pagination ul { display: flex; gap: 8px; }

.woocommerce-pagination a,
.woocommerce-pagination span {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--sf-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.woocommerce-pagination .current {
    background: var(--sf-accent);
    color: #fff;
    border-color: var(--sf-accent);
}

/* ── Single product ────────────────────────────────────────────────────── */
.sf-product-single {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 52px;
    padding: 24px 0 10px;
}

@media (max-width: 900px) {
    .sf-product-single { grid-template-columns: 1fr; }
}

.sf-gallery-main {
    height: 420px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
}

.sf-gallery-main img { width: 100%; height: 100%; object-fit: cover; }

.sf-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.sf-gallery-thumbs img {
    height: 78px;
    width: 100%;
    object-fit: cover;
    border-radius: var(--sf-radius-thumb);
    cursor: pointer;
}

.sf-product-catbrand { font: 500 12.5px var(--sf-font-body); color: var(--sf-accent-2); margin-bottom: 10px; }
.sf-product-title { font: 600 30px/1.2 var(--sf-font-display); margin-bottom: 10px; }
.sf-product-rating { font: 500 13px var(--sf-font-body); color: var(--sf-muted); margin-bottom: 16px; }
.sf-product-instock { color: var(--sf-accent-2); }

/* WooCommerce's default add-to-cart/simple.php template prints its own stock
   line right before the <form class="cart">, independent of the one we already
   show inline in .sf-product-rating — hide that second copy (it's the direct
   child of .sf-product-details; ours is nested inside .sf-product-rating). */
.sf-product-details > p.stock { display: none; }

.sf-product-price-lg { font: 700 26px var(--sf-font-display); color: var(--sf-accent); margin-bottom: 18px; }
.sf-product-desc { font: 400 14.5px/1.7 var(--sf-font-body); color: #5B5142; margin-bottom: 22px; max-width: 440px; }

.sf-attr-label {
    font: 600 12px var(--sf-font-body);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sf-muted);
    margin-bottom: 10px;
}

.sf-attr-pills { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }

.sf-attr-pill {
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-pill-sm);
    padding: 8px 18px;
    font: 500 13px var(--sf-font-body);
    color: #5B5142;
    background: none;
    cursor: pointer;
}

.sf-attr-pill.is-active,
.sf-attr-pill:hover {
    border: 2px solid var(--sf-accent);
    color: var(--sf-accent);
    font-weight: 600;
    padding: 7px 17px;
}

.sf-addtocart-row {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.sf-addtocart-row .sf-btn { flex: 1; }

.sf-trust-row {
    display: flex;
    gap: 20px;
    font: 500 12px var(--sf-font-body);
    color: var(--sf-accent-2);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sf-meta-line {
    font: 400 12px var(--sf-font-body);
    color: #9C8B6E;
    border-top: 1px solid var(--sf-border);
    padding-top: 14px;
}

/* Tabs */
.sf-tabs {
    padding: 26px 0 0;
}

.sf-tabs ul.tabs,
.sf-tab-nav {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid var(--sf-border);
    font: 600 13px var(--sf-font-body);
    color: var(--sf-muted);
}

.sf-tabs ul.tabs li,
.sf-tab-nav a {
    padding-bottom: 12px;
    border-bottom: 2px solid transparent;
}

.sf-tabs ul.tabs li.active,
.sf-tabs ul.tabs li.active a,
.sf-tab-nav a.is-active {
    border-bottom: 2px solid var(--sf-accent);
    color: var(--sf-text);
}

.sf-tab-panel { padding: 20px 0; font: 400 13.5px var(--sf-font-body); color: #5B5142; }

/* ── Cart page ─────────────────────────────────────────────────────────── */
.sf-cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    padding: 0 0 44px;
}

@media (max-width: 900px) {
    .sf-cart-layout { grid-template-columns: 1fr; }
}

table.shop_table.sf-cart-table {
    width: 100%;
    border-collapse: collapse;
}

.sf-cart-table thead th {
    padding: 0 4px 12px;
    border-bottom: 1px solid var(--sf-border);
    font: 600 11px var(--sf-font-body);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #9C8B6E;
    text-align: left;
}

.sf-cart-table td {
    padding: 16px 4px;
    border-bottom: 1px solid var(--sf-border);
    vertical-align: middle;
}

.sf-cart-product-cell { display: flex; gap: 14px; align-items: center; }

.sf-cart-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--sf-radius-thumb);
    object-fit: cover;
}

.sf-cart-item-name { font: 600 13.5px var(--sf-font-body); }
.sf-cart-item-cat { font: 400 11.5px var(--sf-font-body); color: #9C8B6E; }
.sf-cart-line-total { font: 700 14px var(--sf-font-display); color: var(--sf-accent); }

/* Below ~700px a 4-column table (Product/Price/Qty/Subtotal) has no room to breathe —
   stack each row into a card instead, using the data-title attributes already on the
   Price/Qty/Subtotal cells (set in cart.php) to label each value. */
@media (max-width: 700px) {
    .sf-cart-table thead { display: none; }
    .sf-cart-table, .sf-cart-table tbody, .sf-cart-table tr { display: block; width: 100%; }

    .sf-cart-table tr {
        margin-bottom: 16px;
        border-bottom: 1px solid var(--sf-border);
        padding-bottom: 8px;
    }

    .sf-cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 4px;
        border: none;
    }

    .sf-cart-table td[data-title]::before {
        content: attr(data-title);
        font: 600 11px var(--sf-font-body);
        text-transform: uppercase;
        letter-spacing: .05em;
        color: #9C8B6E;
        margin-right: 12px;
    }
}

.sf-cart-remove { color: #9C8B6E; font: 400 12px var(--sf-font-body); margin-left: 6px; }

.sf-cart-footer-row {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 14px;
}

.sf-coupon-row { display: flex; gap: 10px; }

.sf-coupon-input {
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-pill-sm);
    padding: 11px 18px;
    font: 400 13px var(--sf-font-body);
    color: var(--sf-text);
    background: var(--sf-surface);
}

.sf-coupon-apply {
    border: 1px solid var(--sf-text);
    border-radius: var(--sf-radius-pill-sm);
    padding: 11px 20px;
    font: 600 13px var(--sf-font-body);
    background: none;
    cursor: pointer;
}

.sf-continue-shopping { font: 500 13px var(--sf-font-body); color: var(--sf-accent); align-self: center; }

/* Order summary card (cart + checkout) */
.sf-order-summary {
    background: var(--sf-surface);
    border: 1px solid var(--sf-border);
    border-radius: 16px;
    padding: 18px 20px;
    align-self: start;
    position: sticky;
    top: 24px;
}

.sf-order-summary-title { font: 700 17px var(--sf-font-display); margin-bottom: 12px; }

.sf-summary-row {
    display: flex;
    justify-content: space-between;
    font: 400 13.5px var(--sf-font-body);
    color: #5B5142;
    margin-bottom: 7px;
}

/* Shipping can render a full calculator form (country/state selects, "Calculate
   shipping" link) instead of a short price — stack instead of a side-by-side flex
   row so that form has normal block width to lay itself out in. */
.sf-summary-row-shipping {
    display: block;
    margin-bottom: 12px;
}

.sf-summary-row-shipping > span:first-child {
    display: block;
    margin-bottom: 6px;
}

.sf-summary-row-shipping .shipping-calculator-form {
    margin-top: 8px;
}

.sf-summary-row-shipping .shipping-calculator-form p {
    margin: 0 0 8px;
}

.sf-summary-line-item {
    display: flex;
    justify-content: space-between;
    font: 400 13px var(--sf-font-body);
    color: #5B5142;
    margin-bottom: 9px;
}

.sf-summary-total {
    display: flex;
    justify-content: space-between;
    font: 700 17px var(--sf-font-display);
    border-top: 1px solid var(--sf-border);
    padding-top: 10px;
    margin-top: 4px;
    margin-bottom: 14px;
}

.sf-summary-reassurance { font: 400 11.5px var(--sf-font-body); color: #9C8B6E; }

/* ── Checkout page ─────────────────────────────────────────────────────── */
.sf-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    padding: 14px 0 28px;
}

@media (max-width: 900px) {
    .sf-checkout-layout { grid-template-columns: 1fr; }
}

.sf-form-heading {
    font: 600 12px var(--sf-font-body);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sf-muted);
    margin-bottom: 8px;
}

.sf-form-row-2,
.sf-form-row-3 {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.sf-form-row-2 { grid-template-columns: 1fr 1fr; }
.sf-form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* WooCommerce's native billing field rows (form-billing.php isn't overridden —
   restyled here into the design's row groupings instead of a template rewrite). */
.woocommerce-billing-fields h3 {
    font: 600 12px var(--sf-font-body);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sf-muted);
    margin: 0 0 8px;
}

.woocommerce-billing-fields__field-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* WooCommerce core's own ".woocommerce form .form-row { margin-bottom: 6px }" rule
   (assets/css/woocommerce.css) outranks a plain two-class selector here (it adds an
   element selector, which counts toward specificity) — the extra class below is only
   to win that specificity fight, not for any styling purpose. */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row {
    flex: 1 1 220px;
    margin: 0; /* spacing comes from the flex `gap` above — a margin here on top of
                  that was compounding into a much bigger row-to-row gap than intended */
}

.woocommerce-billing-fields__field-wrapper .form-row-wide { flex-basis: 100%; }

/* WooCommerce's US address format puts Address 2/City/State/ZIP each on their own
   full-width row — that's why they were stretching edge-to-edge. Regroup into two
   standard-width rows instead: Apartment + City, then State + ZIP (ID selectors here
   intentionally out-specificity the .form-row-wide rule above, no !important needed).
   Country is hidden below since this store only ships within the US (see
   woocommerce_allowed_countries) — one option isn't worth a dropdown, and its default
   value still posts correctly when hidden. */
#billing_address_2_field,
#billing_city_field {
    flex: 1 1 45%;
}

#billing_state_field,
#billing_postcode_field {
    flex: 1 1 45%;
}

#billing_country_field { display: none; }

.woocommerce-checkout input.input-text,
.woocommerce-checkout select,
.woocommerce-checkout textarea,
.sf-input {
    width: 100%;
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-input);
    padding: 9px 12px;
    font: 400 12.5px var(--sf-font-body);
    color: var(--sf-text);
    background: var(--sf-surface);
}

.woocommerce-checkout .form-row label {
    font: 500 12px var(--sf-font-body);
    margin-bottom: 3px;
    display: inline-block;
}

.sf-payment-methods { margin-bottom: 14px; }
.sf-payment-methods .wc_payment_methods { margin: 0 0 12px; }

.wc_payment_method {
    border: 1px solid var(--sf-border);
    border-radius: 10px;
    padding: 0;
    margin-bottom: 8px;
}

.wc_payment_method label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    font: 600 13px var(--sf-font-body);
    cursor: pointer;
}

.wc_payment_method .payment_box {
    padding: 0 14px 12px;
    background: none;
}

.sf-secured-by-square {
    margin-left: auto;
    font: 500 11px var(--sf-font-body);
    color: #9C8B6E;
}

#place_order,
.sf-place-order-btn {
    background: var(--sf-accent) !important;
    color: #fff !important;
    text-align: center;
    padding: 13px !important;
    border-radius: var(--sf-radius-pill) !important;
    font: 600 14px var(--sf-font-body) !important;
    width: 100%;
    border: none;
    margin-top: 6px;
    cursor: pointer;
}

#place_order:hover,
.sf-place-order-btn:hover { background: var(--sf-accent-hover) !important; }

/* ── Misc dashed ghost (editor affordance only, not used on front end) ──── */
.sf-ghost-card {
    border: 1px dashed #C9BCA3;
    border-radius: var(--sf-radius-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9C8B6E;
    font: 500 12px var(--sf-font-body);
    min-height: 214px;
}

/* ── WooCommerce native gallery (single product) — restyled, not rebuilt ────── */
.sf-gallery-wrap .woocommerce-product-gallery__wrapper {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
}

.sf-gallery-wrap .woocommerce-product-gallery__image img { height: 420px; width: 100%; object-fit: cover; }

.sf-gallery-wrap .flex-control-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.sf-gallery-wrap .flex-control-thumbs img {
    height: 78px;
    width: 100%;
    object-fit: cover;
    border-radius: var(--sf-radius-thumb);
    cursor: pointer;
}

/* ── WooCommerce variation form (pack size + qty + add to cart) ─────────────── */
.variations { margin-bottom: 22px; }
.variations td.label { font: 600 12px var(--sf-font-body); text-transform: uppercase; letter-spacing: .05em; color: var(--sf-muted); padding-bottom: 10px; }
.variations select {
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-pill-sm);
    padding: 8px 18px;
    font: 500 13px var(--sf-font-body);
    background: var(--sf-surface);
}

.quantity input.qty {
    width: 44px;
    text-align: center;
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-pill);
    padding: 11px 0;
    font: 600 14px var(--sf-font-body);
    margin-right: 14px;
}

.single_add_to_cart_button,
.woocommerce #respond input#submit.single_add_to_cart_button {
    background: var(--sf-accent) !important;
    color: #fff !important;
    border-radius: var(--sf-radius-pill) !important;
    padding: 15px 34px !important;
    font: 600 14px var(--sf-font-body) !important;
    border: none;
}

.single_add_to_cart_button:hover { background: var(--sf-accent-hover) !important; }

.woocommerce div.product form.cart {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ── WooCommerce product data tabs (Additional Information / Reviews) ───────── */
.woocommerce-tabs ul.tabs {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid var(--sf-border);
    font: 600 13px var(--sf-font-body);
    color: var(--sf-muted);
    margin: 0 0 20px;
    padding: 0;
}

.woocommerce-tabs ul.tabs li { padding-bottom: 12px; border-bottom: 2px solid transparent; list-style: none; }
.woocommerce-tabs ul.tabs li.active { border-bottom-color: var(--sf-accent); color: var(--sf-text); }
.woocommerce-tabs ul.tabs li a { text-decoration: none; }
.woocommerce-tabs .panel { font: 400 13.5px var(--sf-font-body); color: #5B5142; }

/* ── Related / upsell product grids (WC default markup) ─────────────────────── */
ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    padding: 0;
    margin: 0;
}

/* WooCommerce core CSS puts a percentage width + float on li.product for its own
   (non-grid) column system — that fights this grid layout, shrinking each card
   inside its grid cell instead of filling it. Reset both so the grid controls sizing. */
ul.products li.product {
    list-style: none;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

@media (max-width: 900px) {
    ul.products { grid-template-columns: repeat(2, 1fr); }
}

.related.products > h2,
.upsells.products > h2 {
    font: 700 22px var(--sf-font-display);
    margin-bottom: 18px;
}

/* ── Cart: "Proceed to Checkout" (WC's own .checkout-button link) ───────────────
   WC core ships `.woocommerce a.button.alt { background: #7f54b9 }` (its purple
   brand color) — the button also carries "button alt" classes alongside
   "checkout-button", and that WC rule's 3-class specificity out-ranks a plain
   single-class selector here (the surrounding :where(...) in WC's real selector
   contributes zero specificity by design, but what's left still wins). Matching
   its class count is what actually wins the fight, not !important. */
.woocommerce a.checkout-button.button.alt {
    display: block;
    background: var(--sf-accent);
    color: #fff;
    text-align: center;
    padding: 15px;
    border-radius: var(--sf-radius-pill);
    font: 600 14px var(--sf-font-body);
}

.woocommerce a.checkout-button.button.alt:hover { background: var(--sf-accent-hover); color: #fff; }

/* The "Update Cart" button is a functional necessity (classic, non-block cart requires
   an explicit submit to recalc quantities) but isn't in the design's visual language —
   keep it understated; cart-ui.js auto-triggers it from the qty +/- steppers instead. */
button[name="update_cart"] {
    background: none;
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-pill-sm);
    padding: 11px 18px;
    font: 500 13px var(--sf-font-body);
    color: var(--sf-muted);
    cursor: pointer;
}

/* ── Checkout: native review-order.php table, restyled as a plain line-item list ── */
.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
    font: 400 13px var(--sf-font-body);
    color: #5B5142;
}

.woocommerce-checkout-review-order-table thead { display: none; }
.woocommerce-checkout-review-order-table,
.woocommerce-checkout-review-order-table tbody,
.woocommerce-checkout-review-order-table tfoot { display: block; width: 100%; }

.woocommerce-checkout-review-order-table tr {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Same issue as the cart's Order Summary: wc_cart_totals_shipping_html() can render
   a full shipping-calculator form instead of a short price, which can't share a
   flex row with its label. */
.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals {
    display: block;
}

.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th {
    display: block;
    margin-bottom: 6px;
}

.woocommerce-checkout-review-order-table tbody tr td,
.woocommerce-checkout-review-order-table tbody tr th {
    border: none;
    padding: 0 0 7px;
}

.woocommerce-checkout-review-order-table tfoot tr th,
.woocommerce-checkout-review-order-table tfoot tr td {
    border: none;
    border-top: 1px solid var(--sf-border);
    padding: 9px 0 0;
}

.woocommerce-checkout-review-order-table tfoot .order-total th,
.woocommerce-checkout-review-order-table tfoot .order-total td {
    font: 700 17px var(--sf-font-display);
    color: var(--sf-text);
}
