/* ============================================================
   SpOki Mobile Closure - scoped fixes (Phase 1A/1B register)
   Owner-approved 2026-07-19. Staging closure batch 1.
   KILL SWITCH: dequeue 'spoki-mobile-closure' in functions.php
   Do NOT add a global spacing system here. Scoped only.
   Deferred (need visual gate): B01 sticky, B03 tap-icons, B06.
   ============================================================ */

/* A02 - Homepage section spacing, approved values, mobile only */
@media (max-width:768px){
  .spoki-advisor.spoki-band{padding-top:48px;padding-bottom:48px;}
  .spoki-awards-strip.spoki-band{padding-top:48px;padding-bottom:48px;}
  .spoki-categories.spoki-band{padding-top:64px !important;padding-bottom:64px !important;}
  .spoki-social.spoki-band{padding-top:48px;padding-bottom:48px;}
  .spoki-gift-age.spoki-band{padding-top:64px;padding-bottom:64px;}
  .spoki-story.spoki-band{padding-top:64px;padding-bottom:64px;}
}

/* A03/A04 - FAQ: collapse duplicated inner spacing + visible chevron */
.spoki-faq-wrap .spoki-faq-section{margin-top:0;margin-bottom:0;}
.spoki-faq-item .spoki-faq-question{position:relative;padding-right:34px;}
.spoki-faq-item .spoki-faq-question::after{
  content:"";position:absolute;right:14px;top:50%;width:9px;height:9px;
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:translateY(-65%) rotate(45deg);transition:transform .2s ease;opacity:.55;
}
.spoki-faq-item[open] .spoki-faq-question::after{transform:translateY(-35%) rotate(-135deg);}

/* A01-fix - Summer mosaic scrim now covers the full card (was bottom:0;height:62% -- left the top ~38% of every photo undarkened with a hard visible seam at the boundary, reported as "two images stacked"). 2026-07-21 */
.spoki-summer-mosaic .wp-block-cover{position:relative;}
.spoki-summer-mosaic .wp-block-cover::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(to top,rgba(0,0,0,.74) 0%,rgba(0,0,0,.42) 45%,rgba(0,0,0,0) 100%);
  pointer-events:none;z-index:1;
}
.spoki-summer-mosaic .wp-block-cover__inner-container{position:relative;z-index:2;}

/* B04 - Tiny secondary (BGN) price in mini boost widget */
.spoki-mcboost__price,
.spoki-mcboost__price .woocommerce-Price-amount{font-size:12px !important;line-height:1.3;}

/* B05 - Marginal 42px controls -> min 44px */
.wc-proceed-to-checkout .checkout-button,
.cart-widget-side .buttons .checkout,
.widget_shopping_cart .buttons .checkout,
.woocommerce-form-login input.input-text,
.woocommerce-form-register input.input-text,
.woocommerce-form-login button,
.woocommerce-form-register button{min-height:44px !important;}

/* B03 - WITHDRAWN: audit misidentified header .wd-tools-icon as product-card icons; product cards have no action icons (owner wishlist lock removed hearts). No fix needed. */

/* B05-adj - mini-cart voucher input >=44px (no financial/voucher logic change) */
input[name="spoki_mc_code"],.spoki_mc_code{min-height:44px !important;box-sizing:border-box;}

/* D3 - checkout & Econt inputs >=16px to prevent iOS focus zoom (mobile only) */
@media (max-width:768px){
  .woocommerce-checkout input.input-text,
  .woocommerce-checkout textarea,
  .woocommerce-checkout select,
  .woocommerce-checkout .select2-search__field,
  form.checkout input[type=text],
  form.checkout input[type=email],
  form.checkout input[type=tel],
  form.checkout input[type=number],
  form.checkout textarea,
  form.checkout select{font-size:16px !important;}
}

/* D9 - side-cart close button >=44x44 hit area (visual icon unchanged) */
.cart-widget-side .close-side-widget,
.cart-widget-side .wd-close-side-widget{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;}

/* D2 - cart remove control is position:absolute (pinned top-right), reserve enough right-clearance on the title so wrapped long titles never run under it (mobile only) */
@media (max-width:768px){
  .woocommerce-cart-form td.product-name{padding-right:96px !important;}
}

/* P2-1 - cart qty stepper buttons/input were 25x30/30x30 (below 44x44 tap-target min); mobile only, visual size unchanged in spirit (just bigger hit area) */
@media (max-width:768px){
  .quantity .minus.btn,
  .quantity .plus.btn,
  .quantity input.qty{min-width:44px !important;min-height:44px !important;}
}

/* P2-3 - CF7 validation error text was pure red #FF0000 on white/cream = 4.0:1 contrast, below WCAG AA 4.5:1 for normal text. Swap to Material's #B00020 (~7.3:1), a recognizable, standard accessible error red -- no copy/logic change. */
.wpcf7-not-valid-tip{color:#B00020 !important;}

/* P2-5 - .wd-toolbar-label gets squeezed to a hardcoded ~20px box (theme's own @media max-width:768px icon-bar treatment, meant for phone widths) at EXACTLY 768px, clipping labels like "По възраст"/"Подаръци"/"Търсене"/"Количка" mid-word. 769px+ already renders fine (166-230px). This theme's own convention treats 768 as tablet-start (docs/spoki-locked-rules), so restore natural width at exactly that one pixel value only -- narrower phones and 769px+ both untouched. */
@media (min-width:768px) and (max-width:768px){
  .wd-toolbar .wd-toolbar-label{width:max-content !important;max-width:none !important;overflow:visible !important;}
}

/* D20 - Complianz cookie banner (.cmplz-cookiebanner, fixed, z-index:99999) sits above the
   mobile nav drawer (.wd-side-hidden, z-index:500) and covers the bottom ~50% of a phone
   viewport. Any visitor who has not yet answered the consent banner -- every first-time
   Android/Chrome visit, and EVERY Safari Private Browsing session since private cookies
   never persist -- opens the hamburger menu, taps an accordion item (По възраст etc.), and
   its submenu renders behind/under the still-visible banner: invisible and untappable for
   any item whose submenu extends into the banner's covered region. Root-caused via staging
   inspection with cookies cleared to reproduce the unconsented state (2026-07-22).
   Fix: only while the drawer is actually open, raise it above the banner so the menu the
   visitor explicitly requested is reachable; the banner still shows (and is still the
   frontmost thing) whenever the drawer is closed, so consent visibility/dismissibility is
   unaffected. No change to consent logic, copy, or default state. */
.wd-side-hidden.wd-opened{z-index:999999 !important;}

/* D20b - same collision, second surface, found during D20 closeout QA (2026-07-22).
   .cart-widget-side is the SAME .wd-side-hidden component at the SAME z-index:500, so the
   side cart regressed identically for unconsented visitors: hit-testing at 375x812 showed
   12/12 interactive elements below y=398 swallowed by the banner, including "Bиж количката"
   and "Kъм завършване" -- i.e. the consent banner was blocking the checkout entry point for
   every first-time / Safari Private visitor. Scoping the rule above to .wd-side-hidden
   (instead of .mobile-nav) covers the drawer, the side cart and any future side panel from
   one place, since they share the component and the defect.
   The backdrop must come up with them: at z-index:400 it stayed under the banner, so a tap
   outside the drawer closed it above y=398 but hit the banner below y=398. Raising it to
   999998 (below the drawer, above the banner) makes tap-to-close behave the same across the
   whole viewport. Both rules are keyed to the theme's own open-state classes, so everything
   returns to normal stacking on close -- verified: drawer back to z-index 500, banner
   visible with all three consent buttons (Приемам/Отказвам/Настройки) hit-test reachable.
   No consent logic, copy, categories or cookie lifetimes touched. */
.wd-close-side.wd-close-side-opened{z-index:999998 !important;}

/* D20c - ordering repair for the add-to-cart toast, caused by D20/D20b above.
   #spoki-toast (inline <style> in inc/spoki-cart-boost.php) is z-index:100000, which used to
   sit ABOVE the drawers back when they were 500. Raising the drawers to 999999 silently
   inverted that, so a toast fired from inside the open side cart (its "Добави" upsell buttons)
   would have been hidden behind the drawer that triggered it. Restoring the original intent:
   toast on top of everything. Final ladder, low to high:
     scrollToTop/toolbar 350 < backdrop(closed) 400 < drawer(closed) 500
     < consent banner 99999 < backdrop(open) 999998 < drawer(open) 999999 < toast 1000000
   Done from CSS because the value lives in a .php file, which is out of bounds for direct
   edits under the sandbox write restriction; the inline rule is an ID selector with no
   !important, so this external !important rule wins cleanly without touching the PHP. */
#spoki-toast{z-index:1000000 !important;}
