/**
 * TNM Official Marketplace — Master Stylesheet
 * Strict High-End Editorial Aesthetics • Zero Emojis • Pure Dark Theme
 */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-alt: #F0EDE6;
  --surface-card: #FFFFFF;
  --shell: rgba(26, 23, 18, 0.045);
  --shell-hover: rgba(26, 23, 18, 0.08);
  --ring: rgba(26, 23, 18, 0.09);
  --ring-strong: rgba(26, 23, 18, 0.16);

  --ink: #1A1712;
  --ink-bright: #0F0D0A;
  --muted: #6A6458;
  --faint: #8C8577;

  --red: #D63B29;
  --on-red: #FFFFFF;
  --red-hover: #C4321F;
  --red-ink: #C4321F;
  --red-soft: #FBE3DE;
  --red-glow: rgba(214, 59, 41, 0.25);

  --glass: rgba(255, 255, 255, 0.85);
  --glass-stroke: rgba(26, 23, 18, 0.08);

  --shadow: 0 24px 48px -28px rgba(90, 40, 20, 0.35);
  --shadow-sm: 0 4px 12px rgba(90, 40, 20, 0.08);
  --shadow-md: 0 16px 36px -10px rgba(90, 40, 20, 0.18);
  --shadow-lg: 0 28px 56px -18px rgba(90, 40, 20, 0.28);
  --shadow-red: 0 10px 24px -10px rgba(214, 59, 41, 0.5);

  --display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mark: 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0F0F;
    --surface: #1A1712;
    --surface-alt: #231F19;
    --surface-card: #1D1914;
    --shell: rgba(236, 232, 221, 0.05);
    --shell-hover: rgba(236, 232, 221, 0.08);
    --ring: rgba(236, 232, 221, 0.10);
    --ring-strong: rgba(236, 232, 221, 0.18);

    --ink: #ECE8DD;
    --ink-bright: #FFFFFF;
    --muted: #A8A294;
    --faint: #857F72;

    --red: #D63B29;
    --on-red: #FFFFFF;
    --red-hover: #C0331F;
    --red-ink: #F07361;
    --red-soft: rgba(214, 59, 41, 0.18);
    --red-glow: rgba(214, 59, 41, 0.45);

    --glass: rgba(26, 23, 18, 0.82);
    --glass-stroke: rgba(236, 232, 221, 0.12);

    --shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.85);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 16px 36px -10px rgba(0, 0, 0, 0.65);
    --shadow-lg: 0 30px 60px -15px rgba(0, 0, 0, 0.85);
    --shadow-red: 0 12px 28px -10px rgba(214, 59, 41, 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0F0F0F;
  --surface: #1A1712;
  --surface-alt: #231F19;
  --surface-card: #1D1914;
  --shell: rgba(236, 232, 221, 0.05);
  --shell-hover: rgba(236, 232, 221, 0.08);
  --ring: rgba(236, 232, 221, 0.10);
  --ring-strong: rgba(236, 232, 221, 0.18);

  --ink: #ECE8DD;
  --ink-bright: #FFFFFF;
  --muted: #A8A294;
  --faint: #857F72;

  --red: #D63B29;
  --on-red: #FFFFFF;
  --red-hover: #C0331F;
  --red-ink: #F07361;
  --red-soft: rgba(214, 59, 41, 0.18);
  --red-glow: rgba(214, 59, 41, 0.45);

  --glass: rgba(26, 23, 18, 0.82);
  --glass-stroke: rgba(236, 232, 221, 0.12);

  --shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 16px 36px -10px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 30px 60px -15px rgba(0, 0, 0, 0.85);
  --shadow-red: 0 12px 28px -10px rgba(214, 59, 41, 0.6);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-alt: #F0EDE6;
  --surface-card: #FFFFFF;
  --shell: rgba(26, 23, 18, 0.045);
  --shell-hover: rgba(26, 23, 18, 0.08);
  --ring: rgba(26, 23, 18, 0.09);
  --ring-strong: rgba(26, 23, 18, 0.16);

  --ink: #1A1712;
  --ink-bright: #0F0D0A;
  --muted: #6A6458;
  --faint: #8C8577;

  --red: #D63B29;
  --on-red: #FFFFFF;
  --red-hover: #C4321F;
  --red-ink: #C4321F;
  --red-soft: #FBE3DE;
  --red-glow: rgba(214, 59, 41, 0.25);

  --glass: rgba(255, 255, 255, 0.85);
  --glass-stroke: rgba(26, 23, 18, 0.08);

  --shadow: 0 24px 48px -28px rgba(90, 40, 20, 0.35);
  --shadow-sm: 0 4px 12px rgba(90, 40, 20, 0.08);
  --shadow-md: 0 16px 36px -10px rgba(90, 40, 20, 0.18);
  --shadow-lg: 0 28px 56px -18px rgba(90, 40, 20, 0.28);
  --shadow-red: 0 10px 24px -10px rgba(214, 59, 41, 0.5);
  color-scheme: light;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

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

button, input, select, textarea {
  font-family: inherit;
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Icons Sprite Helper */
.ic {
  display: inline-block;
  width: 18px;
  height: 18px;
  fill: currentColor;
  vertical-align: middle;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Floating Island Navbar
   ------------------------------------------------------------------------- */
.navwrap {
  position: sticky;
  top: 14px;
  z-index: 100;
  padding: 0 16px;
  margin-bottom: 24px;
}
.nav {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px 8px 24px;
  border-radius: var(--radius-full);
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: inset 0 0 0 1px var(--ring), var(--shadow-md);
  min-width: 0;
  position: relative;
  overflow: visible;
}

.mark {
  font-family: var(--mark);
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  letter-spacing: -0.02em;
  color: var(--ink);
  flex-shrink: 0;
  white-space: nowrap;
}
.mark i {
  width: 6px;
  height: 6px;
  background: var(--red);
  display: inline-block;
  margin-bottom: 2px;
}
.mark-sub {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red-ink);
  background: var(--red-soft);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-left: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
}
.links a {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.25s var(--ease);
  flex-shrink: 0;
  white-space: nowrap;
}
.links a:hover, .links a.active {
  background: var(--shell);
  color: var(--ink-bright);
}
.links a.highlight {
  color: var(--red-ink);
}

.navr {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* User & Admin Profile Dropdown Pill */
.nav-user-dropdown {
  position: relative;
  display: inline-flex;
}
.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 6px;
  border-radius: var(--radius-full);
  background: var(--shell);
  box-shadow: inset 0 0 0 1px var(--ring);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.nav-user-btn:hover,
.nav-user-dropdown.active .nav-user-btn {
  background: rgba(214, 59, 41, 0.12);
  box-shadow: inset 0 0 0 1px rgba(214, 59, 41, 0.3);
  color: var(--red-ink);
}
.nav-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-user-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user-btn .chevron {
  width: 11px;
  height: 11px;
  fill: currentColor;
  transition: transform 0.25s var(--ease);
}
.nav-user-dropdown:hover .nav-user-btn .chevron,
.nav-user-dropdown.active .nav-user-btn .chevron {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-radius: 20px;
  padding: 8px;
  box-shadow: inset 0 0 0 1px var(--ring), var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out), visibility 0.2s;
  z-index: 100;
}
.nav-user-dropdown:hover .user-dropdown-menu,
.nav-user-dropdown.active .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-dropdown-head {
  padding: 8px 12px 6px;
}
.user-dropdown-head b {
  display: block;
  font-size: 13px;
  color: var(--ink-bright);
}
.user-dropdown-head span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.user-dropdown-divider {
  height: 1px;
  background: var(--ring);
  margin: 4px 6px;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.user-dropdown-item:hover {
  background: var(--shell);
  color: var(--ink);
}
.user-dropdown-item .ic {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--muted);
}
.user-dropdown-item:hover .ic {
  color: var(--ink-bright);
}
.user-dropdown-item.danger {
  color: #f87171;
}
.user-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.user-dropdown-item.danger .ic {
  color: #ef4444;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-full);
  border: 0;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: var(--shell);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ring);
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.btn:hover {
  background: var(--ring);
  color: var(--ink-bright);
  transform: translateY(-2px);
}
.btn:active {
  transform: scale(0.97);
}
.btn.red {
  background: var(--red);
  color: var(--on-red);
  box-shadow: var(--shadow-red);
}
.btn.red:hover {
  background: var(--red-hover);
  color: var(--on-red);
}
.btn.sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
}
.btn.lg {
  min-height: 52px;
  padding: 0 28px;
  font-size: 15.5px;
}
.btn.ghost {
  background: transparent;
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--shell);
}

/* Cart Trigger Icon & Theme Toggle */
.theme-toggle-btn, .cart-trigger {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--shell);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--ring);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.3s var(--ease);
}
.theme-toggle-btn:hover, .cart-trigger:hover {
  background: var(--ring);
  color: var(--ink-bright);
  transform: scale(1.05);
}
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(214, 59, 41, 0.6);
}

/* Theme Segment Pill (from indexmockup.html) */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-full);
  background: var(--shell);
  box-shadow: inset 0 0 0 1px var(--ring);
}
.seg button {
  border: 0;
  background: transparent;
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.seg button:hover {
  color: var(--ink);
}
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* -------------------------------------------------------------------------
   Hero Studio Banner
   ------------------------------------------------------------------------- */
.shop-hero {
  padding: 32px 0 48px;
}
.shop-hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: radial-gradient(120% 90% at 85% 15%, var(--red-soft), transparent 60%), var(--surface);
  box-shadow: inset 0 0 0 1px var(--ring), var(--shadow-md);
  padding: clamp(32px, 5vw, 64px);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 36px;
}
.shop-hero-card::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
  filter: blur(50px);
  opacity: 0.7;
  pointer-events: none;
}

.shop-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.shop-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--red-soft);
  color: var(--red-ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.shop-hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink-bright);
}
.shop-hero-title span {
  color: var(--red-ink);
}
.shop-hero-desc {
  font-size: clamp(15px, 1.2vw, 17px);
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.6;
}
.shop-hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.shop-hero-visual {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-mockup-frame {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 50%, var(--red-soft) 0%, transparent 68%);
  display: grid;
  place-items: center;
  position: relative;
}
.hero-mockup-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.25));
  animation: float-slow 5s ease-in-out infinite alternate;
}
@keyframes float-slow {
  from { transform: translateY(0px) rotate(0deg); }
  to { transform: translateY(-12px) rotate(1deg); }
}

/* Studio Callout Banner Card */
.studio-callout-card {
  background: radial-gradient(120% 90% at 90% 20%, var(--red-soft), transparent 60%), var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--ring), var(--shadow-md);
  padding: clamp(32px, 4.5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

/* -------------------------------------------------------------------------
   Catalog Banners & Dual Mode Callouts
   ------------------------------------------------------------------------- */
.catalog-banners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.catalog-banner-card {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: all 0.3s var(--ease);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.catalog-banner-card:hover {
  border-color: var(--ring-strong);
  transform: translateY(-2px);
}
.catalog-banner-card.highlight {
  border-color: rgba(214, 59, 41, 0.35);
  background: radial-gradient(120% 120% at 95% 10%, var(--red-soft), var(--surface));
}
.catalog-banner-card.highlight:hover {
  border-color: var(--red);
  box-shadow: 0 8px 24px rgba(214, 59, 41, 0.15);
}
.catalog-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.catalog-banner-icon.ready {
  background: rgba(46, 204, 113, 0.15);
  color: #2ECC71;
}
.catalog-banner-icon.custom {
  background: var(--red-soft);
  color: var(--red-ink);
}
.catalog-banner-info {
  flex: 1;
  min-width: 0;
}
.catalog-banner-info h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-bright);
  margin: 0 0 2px;
}
.catalog-banner-info p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}
.banner-action-btn {
  white-space: nowrap;
  padding: 6px 14px;
  font-size: 12px;
}

/* Catalog Empty Search State */
.catalog-empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px dashed var(--ring-strong);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}
.empty-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--shell);
  color: var(--faint);
  display: inline-grid;
  place-items: center;
}

/* Product Detail Size Pills & Checked State */
.size-radio-input:checked + .size-pill {
  background: var(--red) !important;
  color: #fff !important;
  border-color: var(--red) !important;
  box-shadow: 0 4px 12px rgba(214, 59, 41, 0.4) !important;
}
.size-pill:hover {
  border-color: var(--ring-strong);
  color: var(--ink-bright);
}

/* -------------------------------------------------------------------------
   Category Chips & Filter Controls
   ------------------------------------------------------------------------- */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--ring);
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cat-pill {
  border: 0;
  background: var(--shell);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--ring);
  transition: all 0.25s var(--ease);
}
.cat-pill:hover {
  background: var(--ring);
  color: var(--ink);
}
.cat-pill.active {
  background: var(--surface);
  color: var(--ink-bright);
  box-shadow: inset 0 0 0 1px var(--red), 0 4px 14px rgba(214, 59, 41, 0.25);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-box {
  position: relative;
  width: 220px;
}
.search-input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--ring);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: all 0.25s;
}
.search-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* -------------------------------------------------------------------------
   Product Cards Grid
   ------------------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 64px;
}

.prod-card, .pcard {
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--shell);
  box-shadow: inset 0 0 0 1px var(--ring);
  transition: all 0.35s var(--ease);
  display: flex;
  flex-direction: column;
}
.prod-card:hover, .pcard:hover {
  background: var(--shell-hover);
  box-shadow: inset 0 0 0 1px var(--ring-strong), var(--shadow-md);
  transform: translateY(-5px);
}

.prod-core, .pcard-body {
  background: var(--surface);
  border-radius: calc(var(--radius-lg) - 6px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.prod-thumb, .pcard-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 50% 50%, var(--surface-alt) 0%, var(--shell) 100%);
  border: 1px solid var(--ring);
  overflow: hidden;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.prod-thumb img, .pcard-thumb {
  width: 82%;
  height: 82%;
  object-fit: contain;
  transition: transform 0.5s var(--ease);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
}
.prod-card:hover .prod-thumb img, .pcard:hover .pcard-thumb {
  transform: scale(1.08);
}

.prod-badge, .pcard-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(214, 59, 41, 0.4);
  z-index: 2;
  white-space: nowrap;
}
.prod-badge.custom {
  background: linear-gradient(135deg, #D63B29 0%, #9065B0 100%);
}

.prod-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 6px;
}
.prod-category, .pcard-cat {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}
.prod-title, .pcard-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink-bright);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
  word-break: break-word;
  overflow-wrap: break-word;
  margin: 0;
}
.prod-title a, .pcard-title a {
  color: inherit;
  transition: color 0.2s;
}
.prod-title a:hover, .pcard-title a:hover {
  color: var(--red-ink);
}
.prod-desc-snippet {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
  margin-top: 2px;
}

.prod-foot, .pcard-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--ring);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.prod-price-box {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.prod-price, .pcard-price {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--ink-bright);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.prod-old-price {
  font-size: 11.5px;
  color: var(--faint);
  text-decoration: line-through;
}

/* -------------------------------------------------------------------------
   Slide-Over Cart Drawer
   ------------------------------------------------------------------------- */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s var(--ease);
}
.cart-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  border-left: 1px solid var(--ring);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
}
.cart-backdrop.open .cart-drawer {
  transform: translateX(0);
}

.cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--ring);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-header h3 {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--shell);
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.cart-close-btn:hover {
  background: var(--ring);
  color: var(--ink);
}

.cart-items-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.cart-item {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--shell);
  border: 1px solid var(--ring);
}
.cart-item-thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--ring);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cart-item-thumb img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}
.cart-item-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cart-item-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.cart-item-meta {
  font-size: 12px;
  color: var(--muted);
}
.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.cart-item-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--red-ink);
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ring);
  border-radius: var(--radius-full);
  background: var(--surface);
}
.qty-btn {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
}
.qty-val {
  padding: 0 6px;
  font-size: 12.5px;
  font-weight: 700;
}
.cart-del-btn {
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  padding: 4px;
}
.cart-del-btn:hover {
  color: var(--red);
}

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--ring);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14.5px;
}
.cart-subtotal-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink-bright);
}

/* -------------------------------------------------------------------------
   Toast Notifications
   ------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--ring-strong);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
  animation: toast-in 0.3s var(--ease);
}
.toast.success {
  border-left: 4px solid #2ECC71;
}
.toast.error {
  border-left: 4px solid var(--red);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.shop-footer {
  margin-top: auto;
  border-top: 1px solid var(--ring);
  padding: 48px 0 32px;
  background: var(--surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-bright);
  margin-bottom: 14px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col a {
  color: var(--muted);
  font-size: 13.5px;
  transition: color 0.2s;
}
.footer-col a:hover {
  color: var(--ink);
}
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--ring);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--faint);
  font-size: 12.5px;
}

/* Mobile Navigation Toggle Button */
.mobile-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--shell);
  border: 1px solid var(--ring);
  color: var(--ink);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 0;
  transition: all 0.25s var(--ease);
}
.mobile-nav-toggle:hover {
  background: var(--ring);
  color: var(--ink-bright);
}
.hamburger-bar {
  width: 18px;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: all 0.25s;
}

/* Mobile Menu Backdrop & Drawer */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease);
}
.mobile-menu-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.mobile-menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border-left: 1px solid var(--ring);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.85);
  z-index: 251;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  box-sizing: border-box;
}
.mobile-menu-backdrop.open .mobile-menu-drawer {
  transform: translateX(0);
}
.mobile-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ring);
}
.mobile-menu-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--shell);
  border: 1px solid var(--ring);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}
.mobile-menu-close:hover {
  background: var(--ring);
  color: var(--ink);
}
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.mobile-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--shell);
  border: 1px solid var(--ring);
  color: var(--ink);
  text-decoration: none;
  transition: all 0.2s;
}
.mobile-link:hover, .mobile-link.active {
  background: var(--surface-alt);
  border-color: var(--red);
}
.mobile-link.highlight {
  border-color: rgba(214, 59, 41, 0.4);
  background: rgba(214, 59, 41, 0.08);
}
.mobile-link-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.mobile-link-text b {
  display: block;
  font-size: 14px;
  color: var(--ink-bright);
}
.mobile-link-text small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}
.mobile-menu-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--ring);
}
.mobile-sublink {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
  display: block;
  transition: color 0.2s;
}
.mobile-sublink:hover {
  color: var(--ink-bright);
}

@media (max-width: 1024px) {
  .links {
    display: none !important;
  }
  .nav-admin-btn, .nav-user-dropdown {
    display: none !important;
  }
  .mobile-nav-toggle {
    display: flex !important;
  }
  .nav {
    padding: 6px 14px;
    gap: 10px;
  }
  .mark-sub {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 4px;
  }
  .nav-cta-kustom span {
    display: none;
  }
  .nav-cta-kustom {
    padding: 0 12px;
    min-height: 40px;
  }
  .shop-hero-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 32px 24px;
  }
  .shop-hero-btns {
    justify-content: center;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  /* On mobile <= 768px, hide the topbar CTA button since it's prominently highlighted inside the mobile drawer */
  .nav-cta-kustom {
    display: none !important;
  }
}

@media (max-width: 680px) {
  .wrap {
    padding: 0 16px;
  }
  .navwrap {
    padding: 0 8px;
    top: 8px;
  }
  .shop-hero-card {
    padding: 24px 16px;
    border-radius: var(--radius-md);
  }
  .shop-hero-title {
    font-size: clamp(24px, 6vw, 32px);
    line-height: 1.15;
  }
  .shop-hero-desc {
    font-size: 14px;
    line-height: 1.5;
  }
  .shop-hero-btns {
    flex-direction: column;
    width: 100%;
  }
  .shop-hero-btns .btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
  }

  /* Catalog Banners Stack on Mobile */
  .catalog-banner-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
  .banner-action-btn {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
  }
  
  /* 2-Column Clean Mobile E-Commerce Card Grid */
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .prod-card, .pcard {
    padding: 4px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .prod-core, .pcard-body {
    padding: 10px;
    border-radius: calc(var(--radius-md) - 4px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
  }
  .prod-thumb, .pcard-thumb-wrap {
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    aspect-ratio: 1;
    padding: 8px;
  }
  .prod-badge, .pcard-badge {
    top: 5px;
    left: 5px;
    font-size: 9px;
    padding: 2px 6px;
  }
  .prod-category, .pcard-cat {
    font-size: 10px;
  }
  .prod-title, .pcard-title {
    font-size: 13px !important;
    line-height: 1.35 !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .prod-desc-snippet {
    display: none !important;
  }
  .prod-foot, .pcard-footer {
    margin-top: auto;
    padding-top: 8px;
    gap: 6px;
    flex-direction: column;
    align-items: stretch;
  }
  .prod-price, .pcard-price {
    font-size: 14.5px !important;
    text-align: left;
    font-weight: 800;
  }
  .prod-foot .btn, .pcard-footer .btn {
    width: 100% !important;
    min-height: 38px !important;
    font-size: 12px !important;
    padding: 0 8px !important;
    justify-content: center !important;
    border-radius: var(--radius-full);
  }

  /* Cart Drawer Mobile Full Screen */
  .cart-drawer {
    max-width: 100%;
    border-left: 0;
  }
  .cart-header {
    padding: 16px 18px;
  }
  .cart-items-list {
    padding: 16px 18px;
  }
  .cart-footer {
    padding: 16px 18px;
  }
  .qty-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  /* Form Inputs on Mobile (Prevents iOS Safari auto-zoom) */
  .search-input, .form-control, .form-input, input, select, textarea {
    font-size: 16px !important;
  }

  /* Value Props Stack on Mobile */
  .market-value-props {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .market-value-props > div {
    padding: 14px 16px !important;
  }

  /* Category Toolbar on Mobile */
  .shop-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 0;
    margin-bottom: 16px;
  }
  .category-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    width: 100%;
  }
  .category-tabs::-webkit-scrollbar {
    display: none;
  }
  .cat-pill {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 12.5px;
  }
  .search-box {
    width: 100%;
  }

  /* Footer Mobile */
  .shop-footer {
    padding: 36px 0 24px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .mark-sub {
    display: none !important;
  }
  .nav {
    padding: 6px 10px;
    gap: 8px;
  }
  .theme-toggle-btn, .cart-trigger, .mobile-nav-toggle {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 360px) {
  .wrap {
    padding: 0 12px;
  }
  .product-grid {
    grid-template-columns: 1fr !important;
  }
  .prod-title, .pcard-title {
    font-size: 14px;
  }
}
