/* ============================================================
   Soukara — Storefront base styles
   Global resets, body defaults, and shared .sx-* interaction
   classes used across all storefront templates.
   Page-specific styles are enqueued separately per template.
   ============================================================ */

/* ---- Resets ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* ---- Body defaults ---- */
body {
  background: var(--color-bg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Text selection ---- */
::selection { background: var(--clay-200); color: var(--slate-900); }

/* ---- Focus visible ---- */
:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: var(--radius-sm);
}

/* ---- Accessibility: visually-hidden text (WordPress .screen-reader-text) ---- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  position: absolute !important;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--cream);
  clip: auto !important;
  clip-path: none;
  color: var(--slate-900);
  display: block;
  height: auto;
  width: auto;
  left: 5px;
  top: 5px;
  padding: 12px 18px;
  font-size: 14px;
  z-index: 100000;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================
   Product card
   ========================================================== */

/* Card shell */
.sx-card {
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
}

/* Card image (fills the 4:5 well; zooms on hover) */
.sx-cimg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sx-card:hover .sx-cimg { transform: scale(1.06); }
.sx-card:hover .sx-add  { opacity: 1; transform: translateY(0); }
.sx-card .sx-cimg       { transition: transform .7s cubic-bezier(.16, 1, .3, 1); }

/* Wishlist heart + quick-view eye (positioned top-right inside the image well) */
.sx-fav {
  position: absolute;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 99px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 248, 243, .92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .25s ease, color .25s ease;
}

/* Add-to-bag button (positioned bottom; hidden until card hover) */
.sx-add {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 42px;
  border: 0;
  border-radius: 7px;
  background: var(--slate-800);
  color: var(--cream);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out), background .25s ease;
}
.sx-add:hover { background: var(--slate-900); color: var(--cream); }

/* Touch devices: always show add button */
@media (hover: none) {
  .sx-add { opacity: 1 !important; transform: translateY(0) !important; }
}

/* ==========================================================
   Link & navigation interactions
   ========================================================== */

/* Inline link */
.sx-link { transition: color .25s ease; }
.sx-link:hover { color: var(--clay-600); }

/* Nav link with animated underline */
.sx-nav {
  position: relative;
  transition: color .25s ease;
  text-decoration: none;
}
.sx-nav::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 1.5px;
  width: 0;
  background: var(--clay-500);
  transition: width .3s var(--ease-out);
}
.sx-nav:hover                { color: var(--slate-900); }
.sx-nav:hover::after         { width: 100%; }

/* ==========================================================
   Button interactions
   ========================================================== */

.sx-btn {
  transition: background .25s ease, color .25s ease, border-color .25s ease,
              transform .12s ease, box-shadow .25s ease;
}
.sx-btn:active { transform: translateY(1px); }
.sx-btn:hover  { box-shadow: var(--shadow-sm); }

/* Soft surface button (transparent background, sand hover) */
.sx-soft:hover { background: var(--sand-100); }

/* ==========================================================
   Tile (editorial / category card) interactions
   ========================================================== */

.sx-tile:hover .sx-tileimg { transform: scale(1.07); }
.sx-tile .sx-tileimg        { transition: transform .8s cubic-bezier(.16, 1, .3, 1); }

/* ==========================================================
   Form input interactions
   ========================================================== */

.sx-in { transition: border-color .2s ease, box-shadow .2s ease; }
.sx-in:focus {
  outline: none;
  border-color: var(--clay-500);
  box-shadow: var(--ring-input);
}

/* ==========================================================
   Quantity stepper (shared: quick-view, cart 6.1, PDP 5.2)
   Wired by storefront.js via [data-soukara-qty] + minus/plus.
   ========================================================== */

.soukara-qty {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 8px;
  overflow: hidden;
}
.soukara-qty__btn {
  width: 40px;
  border: 0;
  background: var(--cream);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--slate-800);
  display: flex;
  align-items: center;
  justify-content: center;
}
.soukara-qty__input {
  width: 48px;
  border: 0;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  background: transparent;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-strong);
  -moz-appearance: textfield;
  appearance: textfield;
}
.soukara-qty__input::-webkit-outer-spin-button,
.soukara-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ==========================================================
   Misc interactive element states
   ========================================================== */

.sx-fav:hover   { background: var(--cream); color: var(--clay-600); }
.sx-swatch:hover { border-color: var(--slate-700); }
.sx-thumb:hover  { opacity: 1; }

/* ==========================================================
   Keyframe animations
   ========================================================== */

@keyframes sxfade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes sxslidex {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes sxslidexl {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

@keyframes sxup {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes sxpop {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* ==========================================================
   Overlay / panel entrance animations
   ========================================================== */

.sx-route  { animation: sxfade .4s var(--ease-out); }
.sx-drawer { animation: sxslidex .34s cubic-bezier(.16, 1, .3, 1); }
.sx-drawerl { animation: sxslidexl .32s cubic-bezier(.16, 1, .3, 1); }
.sx-toast  { animation: sxup .32s var(--ease-out); }
.sx-modal  { animation: sxpop .3s var(--ease-out); }
.sx-scrim  { animation: sxfade .25s var(--ease-out); }

/* ==========================================================
   Product grid
   ========================================================== */

.sx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 34px 26px;
}

/* ── Content container ─────────────────────────────────────────────────────
   Centred, max-width page wrapper used by the route pages (wishlist, etc.). */
.sx-container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

/* ── Breadcrumb ────────────────────────────────────────────────────────────
   Inline "Home / Page" trail; resets the <ol> list chrome. */
.sx-breadcrumb { margin: 0 0 18px; }
.sx-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
}
.sx-breadcrumb__item { display: inline-flex; align-items: center; gap: 8px; }
.sx-breadcrumb__item + .sx-breadcrumb__item::before {
  content: "/";
  color: var(--text-subtle);
}
.sx-breadcrumb__link { color: var(--text-muted); text-decoration: none; }
.sx-breadcrumb__link:hover { color: var(--text-strong); }
.sx-breadcrumb__item--current { color: var(--text-strong); font-weight: 600; }

/* ── Primary button variant (filled slate) ───────────────────────────────── */
.sx-btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--slate-800);
  color: var(--cream);
  border: 0;
  border-radius: 8px;
  min-height: 50px;
  padding: 0 26px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.sx-btn--primary:hover { background: var(--slate-900); color: var(--cream); }

/* ==========================================================
   Responsive breakpoints
   ========================================================== */

/* Tablet / narrow desktop: 980px */
@media (max-width: 980px) {
  .sx-shell { flex-direction: column; }
  .sx-pdp   { grid-template-columns: 1fr !important; }
  .sx-hide  { display: none !important; }
  .sx-grid  { gap: 26px 16px; }
  .sx-two   { grid-template-columns: 1fr !important; }

  /* Mobile nav trigger: visible */
  .sx-show {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Mobile sidebar / aside drawer */
  .sx-aside {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px !important;
    max-width: 86vw;
    background: var(--cream);
    z-index: 61;
    box-shadow: var(--shadow-lg);
    display: none !important;
    overflow-y: auto;
    padding: 22px 18px 34px;
    flex: none !important;
    margin: 0;
  }
  .sx-aside.is-open { display: block !important; }
}

/* Mobile: 640px — two-column product grid */
@media (max-width: 640px) {
  .sx-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 12px;
  }
}

/* ==========================================================
   Show / hide utility classes
   ========================================================== */

/* Hidden by default on desktop; revealed at 980px via the block above */
.sx-show { display: none; }
