: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, BlinkMacSystemFont, 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: 34px; }

    #searchBar {
      flex: 1;
      max-width: 420px;
      min-width: 0;
      padding: 10px 16px;
      border-radius: 25px;
      border: 1px solid var(--border);
      background: var(--grey);
      color: var(--text);
      font-size: 14px;
    }

    #searchBar:focus {
      outline: 2px solid var(--gold);
      border-color: transparent;
    }

    .header-actions {
      display: flex;
      gap: 4px;
      align-items: center;
      margin-left: auto;
    }

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

    .cart-count {
      position: absolute;
      top: 0;
      right: 0;
      background: var(--gold);
      color: #000;
      font-size: 11px;
      font-weight: 700;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* 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 25px rgba(0,0,0,0.4);
    }

    #navDrawer.open { right: 0; }

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

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

    #navDrawer .nav-section {
      margin-top: 18px;
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 1px;
      opacity: 0.6;
    }

    /* CATEGORIES */
    .categories-bar {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      scrollbar-width: none;
    }

    .categories-bar::-webkit-scrollbar { display: none; }

    .cat-chip {
      flex-shrink: 0;
      padding: 8px 16px;
      background: var(--grey);
      border-radius: 20px;
      font-size: 13px;
      font-weight: 500;
      text-decoration: none;
      color: var(--text);
      border: 1px solid var(--border);
      cursor: pointer;
    }

    .cat-chip:hover,
    .cat-chip.active {
      background: var(--gold);
      color: #000;
      border-color: var(--gold);
    }

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

    .section-title {
      font-size: 1.35rem;
      margin-bottom: 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .section-title span {
      font-size: 0.85rem;
      opacity: 0.7;
      font-weight: 400;
    }

    #productsGrid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 14px;
    }

    @media (min-width: 640px) {
      #productsGrid { grid-template-columns: repeat(3, 1fr); }
    }

    @media (min-width: 900px) {
      #productsGrid { grid-template-columns: repeat(4, 1fr); }
    }

    .product-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      transition: transform 0.2s, box-shadow 0.2s;
    }

    .product-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    }

    .product-img-link {
      display: block;
      text-decoration: none;
    }

    .product-img {
      width: 100%;
      aspect-ratio: 1/1;
      object-fit: cover;
      background: var(--grey);
    }

    .product-info {
      padding: 12px;
      flex: 1;
      display: flex;
      flex-direction: column;
    }

    .product-name {
      font-size: 0.95rem;
      font-weight: 600;
      margin-bottom: 6px;
      line-height: 1.3;
      color: var(--text);
      text-decoration: none;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

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

    .product-price small {
      font-size: 0.75rem;
      opacity: 0.7;
      font-weight: 400;
      margin-left: 4px;
    }

    .add-btn {
      width: 100%;
      padding: 10px;
      background: var(--gold);
      color: #000;
      border: none;
      border-radius: 8px;
      font-weight: 700;
      font-size: 13px;
      cursor: pointer;
      margin-top: auto;
    }

    .add-btn:active {
      opacity: 0.8;
    }

    .state-box {
      grid-column: 1 / -1;
      text-align: center;
      padding: 60px 20px;
      opacity: 0.7;
    }

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

    footer a { color: var(--gold); text-decoration: none; }

    #backToTop {
      position: fixed;
      bottom: 24px;
      right: 24px;
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: var(--gold);
      color: #000;
      border: none;
      font-size: 20px;
      cursor: pointer;
      display: none;
      z-index: 40;
      box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    }

    #toast {
      position: fixed;
      bottom: 90px;
      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;
      white-space: nowrap;
    }