﻿@import url("../tokens/colors.css");
@import url("../tokens/typography.css");
@import url("../tokens/spacing.css");
@import url("../tokens/radius.css");
@import url("../tokens/shadows.css");

/* =========================================================
   Curattr - Shared Design System
   Used by: index.html, collection.html, store.html, login.html
   ========================================================= */

/* ---------------------------------------------------------
   Shared UI: Views badge (eye + count)
   --------------------------------------------------------- */
.views-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);

  padding: var(--space-6) var(--space-10);
  border-radius: 999px;

  /* Global default: subtle light pill */
  background: rgba(248, 250, 252, 0.96);
  color: rgba(15, 23, 42, 0.55);

  font-family: var(--font-sans, inherit);
  font-variant-numeric: tabular-nums; /* optional but helps digits look consistent */

  font-size: var(--text-chip-size);
  font-weight: var(--text-chip-weight);
  line-height: var(--text-chip-line);
  letter-spacing: var(--text-chip-letter);
}

.views-icon {
  width: var(--space-14);
  height: var(--space-14);
  display: block;
}

.views-badge .views-count,
.views-badge .views-icon {
  font-size: var(--text-chip-size);
  font-weight: var(--text-chip-weight);
  line-height: var(--text-chip-line);
  letter-spacing: var(--text-chip-letter);
}


.views-count {
  display: inline-block;
}

/* =========================================================
   Menu / dropdown primitive (reused across pages)
   Usage:
   <div class="menu ...">
     <button class="pill-btn ...">...</button>
     <div class="menu-panel" role="menu">...</div>
   </div>
   ========================================================= */

.menu { position: relative; }
.menu .menu-panel { display: none; }
.menu.is-open .menu-panel { display: block; }

/* ---------- CSS Variables ---------- */
:root {
  --layout-gutter: var(--space-24);
--max: 1320px;

  --text: #0f172a;
  --muted: #64748b;

  --border: rgba(15, 23, 42, 0.10);
  --stroke: rgba(15, 23, 42, 0.10);

  --brand: #2f6bff;
  --brand-2: #2aa3ff;

  /* Shared interaction ring (standard "light") */
  --ring-border: rgba(47, 107, 255, 0.50);
  --ring-border-strong: rgba(47, 107, 255, 0.60);
  --ring: 0 0 0 3px rgba(47, 107, 255, 0.12);
  --ring-strong: 0 0 0 3px rgba(47, 107, 255, 0.16);

  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Layout */
  --gutter: 24px;
  --gutter-sm: 16px;
  --gutter-lg: 32px;

  --shopify-green: #95BF47;
  --shopify-green-dark: #5E8E3E;

  --tag-bg: #f1f5f9;
  --tag-text: #475569;

  /* Fallback to reduce first-paint jump before JS measures fixed topbar height */
  --topbar-offset: 118px;

  /* ---------------------------------------------------------
     Global Card Contract
     Source of truth for reusable store/app cards across:
     - homepage rails
     - collection grid
     - wishlist grid/rails
     - store rails
     - app collection grid/list
     - app detail rails

     Ownership rule:
     - styles.css owns card internals
     - page CSS owns layout only
     --------------------------------------------------------- */

  /* Core surface */
  --card-radius: var(--radius-xl, 16px);
  --card-border-color: rgba(15, 23, 42, 0.10);
  --card-border: 1px solid var(--card-border-color);
  --card-bg: rgba(255, 255, 255, 0.92);

  /* Elevation + motion */
  --card-shadow: var(--shadow-soft, 0 10px 24px rgba(15, 23, 42, 0.08));
  --card-hover-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
  --card-hover-transform: translateY(-1px);
  --card-hover-duration: 0.18s;
  --card-focus-ring-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);

	  /* Spacing */
	  --card-padding: var(--space-14, 14px);
	  --card-gap: 10px;
	  --card-body-gap: 10px;
	  --card-body-pad-x: 16px;
	  --card-body-pad-top: 14px;
	  --card-body-pad-bottom: 16px;
	  --card-media-content-gap: 0;
	  --card-grid-gap: 18px;
  --card-overlay-inset: 10px;

  /* Media */
  --card-width-desktop: 326px;
  --card-image-radius: calc(var(--card-radius) - 4px);
  --card-media-aspect: 4 / 3;
  --card-image-aspect: var(--card-media-aspect, 4 / 3);
  --card-image-fit: cover;
  --card-image-position: center center;
  --card-media-min-height: 180px;
  --card-media-bg: #f8fafc;

  /* Typography */
	  --card-title-size: var(--text-card-title-size);
	  --card-title-weight: var(--text-card-title-weight);
	  --card-title-line-height: var(--text-card-title-line);
	  --card-title-lines: 2;
	  --card-title-min-height: calc(var(--card-title-size) * var(--card-title-line-height) * 2);
	  --card-meta-min-height: 28px;
	  --card-tags-min-height: 28px;

	  /* Badges / pills */
	  --card-badge-gap: 8px;
	  --card-badge-pad-y: 5px;
	  --card-badge-pad-x: 9px;
	  --card-badge-radius: 6px;
	  --card-badge-min-height: 28px;
	  --card-badge-font-size: var(--text-caption-size);
	  --card-badge-font-weight: var(--text-caption-weight);
	  --card-badge-line-height: var(--text-caption-line);
	  --card-badge-bg: #f8fafc;
	  --card-badge-border: #dbe4ee;
	  --card-badge-text: #334155;

	  --card-tag-gap: 8px;
	  --card-tag-pad-y: 4px;
	  --card-tag-pad-x: 10px;
  --card-tag-radius: 6px;
	  --card-tag-min-height: 28px;
	  --card-tag-font-size: var(--text-chip-size);
	  --card-tag-font-weight: var(--text-chip-weight);
	  --card-tag-line-height: var(--text-chip-line);
	  --card-tag-bg: #f8fafc;
	  --card-tag-border: #e2e8f0;
	  --card-tag-text: #64748b;

  --card-desc-size: var(--text-body-sm-size);
  --card-desc-line-height: var(--text-body-sm-line);
  --card-desc-color: rgba(15, 23, 42, 0.72);
  --card-desc-line-clamp: 2;
}

/* ---------- Reset / Base ---------- */
* { box-sizing: border-box; }

html,
body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--text-body-size);
  font-weight: var(--text-body-weight);
  line-height: var(--text-body-line);
  letter-spacing: var(--text-body-letter);
  color: var(--text);
  background: #ffffff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: var(--font-family-base);
  font-size: inherit;
}

/* ---------- Global Layout ---------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--space-24);
  padding-right: var(--space-24);
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--space-24);
  padding-right: var(--space-24);
}

/* =========================================================
   Page shell (global)
   Guarantees sticky footer + consistent content sizing
   ========================================================= */
.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.page-shell {
  padding-top: 0 !important;
}

.page-shell .page-content {
  flex: 1;
  padding-top: 0;
  min-width: 0; /* prevents overflow issues in grid/flex children */
}

/* =========================================================
   Announcement Bar
   ========================================================= */
.announce {
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}

.announce-link {
  display: block;
  text-align: center;
  padding: var(--space-10) var(--space-0);
  font-size: var(--text-body-sm-size);
  font-weight: var(--text-body-sm-weight);
  line-height: var(--text-body-sm-line);
  letter-spacing: var(--text-body-sm-letter);
  color: rgba(15, 23, 42, 0.72);
  text-decoration: none;
}

.announce-link:hover {
  color: rgba(15, 23, 42, 0.92);
  text-decoration: underline;
}

/* =========================================================
   Sticky Topbar (Announcement + Header)
   Shared by: collection.html, store.html, login.html
   ========================================================= */
.topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  z-index: 200;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

/* Content clearance: pages start below the measured topbar height */
.page-home,
.page-collection,
.page-store,
.page-login,
.page-user,
.page-wishlist,
.page-app {
  padding-top: var(--topbar-offset);
}


/* Keep this class harmless if it still appears */
body.has-fixed-topbar {
  padding-top: 0 !important;
}

/* Topbar internal borders */
.topbar .announce{
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

/* Header inside topbar should not add extra border */
.topbar .site-header{
  border-bottom: 0;
}

.verify-banner {
  position: relative;
  z-index: 199;
  background: linear-gradient(90deg, rgba(47, 107, 255, 0.08), rgba(42, 163, 255, 0.08));
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.verify-banner-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: var(--text-body-sm-size);
  font-weight: var(--text-body-sm-weight);
  line-height: var(--text-body-sm-line);
  letter-spacing: var(--text-body-sm-letter);
}

.verify-banner .btn-util-sm {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .verify-banner-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* =========================================================
   Header / Navigation
   ========================================================= */

/* Base header (NON-sticky by default) */
.site-header {
  position: static;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.site-header .wrap {
  height: 72px;
  display: flex;
  align-items: center;
}

/* Default nav layout (collection/store with search column) */
.nav {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-16);
}

.header-left {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
  min-width: 0;
}

.mode-nav {
  justify-self: start;
}

.header-actions {
  justify-self: end;
}

/* Home header layout (no search column) */
.page-home .nav {
  grid-template-columns: auto 1fr auto;
}

/* Full-height wishlist layout */
.page-wishlist {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wishlist main {
  flex: 1;
}

/* Topbar Wishlist - clean icon only */
.header-wishlist {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  padding: 0 !important;
  min-width: auto !important;
  height: auto !important;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-wishlist { position: relative; }

.header-wishlist-count {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #b42318;
  color: #ffffff;
  font-size: var(--text-chip-size);
  font-weight: var(--text-chip-weight);
  line-height: var(--text-chip-line);
  letter-spacing: var(--text-chip-letter);
  text-align: center;
}
.header-wishlist .heart-icon {
  width: 20px;
  height: 20px;
}


/* Login header layout: match shared desktop header row structure */
.page-login .nav {
  grid-template-columns: auto 1fr auto;
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  height: 32px;   /* desktop */
  width: auto;
  display: block;
}

@media (max-width: 768px) {
  .brand-mark {
    height: 24px; /* mobile */
  }
}

/* ---------- Header Search ---------- */
.header-search {
  margin: 0;
  width: 100%;
  max-width: 280px;
}

.header-actions .header-search {
  flex: 0 0 280px;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-12);
  min-width: 0;
}

.header-auth-links {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}

.header-auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 var(--space-8);
  border-radius: 8px;
  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  line-height: var(--text-button-line);
  letter-spacing: var(--text-button-letter);
  color: rgba(15, 23, 42, 0.78);
  text-decoration: none;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.header-auth-link:hover {
  color: rgba(15, 23, 42, 0.94);
  background: rgba(15, 23, 42, 0.04);
}

.header-auth-link:focus-visible {
  outline: none;
  color: rgba(15, 23, 42, 0.94);
  box-shadow: var(--ring);
}

.header-auth-link-primary {
  min-height: 32px;
  padding: 0 var(--space-12);
  border: 1px solid #2f6bff;
  border-radius: 8px;
  background: #2f6bff;
  color: #ffffff;
}

.header-auth-link-primary:hover {
  background: #2559d9;
  border-color: #2559d9;
  color: #ffffff;
}

.header-auth-link-primary:focus-visible {
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.18);
}

/* Stores | Apps mode menu (header) */
.mode-nav {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.mega-nav {
  position: relative;
  gap: 20px;
}

.mega-item {
  position: relative;
}

.mega-item::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
}

.mega-trigger {
  position: relative;
}

.mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  min-width: 760px;
  margin-top: 14px;
  padding: 20px 22px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  z-index: 260;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.mega-item.is-open .mega-panel {
  display: grid;
}

.mega-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.mega-title {
  margin-bottom: 4px;
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  line-height: var(--text-label-line);
  letter-spacing: var(--text-label-letter);
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.45);
}

.mega-link {
  display: block;
  font-size: var(--text-body-sm-size);
  font-weight: var(--text-body-sm-weight);
  line-height: var(--text-body-sm-line);
  letter-spacing: var(--text-body-sm-letter);
  color: rgba(15, 23, 42, 0.76);
  text-decoration: none;
}

.mega-link:hover {
  color: rgba(15, 23, 42, 0.96);
}

.mode-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 2px;
  font-size: var(--text-body-sm-size);
  font-weight: var(--text-body-sm-weight);
  line-height: var(--text-body-sm-line);
  letter-spacing: var(--text-body-sm-letter);
  color: rgba(15, 23, 42, 0.70);
  text-decoration: none;
}

.mode-link:hover {
  color: rgba(15, 23, 42, 0.92);
}

.mode-link.is-active {
  color: rgba(15, 23, 42, 0.95);
  font-weight: var(--text-button-weight); /* slightly bold on active */
  text-decoration-line: underline;
  text-underline-offset: 8px;
  text-decoration-thickness: 2px;
  text-decoration-color: #2E77FF;
}

@media (max-width: 760px) {
  .mode-nav { display: none; }
}

.header-search .ghost-wrap {
  position: relative;
  border-radius: 12px;
  height: 44px;
}

.header-search .ghost-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(46, 119, 255, 0);
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

/* Ghost suggestion (header): visual-only overlay behind typed text */
/* Ghost search fully deprecated */
#headerSearchGhost {
  display: none !important;
}

/* Real input stays on top; the input itself is the bordered field */
.header-search .ghost-wrap > input.header-search-input {
  position: relative;
  background: transparent;
}

.header-search input {
  width: 100%;
  height: 100%;
  padding: 0 42px 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: #f8fafc;
  color: rgba(15, 23, 42, 0.88);
  font-size: var(--text-body-size);
  font-weight: var(--text-body-weight);
  line-height: var(--text-body-line);
  letter-spacing: var(--text-body-letter);
  box-shadow: none;
}

.header-search input:focus,
.header-search input:focus-visible {
  outline: none;
  border-color: rgba(46, 119, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(46, 119, 255, 0.10);
}

.header-search input::placeholder {
  color: rgba(100, 116, 139, 0.92);
}

.header-search-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: rgba(148, 163, 184, 0.95);
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.header-search-btn:hover {
  background: transparent;
}

.header-search-btn:active {
  background: transparent;
}

.header-search-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

.header-search-btn svg {
  display: block;
}

/* Wishlist icon should look like the shared heart style */
.header-wishlist .heart-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

/* Avatar button */
.avatar-btn {
  width: var(--avatar-size, 34px);
  height: var(--avatar-size, 34px);
  border-radius: var(--avatar-radius, 999px);
  border: 1px solid var(--avatar-border, rgba(15, 23, 42, 0.08));
  background: var(--avatar-bg, #92d3f4);
  color: var(--avatar-text, var(--text));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.avatar-btn:hover {
  background: var(--avatar-hover, #7fc7ed);
}

.avatar-btn:active {
  background: var(--avatar-active, #6ebce8);
}

.avatar-initials {
  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  line-height: var(--text-button-line);
  letter-spacing: var(--text-button-letter);
}

/* =========================================================
   Category bar (secondary header row)
   ========================================================= */
.category-bar {
  background: var(--category-bg, #ffffff);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid var(--category-border, var(--border, rgba(15, 23, 42, 0.10)));
}

.category-bar .wrap {
  position: relative;
}

.category-row {
  height: var(--category-height, 44px);
  display: flex;
  align-items: center;
  gap: var(--category-gap, 18px);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-row::-webkit-scrollbar {
  display: none;
}

.category-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--space-6);
  color: var(--category-text, rgba(15, 23, 42, 0.70));
  font-size: var(--text-tab-size);
  font-weight: var(--text-tab-weight);
  line-height: var(--text-tab-line);
  letter-spacing: var(--text-tab-letter);
  white-space: nowrap;
  border-bottom: var(--category-active-thickness, 2px) solid transparent;
}

.category-link:hover {
  color: var(--category-hover, rgba(15, 23, 42, 0.92));
}

/* Active state (set by chrome.js based on URL category param) */
.category-link.is-active {
  color: var(--category-active, rgba(15, 23, 42, 0.92));
  border-bottom-color: var(--category-active-border, var(--brand));
}

/* Home: remove header search entirely */
.page-home .header-search {
  display: none;
}

/* Login: remove header search entirely (safe even if markup exists) */
.page-login .header-search {
  display: none;
}

/* ---------- Header Actions ---------- */
.header-actions {
  justify-self: end;
  display: flex;
  position: relative;
  align-items: center;
  gap: var(--space-12);
}

/* =========================================================
   Shared dropdown menu panel (account menu + sort menu)
   ========================================================= */
.menu-panel,
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  padding: var(--space-6);
  z-index: 220;
}

.menu-panel[hidden],
.account-menu[hidden] {
  display: none;
}

.menu-item,
.account-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: var(--space-10, 10px) var(--space-12, 12px);
  border-radius: 8px;
  font-size: var(--text-body-sm-size);
  font-weight: var(--text-button-weight);
  line-height: var(--text-body-sm-line);
  letter-spacing: var(--text-body-sm-letter);
  color: rgba(15, 23, 42, 0.92);
  cursor: pointer;
}

.menu-item {
  text-decoration: none;
}

.menu-item:hover,
.account-menu button:hover {
  background: rgba(15, 23, 42, 0.06);
}

/* Optional login styling (safe even if unused) */
.login-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}

.icon-login {
  width: 18px;
  height: 18px;
  display: block;
}

.login-text {
  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  line-height: var(--text-button-line);
  letter-spacing: var(--text-button-letter);
}

/* =========================================================
   Button System
   ========================================================= */
/* Deprecated .btn alias intentionally removed; keep .btn-cta canonical and isolated. */

/* Base button primitives (shared typography only) */
.btn-cta,
.btn-cta-sq,
.btn-util,
.btn-util-sm,
.btn-util-lg,
.btn-util-danger,
.icon-btn {
  font-weight: var(--text-button-weight);
}

/* CTA base (shared) */
.btn-cta,
.btn-cta-sq {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 40px;
  padding: var(--space-0) var(--space-14);

  border: 0;
  cursor: pointer;

  font-size: var(--text-button-size);
  line-height: var(--text-button-line);
  font-weight: var(--text-button-weight);
  letter-spacing: var(--text-button-letter);

  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));

  box-shadow: none;

  transition:
    box-shadow 0.15s ease,
    filter 0.15s ease,
    transform 0.15s ease;

  white-space: nowrap;
}

/* CTA variants */
.btn-cta { border-radius: 999px; }
.btn-cta-sq { border-radius: 12px; }

/* CTA states */
.btn-cta:hover,
.btn-cta-sq:hover { filter: brightness(1.04); }

.btn-cta:active,
.btn-cta-sq:active { transform: translateY(1px); }

.btn-cta:focus-visible,
.btn-cta-sq:focus-visible {
  outline: none;
  box-shadow: var(--ring, 0 0 0 3px rgba(47, 107, 255, 0.12));
}

.btn-cta:disabled,
.btn-cta[aria-disabled="true"],
.btn-cta-sq:disabled,
.btn-cta-sq[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Utility buttons */
.btn-util {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #ffffff;
  color: var(--text-secondary, #475569);
  border: 1px solid var(--border-subtle, #e5e7eb);

  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  line-height: var(--text-button-line);
  letter-spacing: var(--text-button-letter);
  cursor: pointer;
  white-space: nowrap;

  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.btn-util:hover {
  background: var(--bg-hover, #f8fafc);
}

.btn-util:disabled,
.btn-util[aria-disabled="true"] {
  /* More visible disabled state (still clearly disabled) */
  opacity: 1;
  color: #94a3b8;              /* slate-400 */
  background: #f8fafc;         /* slate-50 */
  border-color: #e2e8f0;       /* slate-200 */
  cursor: not-allowed;
  pointer-events: none;
}

.btn-util:disabled:hover,
.btn-util:disabled:active,
.btn-util[aria-disabled="true"]:hover,
.btn-util[aria-disabled="true"]:active {
  background: #ffffff;
  border-color: var(--border-subtle, #e5e7eb);
  box-shadow: none;
}

.btn-util:active {
  background: var(--bg-hover-strong, #f1f5f9);
  border-color: var(--ring-border, rgba(47, 107, 255, 0.6));
  box-shadow: var(--ring-strong, 0 0 0 3px rgba(47, 107, 255, 0.16));
}

/* Standardize keyboard focus ring for utility-like buttons */
.btn-util:focus-visible,
.icon-btn:focus-visible {
  outline: none;
  border-color: var(--ring-border, rgba(47, 107, 255, 0.5));
  box-shadow: var(--ring, 0 0 0 3px rgba(47, 107, 255, 0.12));
}

.btn-util-sm {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  line-height: var(--text-button-line);
  letter-spacing: var(--text-button-letter);
  border-radius: 8px;
}

.btn-util-lg {
  height: 40px;
  padding: var(--space-0) var(--space-14);
  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  line-height: var(--text-button-line);
  letter-spacing: var(--text-button-letter);
  border-radius: 12px;
}

/* =========================================================
   Control primitives (dropdown triggers, selects, etc.)
   Reusable across Collection, Wishlist, Lists
   ========================================================= */

/* Pill-style control button (used by Collection sort trigger) */
.pill-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  font-size: var(--text-chip-size);
  font-weight: var(--text-chip-weight);
  line-height: var(--text-chip-line);
  letter-spacing: var(--text-chip-letter);
  color: rgba(15, 23, 42, 0.6);
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.pill-btn:not(:disabled):hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.2);
  color: rgba(15, 23, 42, 0.82);
}

.pill-btn:focus-visible {
  outline: none;
  border-color: var(--ring-border, rgba(47, 107, 255, 0.35));
  box-shadow: var(--ring, 0 0 0 3px rgba(47, 107, 255, 0.12));
}

.pill-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pill-btn.is-active {
  background: rgba(47, 107, 255, 0.10);
  border-color: rgba(47, 107, 255, 0.35);
  color: rgba(47, 107, 255, 1);
}

/* Matching select control (same height/radius as Collection controls) */
.select-control {
  height: 36px;
  min-width: 220px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  font-size: var(--text-chip-size);
  font-weight: var(--text-chip-weight);
  line-height: var(--text-chip-line);
  letter-spacing: var(--text-chip-letter);
  color: rgba(15, 23, 42, 0.72);
  cursor: pointer;
}

.select-control:hover {
  border-color: rgba(15, 23, 42, 0.18);
}

.select-control:focus,
.select-control:focus-visible {
  outline: none;
  border-color: var(--ring-border, rgba(47, 107, 255, 0.35));
  box-shadow: var(--ring, 0 0 0 3px rgba(47, 107, 255, 0.12));
}

/* Optional: full-width utility button (sidebar) */
.btn-util-block {
  width: 100%;
}

/* Utility destructive */
.btn-util-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 40px;
  padding: 0 14px;

  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  line-height: var(--text-button-line);
  letter-spacing: var(--text-button-letter);

  border-radius: 12px;
  border: 1px solid rgba(180, 35, 24, 0.45);
  background: #b42318;
  color: #ffffff;

  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-util-danger:hover { filter: brightness(1.04); }
.btn-util-danger:active { transform: translateY(1px); }
.btn-util-danger:focus-visible {
  outline: none;
  box-shadow: var(--ring, 0 0 0 3px rgba(47, 107, 255, 0.12));
}
.btn-util-danger:disabled,
.btn-util-danger[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Icon buttons (header actions) */
.icon-btn {
  height: 40px;
  min-width: 40px;
  padding: var(--space-0) var(--space-12);
  border-radius: 999px;
  border: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  line-height: var(--text-button-line);
  letter-spacing: var(--text-button-letter);
  cursor: pointer;
}

/* =========================================================
   Grid / Cards
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card {
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(calc(-1 * var(--space-2)));
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
}

/* ---------- Media ---------- */
.thumb {
  height: 168px;
  background: #f8fafc;
  border-radius: 10px;
}

/* ---------- Tags ---------- */
.tags {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.tag {
  font-size: var(--text-chip-size);
  font-weight: var(--text-chip-weight);
  line-height: var(--text-chip-line);
  letter-spacing: var(--text-chip-letter);
  padding: var(--space-4) var(--space-8);
  border-radius: 6px;
  background: var(--tag-bg);
  color: var(--tag-text);
}

/* =========================================================
   Shared Card Primitive (Collection Card Base)
   ========================================================= */
.collection-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-width: 0;
  height: 100%;
  z-index: 0;

	  border: var(--card-border, 1px solid var(--stroke));
	  border-radius: var(--card-radius, 18px);
	  background: var(--card-bg, rgba(255, 255, 255, 0.92));
	  box-shadow: var(--card-shadow, var(--shadow-soft));

	  overflow: hidden;
	  text-decoration: none;
	  color: inherit;
	  transition:
	    transform var(--card-hover-duration) ease,
	    box-shadow var(--card-hover-duration) ease,
	    border-color var(--card-hover-duration) ease,
	    background-color var(--card-hover-duration) ease;
		}

	.collection-body {
	  display: flex;
	  flex-direction: column;
	  align-items: flex-start;
	  gap: var(--card-body-gap);
	  width: 100%;
	  padding: var(--card-body-pad-top) var(--card-body-pad-x) var(--card-body-pad-bottom);
	}

.collection-name {
  padding: 0;
  width: 100%;
  font-size: var(--card-title-size);
  font-weight: var(--card-title-weight);
  line-height: var(--card-title-line-height);
  letter-spacing: var(--text-card-title-letter);
  margin: 0;
  min-height: var(--card-title-min-height);
	  display: -webkit-box;
	  -webkit-line-clamp: var(--card-title-lines);
	  -webkit-box-orient: vertical;
	  overflow: hidden;
	  align-self: stretch;
	}

	.collection-meta {
	  padding: 0;
	  margin: 0;
	  display: flex;
	  align-items: center;
	  gap: var(--card-badge-gap);
	  flex-wrap: wrap;
	  width: 100%;
	  min-height: var(--card-meta-min-height);
	}

.collection-meta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--card-badge-min-height);
  font-size: var(--card-badge-font-size);
  font-weight: var(--card-badge-font-weight);
  line-height: var(--card-badge-line-height);
  letter-spacing: var(--text-caption-letter);
  color: var(--card-badge-text);
	  background: var(--card-badge-bg);
	  border: 1px solid var(--card-badge-border);
	  padding: var(--card-badge-pad-y) var(--card-badge-pad-x);
	  border-radius: var(--card-badge-radius);
	  white-space: nowrap;
	  letter-spacing: 0;
	}

	.collection-tags {
	  padding: 0;
	  margin: 0;
	  display: flex;
	  gap: var(--card-tag-gap);
	  flex-wrap: wrap;
	  align-items: center;
	  width: 100%;
	  min-height: var(--card-tags-min-height);
	}

.collection-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--card-tag-min-height);
  font-size: var(--card-tag-font-size);
  font-weight: var(--card-tag-font-weight);
  line-height: var(--card-tag-line-height);
  letter-spacing: var(--text-chip-letter);
  padding: var(--card-tag-pad-y) var(--card-tag-pad-x);
  border-radius: var(--card-tag-radius);
	  border: 1px solid var(--card-tag-border);
	  background: var(--tag-bg, var(--card-tag-bg));
	  color: var(--tag-text, var(--card-tag-text));
	  white-space: nowrap;
	}

		.collection-media {
		  position: relative;
		  display: block;
		  width: 100%;
		  aspect-ratio: var(--card-image-aspect);
		  min-height: var(--card-media-min-height);
		  border-radius: 0;
		  background: var(--card-media-bg);
		  overflow: hidden;
		  margin-bottom: var(--card-media-content-gap);
		  z-index: 1;
		}

.collection-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: var(--card-image-fit);
  object-position: var(--card-image-position);
  z-index: 1;
  transition: transform var(--card-hover-duration) ease;
}

/* Card Hover Contract (Global) */
	.collection-card:hover {
	  z-index: var(--z-index-base);
	  transform: var(--card-hover-transform);
	  box-shadow: var(--card-hover-shadow);
	}

		.collection-card:focus-visible,
		a.collection-card:focus-visible,
		button.collection-card:focus-visible {
		  outline: none;
		  border-color: var(--ring-border, rgba(47, 107, 255, 0.5));
		  box-shadow:
		    var(--card-focus-ring-shadow),
		    var(--card-hover-shadow);
		  transform: var(--card-hover-transform);
		}

  .collection-card:hover .collection-thumb,
  .collection-card:focus-visible .collection-thumb,
  a.collection-card:focus-visible .collection-thumb,
  button.collection-card:focus-visible .collection-thumb {
    transform: scale(1.02);
  }

/* =========================================================
   Wishlist Button (shared)
   Icon-only, no background (Collection + Home)
   ========================================================= */

.wish-btn{
  position: absolute;
  top: var(--card-overlay-inset);
  right: var(--card-overlay-inset);
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--wish-icon-stroke);
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
}

.wish-btn:focus { outline: none; }

/* Match repo-standard keyboard focus ring used by .btn-util/.icon-btn */
.wish-btn:focus-visible{
  outline: none;
  border: 0;
  box-shadow: var(--card-focus-ring-shadow);
}

.wish-btn:hover{
  transform: scale(1.06);
  background: transparent;
}

.wish-btn svg{
  width: var(--wish-icon-size);
  height: var(--wish-icon-size);
  display: block;
  filter: none;
  transition: var(--wish-icon-transition);
}

.wish-btn .heart-icon path{
  fill: none;
  stroke: currentColor;
  stroke-width: var(--wish-icon-stroke-width);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wish-btn:hover svg{
  transform: scale(1.06);
}

.wish-btn.is-active .heart-icon path,
.wish-btn[aria-pressed="true"] .heart-icon path{
  fill: #e11d48;
  stroke: #e11d48;
}

.wish-btn:active{
  transform: scale(0.98);
}

/* Disabled parity: support both native disabled and aria-disabled */
.wish-btn:disabled,
.wish-btn[aria-disabled="true"]{
  opacity: 1;
  color: #94a3b8; /* slate-400 */
  background: #f8fafc; /* slate-50 */
  border-color: #e2e8f0; /* slate-200 */
  cursor: not-allowed;
  pointer-events: none;
}

/* Saved state */
.wish-btn.is-saved{
  color: var(--wish-icon-active);
}

.wish-btn.is-saved .heart-icon path{
  /* Saved: solid red */
  fill: currentColor;
  stroke: currentColor;
}

/* ---------------------------------------------------------
   Auth button states
   --------------------------------------------------------- */

/* spinner */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn-cta.loading .btn-label {
  visibility: hidden;
}

.btn-cta.loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* error message */
.auth-error {
  margin: var(--space-10) var(--space-0) var(--space-6);
  font-size: var(--text-body-size);
  color: #b91c1c;
}


/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  margin-top: 48px;
}

.site-footer .wrap {
  padding-top: 36px;
  padding-bottom: var(--space-24);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: start;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
  text-decoration: none;
  color: inherit;
}

.footer-logo {
  height: 36px;
  width: auto;
}

.footer-tagline {
  font-size: var(--text-body-sm-size);
  font-weight: var(--text-body-sm-weight);
  line-height: var(--text-body-sm-line);
  letter-spacing: var(--text-body-sm-letter);
  color: var(--muted);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.footer-title {
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  line-height: var(--text-label-line);
  letter-spacing: var(--text-label-letter);
  color: rgba(15, 23, 42, 0.9);
  margin-bottom: var(--space-6);
}

.site-footer a {
  font-size: var(--text-body-sm-size);
  font-weight: var(--text-body-sm-weight);
  line-height: var(--text-body-sm-line);
  letter-spacing: var(--text-body-sm-letter);
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: rgba(15, 23, 42, 0.9);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 40px;
  padding-top: var(--space-16);
  border-top: 1px solid var(--border);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);

  font-size: var(--text-caption-size);
  font-weight: var(--text-caption-weight);
  line-height: var(--text-caption-line);
  letter-spacing: var(--text-caption-letter);
  color: var(--muted);
}

.footer-legal-links {
  display: inline-flex;
  gap: var(--space-16);
}

/* Global: show pointer for interactive controls */
:where(
  a[href],
  button,
  [role="button"],
  summary,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  label,
  select
) {
  cursor: pointer;
}

/* Disabled controls should not show pointer */
:where(button, [role="button"], input, select, textarea):disabled,
:where(button, [role="button"])[aria-disabled="true"] {
  cursor: not-allowed;
}


/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1020px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-top { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-search { display: none; }
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .mega-panel { display: none !important; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: 1fr; }
}
/* v4.02 marker */

/* Full-height user area (Lists/Wishlist/etc.) */
.page-user {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-user main {
  flex: 1;
}

/* =========================
   Mobile Header Navigation
   ========================= */

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu {
  position: fixed;
  top: 72px;
  left: 12px;
  right: 12px;
  z-index: 1000;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  padding: 16px;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-link {
  display: block;
  text-decoration: none;
  color: #0f172a;
  font-size: var(--text-body-sm-size);
  font-weight: var(--text-body-sm-weight);
  line-height: var(--text-body-sm-line);
  letter-spacing: var(--text-body-sm-letter);
}

.mobile-divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 4px 0;
}

@media (max-width: 768px) {
  .site-header .wrap {
    height: 60px;
  }

  .nav {
    grid-template-columns: auto 1fr auto;
    gap: var(--space-10);
  }

  .header-left {
    gap: var(--space-10);
  }

  .brand {
    flex: 0 0 auto;
  }

  .header-actions {
    gap: var(--space-10);
  }

  .account-menu-wrap,
  .header-wishlist {
    flex: 0 0 auto;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .category-row {
    gap: 12px;
    padding-right: 28px;
  }

  .category-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .category-bar .wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 1) 72%
    );
  }

  .category-bar .wrap::before {
    content: "\203A";
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
    color: rgba(15, 23, 42, 0.38);
    pointer-events: none;
    z-index: 1;
  }
}

/* Email verification banner */
.verify-banner {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 12px;
}

.verify-banner-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-body-sm-size);
  font-weight: var(--text-body-sm-weight);
  line-height: var(--text-body-sm-line);
  letter-spacing: var(--text-body-sm-letter);
}

.verify-banner-slot {
  margin: 12px 0 8px;
}

.verify-banner-slot[hidden] {
  display: none;
}

.verify-banner--embedded {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.verify-banner--embedded.is-attention {
  animation: verifyBannerPulse 0.9s ease;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.10);
}

/* ---------------------------------------------------------
   Standard embedded verification banner
   Source of truth: collection page
   Used by: collection, app-collection, store, app
   --------------------------------------------------------- */
.verify-banner-slot {
  margin: 12px 0 0;
}

.verify-banner-slot[hidden] {
  display: none;
}

.verify-banner.verify-banner--embedded {
  position: relative;
  z-index: auto;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #0f172a;
  box-shadow: none;
}

.verify-banner.verify-banner--embedded .verify-banner-inner {
  max-width: none;
  margin: 0;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-body-sm-size);
  font-weight: var(--text-body-sm-weight);
  line-height: var(--text-body-sm-line);
  letter-spacing: var(--text-body-sm-letter);
  color: #0f172a;
}

.verify-banner.verify-banner--embedded .btn-util-sm {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .verify-banner.verify-banner--embedded .verify-banner-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@keyframes verifyBannerPulse {
  0% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
  20% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.12);
  }
  45% {
    transform: translateY(0);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10);
  }
  70% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.08);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}
