/* =====================================================================
   Moodfex Premium WooCommerce UI layer
   Additive visual layer only. Loaded after style.css on shop/product/
   cart/checkout/account pages. No WooCommerce markup, hooks, form field
   names, shortcodes or URLs are altered by this file.
   ===================================================================== */

/* ---------- A) Shop landing — category card grid ---------- */
.mf-cat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:24px;margin-bottom:44px}
.mf-cat-card{position:relative;display:flex;flex-direction:column;border-radius:20px;overflow:hidden;border:1px solid var(--mf-line);background:#fff;box-shadow:0 12px 38px rgba(5,42,35,.05);text-decoration:none;transition:transform .3s cubic-bezier(.22,.61,.36,1),box-shadow .3s ease}
.mf-cat-card:hover{transform:translateY(-4px);box-shadow:0 20px 50px rgba(5,42,35,.12)}
.mf-cat-card:focus-visible{outline:2px solid var(--mf-gold);outline-offset:3px}
.mf-cat-card__media{aspect-ratio:1/1;overflow:hidden;display:block;background:linear-gradient(135deg,#0b3f35,#d4aa62)}
.mf-cat-card.is-empty .mf-cat-card__media{display:flex;align-items:center;justify-content:center;padding:28px;text-align:center}
.mf-cat-card__media img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .5s cubic-bezier(.22,.61,.36,1)}
/* No category photo uploaded in WooCommerce — a styled text graphic on the
   brand gradient stands in for a photo, so the card never reads as broken. */
.mf-cat-card__placeholder-text{font-family:var(--font-heading);font-weight:600;color:#fff;font-size:22px;line-height:1.3;letter-spacing:.01em;text-shadow:0 2px 10px rgba(0,0,0,.22)}
.mf-cat-card__placeholder-text:before{content:"✦";display:block;font-size:13px;color:rgba(255,255,255,.8);margin-bottom:12px;letter-spacing:.3em}
.mf-cat-card:hover .mf-cat-card__media img{transform:scale(1.05)}
.mf-cat-card__label{padding:16px 18px;text-align:center;font-family:var(--font-heading);font-size:19px;letter-spacing:.01em;color:var(--mf-deep);font-weight:600}

@media(max-width:1100px){.mf-cat-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.mf-cat-grid{grid-template-columns:repeat(2,1fr);gap:14px;margin-bottom:28px}.mf-cat-card__label{font-size:16px;padding:13px 14px}}

/* ---------- B) Product listing polish ---------- */
.woocommerce ul.products li.product{transition:transform .3s ease,box-shadow .3s ease}
.woocommerce ul.products li.product:hover{transform:translateY(-4px);box-shadow:0 20px 50px rgba(5,42,35,.1)}
.woocommerce ul.products li.product a{display:block;overflow:hidden}
.woocommerce ul.products li.product a img{transition:transform .45s cubic-bezier(.22,.61,.36,1)}
.woocommerce ul.products li.product a:hover img{transform:scale(1.06)}

/* ---------- Mobile "Filter & Sort" bottom sheet (wraps the real WC ordering dropdown) ---------- */
.mf-sort-drawer__backdrop,.mf-sort-drawer__head,.mf-filter-fab{display:none}

@media(max-width:900px){
  .mf-filter-fab{display:flex;align-items:center;gap:9px;position:fixed;left:50%;transform:translateX(-50%);bottom:calc(78px + 14px + env(safe-area-inset-bottom));z-index:950;background:var(--mf-deep);color:#fff;border:0;border-radius:999px;padding:0 22px;height:50px;font-weight:700;font-size:14px;box-shadow:0 14px 34px rgba(0,61,50,.28);transition:transform .2s ease}
  .mf-filter-fab:active{transform:translateX(-50%) scale(.96)}
  .mf-filter-fab svg{width:18px;height:18px}
  .mf-sort-drawer__backdrop{display:block;position:fixed;inset:0;background:rgba(11,30,25,.34);backdrop-filter:blur(6px);z-index:1000;opacity:0;visibility:hidden;transition:opacity .3s ease}
  .mf-sort-drawer__panel{position:fixed;left:0;right:0;bottom:0;z-index:1001;background:#fff;border-radius:24px 24px 0 0;padding:20px 20px calc(24px + env(safe-area-inset-bottom));box-shadow:0 -20px 60px rgba(5,42,35,.18);transform:translateY(100%);transition:transform .35s cubic-bezier(.22,.61,.36,1)}
  .mf-sort-drawer.is-open .mf-sort-drawer__backdrop{opacity:1;visibility:visible}
  .mf-sort-drawer.is-open .mf-sort-drawer__panel{transform:translateY(0)}
  .mf-sort-drawer__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
  .mf-sort-drawer__head span{font-family:var(--font-heading);font-size:20px;color:var(--mf-deep)}
  .mf-sort-drawer__close{width:38px;height:38px;border-radius:999px;border:1px solid var(--mf-line);background:#fff;display:flex;align-items:center;justify-content:center;color:var(--mf-deep)}
  .mf-sort-drawer__close svg{width:16px;height:16px}
  .mf-sort-drawer .woocommerce-ordering{margin-bottom:0!important}
  .mf-sort-drawer select{width:100%}
  body.mf-sort-open{overflow:hidden}
}

/* ---------- C) Single product — premium landing feel ---------- */
.single-product div.product{display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,.85fr);gap:48px;align-items:flex-start;background:#fff;border:1px solid var(--mf-line);border-radius:var(--mf-radius);padding:40px;box-shadow:0 18px 54px rgba(5,42,35,.06);margin:36px 0 48px}
.single-product div.product .woocommerce-product-gallery{border-radius:18px;overflow:hidden}
.single-product div.product .summary{padding:0}
.single-product div.product .product_title{font-family:var(--font-heading);font-size:clamp(30px,3.4vw,44px);color:var(--mf-deep);line-height:1.1;margin:0 0 14px}
.single-product div.product p.price{font-size:24px;color:var(--mf-deep);font-weight:700;margin-bottom:20px}
.single-product div.product .woocommerce-product-details__short-description{color:var(--mf-muted);font-size:16px;line-height:1.75;margin-bottom:24px}
.single-product div.product .single_add_to_cart_button{min-height:56px;padding:0 34px;font-size:15px;border-radius:16px}
.single-product .woocommerce-tabs{background:#fff;border:1px solid var(--mf-line);border-radius:var(--mf-radius);box-shadow:0 12px 38px rgba(5,42,35,.05);margin-bottom:56px;overflow:hidden}
.single-product .woocommerce-tabs ul.tabs{display:flex;gap:6px;list-style:none;margin:0;padding:14px;border-bottom:1px solid var(--mf-line);flex-wrap:wrap;background:var(--mf-cream)}
.single-product .woocommerce-tabs ul.tabs li{margin:0!important;border:0!important;background:none!important;padding:0!important}
.single-product .woocommerce-tabs ul.tabs li a{display:inline-flex;align-items:center;min-height:44px;padding:0 18px;border-radius:12px;font-weight:700;color:var(--mf-muted);font-size:14px}
.single-product .woocommerce-tabs ul.tabs li.active a{background:var(--mf-deep);color:#fff}
.single-product .woocommerce-tabs .panel{padding:30px 26px;color:#424c48;font-size:16px;line-height:1.75}
.single-product .related.products{margin-top:8px}
.single-product .related.products>h2{font-family:var(--font-heading);font-size:32px;color:var(--mf-deep);text-align:center;margin-bottom:28px}

@media(max-width:1100px){.single-product div.product{grid-template-columns:1fr;padding:26px}}
@media(max-width:560px){.single-product div.product{padding:18px;margin:20px 0 32px;border-radius:20px}.single-product .woocommerce-tabs .panel{padding:22px 18px}}

/* Sticky add-to-cart bar */
.mf-sticky-atc{position:fixed;left:0;right:0;bottom:0;z-index:850;background:#fff;border-top:1px solid var(--mf-line);box-shadow:0 -14px 40px rgba(5,42,35,.1);transform:translateY(100%);opacity:0;transition:transform .3s cubic-bezier(.22,.61,.36,1),opacity .3s ease;pointer-events:none}
.mf-sticky-atc.is-visible{transform:translateY(0);opacity:1;pointer-events:auto}
.mf-sticky-atc__inner{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 0}
.mf-sticky-atc__info{display:flex;align-items:center;gap:14px;min-width:0}
.mf-sticky-atc__info img{width:52px;height:52px;border-radius:12px;object-fit:cover;flex:0 0 auto}
.mf-sticky-atc__text{display:flex;flex-direction:column;gap:2px;min-width:0}
.mf-sticky-atc__text strong{font-size:14px;color:var(--mf-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mf-sticky-atc__text span{font-size:13px;color:var(--mf-deep);font-weight:700}
.mf-sticky-atc__btn{flex:0 0 auto;min-height:48px;padding:0 26px}
@media(max-width:900px){.mf-sticky-atc{bottom:78px}}

/* ---------- D) Cart — larger imagery, sticky order summary ----------
   The Cart page is a plain WordPress Page rendering [woocommerce_cart] via
   page.php ("mf-info-container > article > .mf-info-content"), not a native
   WooCommerce archive/single template — so WooCommerce's own
   woocommerce_before/after_main_content hooks (which build .mf-woo-container)
   never fire here. The real direct parent of form.woocommerce-cart-form and
   .cart-collaterals is the div.woocommerce that the [woocommerce_cart]
   shortcode itself wraps its output in (one level inside .mf-info-content —
   confirmed via DOM inspection, not the .mf-info-content element itself).
   grid-row is set explicitly on both children so an incidental sibling
   (e.g. an empty <p> from wpautop, or a WC notice) can't shift either one
   onto its own row via auto-placement. */
.woocommerce-cart .mf-info-content>.woocommerce{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(320px,.6fr);gap:28px;align-items:start}
.woocommerce-cart form.woocommerce-cart-form{grid-column:1;grid-row:1;min-width:0}
.woocommerce-cart .cart-collaterals{grid-column:2;grid-row:1}
.woocommerce-cart .cart_totals{position:sticky;top:100px}
.moodfex-cart-thumb-wrap{width:140px!important;height:140px!important;border-radius:18px;overflow:hidden;display:block;box-shadow:0 8px 24px rgba(5,42,35,.08)}
/* WooCommerce core CSS ships an unconditional, higher-specificity rule —
   .woocommerce-cart table.cart img{width:32px} — that otherwise wins over a
   plain .moodfex-cart-thumb-img{width:100%} rule regardless of file load
   order. !important is required here, not just cosmetic. */
.moodfex-cart-thumb-img{width:100%!important;height:100%!important;object-fit:cover}
.woocommerce-cart table.cart td.product-thumbnail{width:160px}
/* WooCommerce's own woocommerce-smallscreen.css (media="max-width:768px") sets
   .product-thumbnail{display:none} — without this override the thumbnail column
   vanishes between the 561px and 768px range, before our own <=560px mobile
   layout (below) ever takes over. */
.woocommerce-cart table.cart td.product-thumbnail{display:table-cell!important}
/* WooCommerce's shop_table_responsive rule adds a ": " label prefix
   (content:attr(data-title) ": ") to every <td>. The thumbnail <td> has no
   data-title attribute, so attr() resolves empty and only a bare, bold ":"
   renders — reported by the owner as "two dots" in the image's top-left
   corner. It was invisible before because the cell itself was hidden; fixing
   that visibility above exposed this stray label too. */
.woocommerce-cart table.cart td.product-thumbnail::before{content:none!important;display:none!important}
.woocommerce-cart table.cart td.product-name a{font-family:var(--font-heading);font-size:19px;color:var(--mf-text)}
.woocommerce-cart table.cart td.product-remove a{width:36px;height:36px;border-radius:999px;border:1px solid var(--mf-line);display:flex;align-items:center;justify-content:center;font-size:18px;color:var(--mf-muted);transition:background .2s ease,color .2s ease,border-color .2s ease}
.woocommerce-cart table.cart td.product-remove a:hover{background:#fdeeee;color:#c0392b;border-color:#f3caca}
.woocommerce-cart .quantity .qty{min-height:46px!important;width:76px!important;text-align:center}
.woocommerce-cart .coupon{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.woocommerce-cart .coupon .input-text{min-height:50px!important;max-width:220px}
.woocommerce-cart .coupon button{min-height:50px}

@media(max-width:1100px){
  .woocommerce-cart .mf-info-content>.woocommerce{grid-template-columns:1fr}
  /* form.woocommerce-cart-form/.cart-collaterals keep their desktop grid-column:1/2
     above; without resetting both here, a single-column grid-template-columns
     still implicitly creates a 2nd track for the column:2 item instead of
     stacking it, so it visually overlaps the first column. */
  .woocommerce-cart form.woocommerce-cart-form,.woocommerce-cart .cart-collaterals{grid-column:1;grid-row:auto}
  .woocommerce-cart .cart_totals{position:static;margin-top:24px}
  .moodfex-cart-thumb-wrap{width:110px!important;height:110px!important}
  .woocommerce-cart table.cart td.product-thumbnail{width:126px}
}
@media(max-width:560px){
  /* Overrides the theme's pre-existing 64px mobile thumbnail (assets/css/style.css) —
     too small to read; loaded after it here so this wins at equal specificity. */
  .moodfex-cart-thumb-wrap,.moodfex-cart-thumb-img{width:96px!important;height:96px!important;border-radius:14px}
  .woocommerce-cart table.cart tr.cart_item{grid-template-columns:100px minmax(0,1fr)!important}
  /* The tablet tier above sets td.product-thumbnail{width:126px}; left un-overridden
     here, that width survives (media queries aren't mutually exclusive) and the cell
     overflows the 100px grid track by ~26px, physically covering the left portion of
     the Remove (x) button in the next column — reported by the owner as being unable
     to delete an item on mobile. Matches the 100px track (96px image + 2px padding
     each side) exactly, eliminating the overflow. */
  .woocommerce-cart table.cart td.product-thumbnail{width:100px!important}
  /* Belt-and-braces: even if a future change reintroduces overlap, the remove
     button must always win the tap regardless of what visually sits under it. */
  .woocommerce-cart table.cart td.product-remove{position:relative;z-index:2}
}

/* ---------- E) Checkout — Apple-style large inputs & steps ---------- */
.woocommerce-checkout .woocommerce-billing-fields>h3,
.woocommerce-checkout .woocommerce-shipping-fields>h3{font-family:var(--font-heading);font-size:22px;color:var(--mf-deep);margin:0 0 18px;padding-bottom:14px;border-bottom:1px solid var(--mf-line)}
.woocommerce-checkout .form-row{margin-bottom:16px!important}
.woocommerce-checkout input.input-text,.woocommerce-checkout select,.woocommerce-checkout textarea{transition:border-color .25s ease,box-shadow .25s ease}
.woocommerce-checkout input.input-text:focus,.woocommerce-checkout select:focus,.woocommerce-checkout textarea:focus{outline:none;border-color:var(--mf-gold)!important;box-shadow:0 0 0 4px rgba(197,165,114,.18)}
.woocommerce-checkout #payment{background:var(--mf-cream);border-radius:16px;padding:4px;margin-top:20px}
.woocommerce-checkout #payment ul.payment_methods{padding:14px!important;margin:0!important}
.woocommerce-checkout #payment li.payment_method{border-bottom:1px solid var(--mf-line)!important;padding:14px 4px!important}
.woocommerce-checkout #payment li.payment_method:last-child{border-bottom:0!important}
.woocommerce-checkout #payment div.payment_box{background:#fff!important;border-radius:12px!important;margin-top:10px!important}
.woocommerce-checkout .woocommerce-checkout-review-order{position:sticky;top:100px}
.woocommerce-checkout #place_order{width:100%;min-height:58px;font-size:16px;margin-top:14px}

@media(max-width:1100px){.woocommerce-checkout .woocommerce-checkout-review-order{position:static}}

/* ---------- F) My Account — premium dashboard ---------- */
.mf-acct-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:24px 0}
.mf-acct-card{text-align:center;border:1px solid var(--mf-line);border-radius:18px;padding:22px 16px;background:var(--mf-cream)}
.mf-acct-card__icon{display:flex;align-items:center;justify-content:center;width:50px;height:50px;border-radius:50%;background:#fff;color:var(--mf-gold);margin:0 auto 12px}
.mf-acct-card__icon svg{width:26px;height:26px}
.mf-acct-card strong{display:block;font-family:var(--font-heading);font-size:26px;color:var(--mf-deep)}
.mf-acct-card p{margin:4px 0 0;font-size:13px;color:var(--mf-muted)}
.mf-acct-quicklinks{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:8px}
.mf-acct-quicklinks a{display:flex;align-items:center;gap:8px;min-height:50px;padding:0 16px;border:1px solid var(--mf-line);border-radius:14px;font-weight:700;color:var(--mf-deep);font-size:14px;transition:background .2s ease,border-color .2s ease}
.mf-acct-quicklinks a:hover{background:#f2f5ef;border-color:var(--mf-gold)}
.mf-acct-quicklinks svg{width:15px;height:15px}

.woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-actions a{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:0 14px;border-radius:10px;font-size:13px;font-weight:700;margin:2px}
.woocommerce-MyAccount-content .woocommerce-orders-table__cell-order-actions a.view{background:var(--mf-deep)!important;color:#fff!important}
.woocommerce-Address{border:1px solid var(--mf-line);border-radius:16px;padding:20px}
.woocommerce-Addresses{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
.woocommerce-Address-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.woocommerce-Address-title h3{font-family:var(--font-heading);font-size:18px;color:var(--mf-deep);margin:0}

@media(max-width:900px){.mf-acct-quicklinks{grid-template-columns:repeat(2,1fr)}.woocommerce-Addresses{grid-template-columns:1fr}}
@media(max-width:560px){.mf-acct-cards{grid-template-columns:1fr 1fr}.mf-acct-quicklinks{grid-template-columns:1fr}}

/* ---------- E) Reading landing pages — real buy box + brand-token pass on the .mf-dr-* content grids ---------- */
.mf-reading-buybox{display:grid;grid-template-columns:220px minmax(0,1fr);gap:32px;align-items:center;background:#fff;border:1px solid var(--mf-line);border-radius:var(--mf-radius);padding:32px;box-shadow:0 18px 54px rgba(5,42,35,.07);margin:0 0 36px}
.mf-reading-buybox__media{aspect-ratio:1/1;border-radius:16px;overflow:hidden}
.mf-reading-buybox__media img{width:100%;height:100%;object-fit:cover}
.mf-reading-buybox__eyebrow{display:inline-block;color:var(--mf-gold);text-transform:uppercase;letter-spacing:.14em;font-size:12px;font-weight:700;margin-bottom:10px}
.mf-reading-buybox__info h2{font-family:var(--font-heading);font-size:clamp(26px,3vw,36px);color:var(--mf-deep);margin:0 0 12px;line-height:1.12}
.mf-reading-buybox__price{font-size:22px;font-weight:700;color:var(--mf-deep);margin-bottom:18px}
.mf-reading-buybox__price ins{text-decoration:none}
.mf-reading-buybox__cta form.cart{margin:0!important;display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.mf-reading-buybox__cta .single_add_to_cart_button,.mf-reading-buybox__cta .add_to_cart_button{min-height:54px!important;padding:0 32px!important;border-radius:16px!important;font-size:15px!important}
.mf-reading-buybox__trust{list-style:none;margin:16px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
.mf-reading-buybox__trust li{font-size:13px;color:var(--mf-muted);padding-left:18px;position:relative}
.mf-reading-buybox__trust li:before{content:"✦";position:absolute;left:0;color:var(--mf-gold);font-size:11px}

@media(max-width:900px){.mf-reading-buybox{grid-template-columns:1fr;padding:24px;text-align:center}.mf-reading-buybox__media{max-width:220px;margin:0 auto}.mf-reading-buybox__trust{align-items:center}.mf-reading-buybox__cta form.cart{justify-content:center}}

/* Brand-token pass over the .mf-dr-* content-grid pages (Digital Readings hub + category pages).
   These selectors live in page content (DB), not theme templates; !important guarantees this
   file — loaded after the page's own inline <style> block — always wins regardless of source order. */
.mf-dr-kicker{color:var(--mf-gold)!important}
.mf-dr-head h2,.mf-dr-body h3{color:var(--mf-deep)!important;font-family:var(--font-heading)!important}
.mf-dr-link{color:var(--mf-gold)!important;display:inline-flex!important;align-items:center;gap:6px;transition:gap .2s ease}
.mf-dr-card{transition:transform .3s cubic-bezier(.22,.61,.36,1),box-shadow .3s ease!important}
.mf-dr-card:hover .mf-dr-link{gap:10px}
.mf-dr-card:focus-visible{outline:2px solid var(--mf-gold);outline-offset:3px}
.mf-dr-img{transition:transform .5s cubic-bezier(.22,.61,.36,1)}
.mf-dr-card:hover .mf-dr-img{transform:scale(1.05)}

/* ---------- Reduced motion ---------- */
@media(prefers-reduced-motion:reduce){
  .mf-cat-card,.mf-cat-card__media img,.woocommerce ul.products li.product,.woocommerce ul.products li.product a img,.mf-sticky-atc,.mf-sort-drawer__panel,.mf-sort-drawer__backdrop,.mf-dr-card,.mf-dr-img{transition:none!important}
}
