  :root{
    --header-dark:#131921;
    --header-darker:#0f1420;
    --nav-dark:#232f3e;
    --accent:#febd69;
    --accent-dark:#f3a847;
    --link-blue:#007185;
    --price-red:#b12704;
    --bg:#eaeded;
    --card-bg:#ffffff;
    --border:#d5d9d9;
    --text:#0f1111;
    --text-light:#565959;
  }
  *{box-sizing:border-box;}
  body{
    margin:0;
    font-family:Arial, Helvetica, sans-serif;
    background:var(--bg);
    color:var(--text);
  }
  a{ text-decoration:none; color:inherit; }
  button{ font-family:inherit; cursor:pointer; }

  /* ---------- Header ---------- */
  header.top{
    background:var(--header-dark);
    color:#fff;
    display:flex;
    align-items:center;
    gap:16px;
    padding:10px 16px;
  }
  .logo{
    font-size:24px;
    font-weight:700;
    letter-spacing:0.5px;
    padding:8px 6px;
    border:1px solid transparent;
    border-radius:2px;
    white-space:nowrap;
  }
  .logo span{ color:var(--accent); }
  .logo:hover{ border-color:#fff; }

  .deliver{
    display:flex;
    flex-direction:column;
    font-size:12px;
    padding:8px 6px;
    border:1px solid transparent;
    border-radius:2px;
    cursor:pointer;
  }
  .deliver:hover{ border-color:#fff; }
  .deliver b{ font-size:14px; }

  .search-bar{
    flex:1;
    display:flex;
    height:40px;
    border-radius:4px;
    overflow:hidden;
  }
  .search-select{
    background:#f3f3f3;
    border:none;
    padding:0 8px;
    font-size:12px;
    color:#555;
    border-right:1px solid #cdcdcd;
  }
  .search-input{
    flex:1;
    border:none;
    padding:0 10px;
    font-size:15px;
    outline:none;
  }
  .search-btn{
    width:45px;
    background:var(--accent);
    border:none;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  .search-btn:hover{ background:var(--accent-dark); }
  .search-btn svg{ width:18px; height:18px; }

  .account, .orders, .cart{
    display:flex;
    flex-direction:column;
    font-size:12px;
    padding:8px 10px;
    border:1px solid transparent;
    border-radius:2px;
    white-space:nowrap;
  }
  .account b, .orders b{ font-size:14px; }
  .account:hover, .orders:hover, .cart:hover{ border-color:#fff; }

  .cart{
    flex-direction:row;
    align-items:flex-end;
    gap:4px;
    position:relative;
    background:none;
    border:none;
    color:#fff;
    font-size:13px;
  }
  .cart-count{
    color:var(--accent);
    font-weight:700;
    font-size:20px;
    margin-right:2px;
  }
  .cart svg{ width:32px; height:32px; }

  /* ---------- Sub nav ---------- */
  nav.sub{
    background:var(--nav-dark);
    color:#fff;
    display:flex;
    align-items:center;
    gap:18px;
    padding:8px 16px;
    font-size:14px;
    overflow-x:auto;
  }
  nav.sub a{ padding:4px 6px; border:1px solid transparent; border-radius:2px; white-space:nowrap; }
  nav.sub a:hover{ border-color:#fff; }
  nav.sub .all{ font-weight:700; display:flex; align-items:center; gap:6px; }

  /* ---------- Hero ---------- */
  .hero{
    background:linear-gradient(180deg,#3a4553 0%, var(--bg) 60%);
    padding:0 0 24px;
  }
  .hero-banner{
    max-width:1500px;
    margin:0 auto;
    padding:20px 24px 0;
    color:#fff;
  }
  .hero-banner h1{
    font-size:32px;
    margin:0 0 6px;
  }
  .hero-banner p{
    margin:0;
    color:#d9dde1;
    font-size:15px;
  }

  .hero-cards{
    max-width:1500px;
    margin:20px auto 0;
    padding:0 24px;
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(220px,1fr));
    gap:16px;
  }
  .promo-card{
    background:var(--card-bg);
    border-radius:4px;
    padding:18px;
    box-shadow:0 2px 4px rgba(0,0,0,0.08);
  }
  .promo-card h3{ margin:0 0 10px; font-size:17px; }
  .promo-card .promo-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .promo-card img{ width:100%; height:70px; object-fit:cover; border-radius:2px; }
  .promo-card .see-more{
    display:inline-block;
    margin-top:12px;
    color:var(--link-blue);
    font-size:13px;
  }
  .promo-card .see-more:hover{ color:var(--price-red); text-decoration:underline; }

  /* ---------- Main content ---------- */
  main{
    max-width:1500px;
    margin:-8px auto 0;
    padding:0 24px 40px;
  }

  .toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:10px;
    background:var(--card-bg);
    border-radius:4px;
    padding:14px 18px;
    margin-bottom:18px;
    box-shadow:0 2px 4px rgba(0,0,0,0.06);
  }
  .toolbar h2{ margin:0; font-size:20px; }
  .toolbar .result-count{ font-size:13px; color:var(--text-light); }
  .toolbar .sort{ font-size:13px; }
  .toolbar select{
    padding:6px 8px;
    border:1px solid var(--border);
    border-radius:4px;
    background:#fff;
  }

  .category-chips{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:18px;
  }
  .chip{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:6px 14px;
    font-size:13px;
    color:var(--text);
  }
  .chip.active{
    background:var(--nav-dark);
    color:#fff;
    border-color:var(--nav-dark);
  }
  .chip:hover{ border-color:var(--text-light); }

  .grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(230px,1fr));
    gap:16px;
  }

  .card{
    background:var(--card-bg);
    border-radius:6px;
    padding:16px;
    display:flex;
    flex-direction:column;
    box-shadow:0 2px 4px rgba(0,0,0,0.06);
  }
  .card img{
    width:100%;
    height:170px;
    object-fit:cover;
    border-radius:4px;
    margin-bottom:10px;
    background:#f4f4f4;
  }
  .card .title{
    font-size:14px;
    line-height:1.35;
    height:38px;
    overflow:hidden;
    margin-bottom:6px;
  }
  .card .title:hover{ color:var(--price-red); cursor:pointer; }
  .card .rating{
    display:flex;
    align-items:center;
    gap:6px;
    font-size:12px;
    color:var(--text-light);
    margin-bottom:6px;
  }
  .stars{ color:var(--accent-dark); letter-spacing:1px; }
  .card .price{
    font-size:20px;
    color:var(--price-red);
    margin-bottom:2px;
  }
  .card .price sup{ font-size:12px; top:-0.7em; }
  .card .prime{
    font-size:11px;
    color:var(--text-light);
    margin-bottom:10px;
  }
  .card .badge{
    display:inline-block;
    background:#cc0c39;
    color:#fff;
    font-size:11px;
    font-weight:700;
    padding:2px 6px;
    border-radius:2px;
    margin-bottom:8px;
    width:fit-content;
  }
  .card .spacer{ flex:1; }
  .card .btn-row{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:8px;
  }
  .btn{
    border:1px solid #a88734;
    border-radius:20px;
    padding:8px 10px;
    font-size:13px;
    background:linear-gradient(to bottom,#f7dfa5,#f0c14b);
    color:#111;
  }
  .btn:hover{ background:linear-gradient(to bottom,#f5d78e,#eeb933); }
  .btn.buy-now{
    border-color:#a34b0c;
    background:linear-gradient(to bottom,#ffb98c,#ff9147);
  }
  .btn.buy-now:hover{ background:linear-gradient(to bottom,#ffab72,#f78331); }

  .no-results{
    grid-column:1/-1;
    text-align:center;
    padding:60px 20px;
    color:var(--text-light);
  }
  .no-results h3{ color:var(--text); font-size:20px; }

  /* ---------- Cart drawer ---------- */
  .overlay{
    position:fixed; inset:0;
    background:rgba(0,0,0,0.4);
    opacity:0; pointer-events:none;
    transition:opacity 0.2s ease;
    z-index:40;
  }
  .overlay.open{ opacity:1; pointer-events:auto; }

  .drawer{
    position:fixed;
    top:0; right:0;
    width:380px; max-width:92vw;
    height:100%;
    background:#fff;
    box-shadow:-4px 0 16px rgba(0,0,0,0.2);
    transform:translateX(100%);
    transition:transform 0.25s ease;
    z-index:50;
    display:flex;
    flex-direction:column;
  }
  .drawer.open{ transform:translateX(0); }
  .drawer-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:16px 18px;
    border-bottom:1px solid var(--border);
  }
  .drawer-header h2{ margin:0; font-size:19px; }
  .drawer-header button{
    background:none; border:none; font-size:22px; color:var(--text-light);
  }
  .drawer-items{
    flex:1;
    overflow-y:auto;
    padding:10px 18px;
  }
  .drawer-empty{
    text-align:center;
    color:var(--text-light);
    padding:60px 10px;
  }
  .cart-item{
    display:flex;
    gap:12px;
    padding:14px 0;
    border-bottom:1px solid #f0f0f0;
  }
  .cart-item img{
    width:64px; height:64px; object-fit:cover; border-radius:4px; background:#f4f4f4;
  }
  .cart-item .info{ flex:1; }
  .cart-item .info .name{ font-size:13px; margin-bottom:6px; }
  .cart-item .info .price{ color:var(--price-red); font-weight:700; font-size:14px; }
  .qty-row{
    display:flex; align-items:center; gap:8px; margin-top:8px;
  }
  .qty-row button{
    width:24px; height:24px;
    border:1px solid var(--border);
    background:#f7f7f7;
    border-radius:4px;
    font-size:14px;
    line-height:1;
  }
  .qty-row .remove{
    border:none; background:none;
    color:var(--link-blue);
    font-size:12px;
    margin-left:auto;
  }
  .qty-row .remove:hover{ color:var(--price-red); text-decoration:underline; }

  .drawer-footer{
    border-top:1px solid var(--border);
    padding:16px 18px;
  }
  .drawer-footer .subtotal{
    display:flex; justify-content:space-between;
    font-size:16px; margin-bottom:12px;
  }
  .drawer-footer .subtotal b{ color:var(--price-red); }
  .checkout-btn{
    width:100%;
    padding:12px;
    border-radius:20px;
    border:1px solid #a34b0c;
    background:linear-gradient(to bottom,#ffb98c,#ff9147);
    font-size:14px;
    font-weight:600;
  }
  .checkout-btn:hover{ background:linear-gradient(to bottom,#ffab72,#f78331); }

  /* ---------- Confirmation ---------- */
  .confirm-box{
    text-align:center;
    padding:40px 20px;
  }
  .confirm-box .check{
    width:56px; height:56px;
    border-radius:50%;
    background:#067d62;
    color:#fff;
    display:flex; align-items:center; justify-content:center;
    font-size:30px;
    margin:0 auto 16px;
  }
  .confirm-box h3{ margin:0 0 8px; }
  .confirm-box p{ color:var(--text-light); font-size:14px; margin:0 0 18px; }
  .confirm-box .order-id{ font-size:13px; color:var(--text-light); margin-bottom:20px; }
  .continue-btn{
    padding:10px 20px;
    border-radius:20px;
    border:1px solid #888c8c;
    background:#f7f7f7;
  }
  .continue-btn:hover{ background:#eee; }

  .toast{
    position:fixed;
    bottom:24px; left:50%;
    transform:translateX(-50%) translateY(20px);
    background:#0f1111;
    color:#fff;
    padding:10px 18px;
    border-radius:6px;
    font-size:13px;
    opacity:0;
    pointer-events:none;
    transition:all 0.25s ease;
    z-index:60;
  }
  .toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

  footer{
    background:var(--nav-dark);
    color:#fff;
    margin-top:40px;
  }
  .back-to-top{
    text-align:center;
    background:#37475a;
    padding:14px;
    font-size:13px;
    cursor:pointer;
  }
  .back-to-top:hover{ background:#3f5166; }
  .footer-cols{
    max-width:1000px;
    margin:0 auto;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
    gap:20px;
    padding:32px 24px;
  }
  .footer-cols h4{ font-size:14px; margin:0 0 10px; }
  .footer-cols a{ display:block; font-size:12px; color:#ddd; padding:3px 0; }
  .footer-cols a:hover{ text-decoration:underline; }
  .footer-bottom{
    text-align:center;
    font-size:12px;
    color:#aaa;
    padding:16px;
    border-top:1px solid #3a4553;
  }

  @media (max-width:700px){
    header.top{ flex-wrap:wrap; }
    .search-bar{ order:3; width:100%; flex-basis:100%; }
    .deliver{ display:none; }
  }
