:root {
      --gold: #FFD700;
      --lemon: #C4FF61;
      --navy: #001F3F;
      --bg: #000000;
      --text: #ffffff;
      --grey: #1a1a1a;
      --card: #111111;
      --border: #333333;
    }

    [data-theme="light"] {
      --bg: #ffffff;
      --text: #001F3F;
      --grey: #f4f4f4;
      --card: #ffffff;
      --border: #e0e0e0;
    }

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

    body {
      font-family: system-ui, -apple-system, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      transition: background 0.3s, color 0.3s;
    }

    /* Header */
    header {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 16px;
      border-bottom: 2px solid var(--gold);
      position: sticky;
      top: 0;
      background: var(--bg);
      z-index: 50;
    }

    header img { height: 32px; }

    #searchBar {
      flex: 1;
      padding: 10px 14px;
      border-radius: 20px;
      border: 1px solid var(--border);
      background: var(--grey);
      color: var(--text);
      font-size: 14px;
    }

    .header-actions {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    .icon-btn {
      background: none;
      border: none;
      font-size: 20px;
      cursor: pointer;
      color: var(--text);
      padding: 6px;
    }

    /* Nav Drawer */
    #navDrawer {
      position: fixed;
      top: 0;
      right: -100%;
      width: 25%;
      min-width: 260px;
      max-width: 320px;
      height: 100vh;
      background: var(--bg);
      border-left: 2px solid var(--gold);
      padding: 24px 20px;
      transition: right 0.3s ease;
      z-index: 100;
      overflow-y: auto;
      box-shadow: -4px 0 20px rgba(0,0,0,0.4);
    }

    #navDrawer.open { right: 0; }

    #navDrawer a {
      display: block;
      padding: 12px 0;
      color: var(--text);
      text-decoration: none;
      font-weight: 500;
      border-bottom: 1px solid var(--border);
    }

    #navDrawer a:hover { color: var(--gold); }

    /* Main */
    main {
      flex: 1;
      padding: 20px 16px;
      max-width: 900px;
      margin: 0 auto;
      width: 100%;
    }

    .product-container {
      display: grid;
      gap: 24px;
    }

    @media (min-width: 700px) {
      .product-container {
        grid-template-columns: 1fr 1fr;
        align-items: start;
      }
    }

    .product-image {
      width: 100%;
      aspect-ratio: 1/1;
      object-fit: cover;
      border-radius: 14px;
      background: var(--grey);
      border: 1px solid var(--border);
    }

    .product-info h1 {
      font-size: 1.5rem;
      margin-bottom: 10px;
      line-height: 1.3;
    }

    .price {
      font-size: 1.6rem;
      font-weight: 700;
      color: var(--gold);
      margin-bottom: 8px;
    }

    .old-price {
      font-size: 1rem;
      opacity: 0.6;
      text-decoration: line-through;
      margin-left: 8px;
    }

    .meta {
      font-size: 0.9rem;
      opacity: 0.8;
      margin-bottom: 16px;
    }

    .seller-badge {
      display: inline-block;
      margin-top: 8px;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
      background: rgba(255, 215, 0, 0.15);
      border: 1px solid var(--gold);
      color: var(--gold);
      text-decoration: none;
    }

    .seller-badge:hover {
      background: rgba(255, 215, 0, 0.28);
    }

    .out-of-stock {
      opacity: 0.55;
      pointer-events: none;
  }

    .description {
      font-size: 0.95rem;
      line-height: 1.6;
      margin-bottom: 24px;
      opacity: 0.9;
    }

    .qty-row {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 20px;
    }

    .qty-row label {
      font-size: 0.9rem;
    }

    .qty-row input {
      width: 70px;
      padding: 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--grey);
      color: var(--text);
      text-align: center;
      font-size: 16px;
    }

    .actions {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    button {
      padding: 14px 20px;
      background: var(--gold);
      color: #000;
      border: none;
      border-radius: 10px;
      font-weight: 700;
      font-size: 15px;
      cursor: pointer;
    }

    button.secondary {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text);
    }

    .state-box {
      text-align: center;
      padding: 60px 20px;
      opacity: 0.8;
    }

    footer {
      text-align: center;
      padding: 18px;
      font-size: 13px;
      border-top: 1px solid var(--border);
      margin-top: auto;
    }

    #backToTop {
      position: fixed;
      bottom: 24px;
      right: 24px;
      width: 46px;
      height: 46px;
      border-radius: 50%;
      background: var(--gold);
      border: none;
      font-size: 20px;
      cursor: pointer;
      display: none;
      z-index: 40;
    }

    #toast {
      position: fixed;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--gold);
      color: #000;
      padding: 12px 24px;
      border-radius: 30px;
      font-weight: 600;
      font-size: 14px;
      display: none;
      z-index: 60;
    }