
  :root {
    --store-name: "Packistan";
    --accent: #1a1a1a;
    --accent-hover: #333;
    --bg: #fefefe;
    --card-bg: #fff;
    --sidebar-bg: #1a1a1a;
    --sidebar-text: #fff;
    --sidebar-active: #fff;
    --sidebar-active-bg: #333;
    --font: 'Inter', system-ui, sans-serif;
    --font-display: 'Bebas Neue', 'Inter', system-ui, sans-serif;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: var(--font); background: var(--bg); color: #222; }
  img { display: block; max-width: 100%; }

  /* ── LAYOUT ── */
  .layout { display: flex; min-height: 100vh; }

  /* ── SIDEBAR ── */
  .sidebar {
    width: 200px; min-width: 200px; background: var(--sidebar-bg);
    color: var(--sidebar-text); padding: 24px 0;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    z-index: 10;
  }
  .sidebar-logo {
    font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1); letter-spacing: 0.03em; text-transform: uppercase;
  }
  .sidebar-logo img {
    max-width: 220px; max-height: 130px; object-fit: contain;
    margin-bottom: 8px; display: block;
  }
  .sidebar-cats { padding-top: 12px; }
  .sidebar-cat {
    display: block; width: 100%; text-align: left; background: none;
    border: none; color: var(--sidebar-text); padding: 10px 20px;
    cursor: pointer; font-size: 0.88rem; font-weight: 500;
    transition: background 0.15s; border-left: 3px solid transparent;
  }
  .sidebar-cat:hover { background: rgba(255,255,255,0.08); }
  .sidebar-cat.active { background: var(--sidebar-active-bg); border-left-color: #fff; font-weight: 700; }
  .sidebar-count { font-size: 0.72rem; opacity: 0.5; margin-left: 6px; }

  /* ── MAIN ── */
  .main { flex: 1; padding: 32px 28px; overflow: auto; }
  .main-header { margin-bottom: 28px; }
  .main-header h1 { font-family: var(--font-display); font-size: 2.4rem; font-weight: 400; letter-spacing: 0.03em; text-transform: uppercase; }
  .main-header p { color: #666; font-size: 0.9rem; margin-top: 4px; }

  /* ── CATEGORY SECTION ── */
  .cat-section { margin-bottom: 40px; }
  .cat-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; letter-spacing: 0.03em; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #e5e5e5; text-transform: uppercase; }

  /* ── GRID ── */
  .product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

  /* ── CARD ── */
  .card {
    background: var(--card-bg); border-radius: 12px; overflow: hidden;
    cursor: pointer; transition: transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  }
  .card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
  .card-thumb {
    width: 100%; aspect-ratio: 1; background: #e8e8e8;
    position: relative; overflow: hidden;
  }
  .card-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .card-thumb-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; flex-direction: column; gap: 8px;
    background: #f0f0f0; color: #999;
  }
  .card-thumb-placeholder span { font-size: 2rem; }
  .card-thumb-placeholder p { font-size: 0.75rem; text-align: center; padding: 0 8px; }
  .play-badge {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    background: rgba(0,0,0,0.6); border-radius: 50%; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem;
    pointer-events: none;
  }
  .card-price-badge {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0,0,0,0.75); color: #fff;
    padding: 4px 9px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 700;
    pointer-events: none;
  }
  .card-info { padding: 12px 14px 14px; }
  .card-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 400; letter-spacing: 0.01em; line-height: 1.25; }
  .card-sub { font-size: 0.75rem; color: #888; margin-top: 3px; }

  /* ── MODAL ── */
  .modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75);
    z-index: 100; align-items: center; justify-content: center; padding: 20px;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: #fff; border-radius: 16px; width: 100%; max-width: 500px;
    max-height: 90vh; overflow-y: auto; position: relative;
  }
  .modal-close {
    position: absolute; top: 14px; right: 14px; background: rgba(0,0,0,0.65);
    border: none; border-radius: 50%; width: 34px; height: 34px; cursor: pointer;
    font-size: 1.2rem; color: #fff; display: flex; align-items: center; justify-content: center;
    z-index: 999; transition: background 0.15s; box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transform: translateZ(0); will-change: transform;
  }
  .modal-close:hover { background: rgba(0,0,0,0.85); }

  /* ── MODAL MEDIA ── */
  .modal-main-media {
    width: 100%; aspect-ratio: 16/9; background: #000;
    border-radius: 16px 16px 0 0; overflow: hidden; position: relative;
    cursor: pointer; isolation: isolate;
  }
  /* Full-screen video mode */
  .modal.fullscreen-video .modal-main-media {
    position: fixed; inset: 0; width: 100vw; height: 100vh;
    aspect-ratio: unset; border-radius: 0; z-index: 200;
  }
  .modal.fullscreen-video .modal-thumbs,
  .modal.fullscreen-video .modal-info,
  .modal.fullscreen-video .contact-btns,
  .modal.fullscreen-video .modal-close { display: none; }
  .fullscreen-exit {
    display: none; position: fixed; top: 16px; right: 16px;
    background: rgba(0,0,0,0.6); color: #fff; border: none;
    border-radius: 8px; padding: 8px 14px; font-size: 0.9rem;
    cursor: pointer; z-index: 201;
  }
  .modal.fullscreen-video ~ .fullscreen-exit { display: block; }
  .modal-main-media img { width: 100%; height: 100%; object-fit: contain; background: #111; cursor: zoom-in; }
  .modal-main-media iframe { width: 100%; height: 100%; border: none; }
  /* Media nav arrows */
  .media-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 15; background: rgba(0,0,0,0.5); color: #fff;
    border: none; border-radius: 50%; width: 40px; height: 40px;
    font-size: 1.2rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    backdrop-filter: blur(4px); transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .media-nav:hover, .media-nav:active { background: rgba(0,0,0,0.8); }
  .media-nav.prev { left: 8px; }
  .media-nav.next { right: 8px; }
  .media-nav:disabled { opacity: 0; pointer-events: none; }

  .fs-btn {
    position: absolute; bottom: 10px; right: 10px; z-index: 10;
    background: rgba(0,0,0,0.55); color: #fff; border: none;
    border-radius: 8px; padding: 6px 10px; font-size: 1rem;
    cursor: pointer; line-height: 1; transition: background 0.15s;
    backdrop-filter: blur(4px);
  }
  .fs-btn:hover { background: rgba(0,0,0,0.8); }
  /* Full-screen image overlay */
  .img-fullscreen-overlay {
    display: none; position: fixed; inset: 0; background: #000;
    z-index: 300; align-items: center; justify-content: center;
    cursor: zoom-out;
  }
  .img-fullscreen-overlay.open { display: flex; }
  .img-fullscreen-overlay img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
  .img-fs-close {
    position: fixed; top: 16px; right: 16px; background: rgba(255,255,255,0.15);
    border: none; color: #fff; border-radius: 8px; padding: 8px 14px;
    font-size: 0.9rem; cursor: pointer; z-index: 301; backdrop-filter: blur(4px);
  }
  .img-fs-nav {
    position: fixed; top: 50%; transform: translateY(-50%); z-index: 302;
    background: rgba(255,255,255,0.15); color: #fff; border: none;
    border-radius: 50%; width: 48px; height: 48px; font-size: 1.4rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .img-fs-nav:hover, .img-fs-nav:active { background: rgba(255,255,255,0.3); }
  .img-fs-nav.prev { left: 12px; }
  .img-fs-nav.next { right: 12px; }
  .modal-main-media .placeholder-full {
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; background: #1a1a1a; color: #555; font-size: 3rem;
  }

  .modal-thumbs { display: flex; gap: 10px; padding: 12px 16px; overflow-x: auto; }
  .thumb-item {
    width: 64px; height: 64px; border-radius: 8px; overflow: hidden;
    cursor: pointer; flex-shrink: 0; border: 2px solid transparent;
    position: relative; background: #e8e8e8;
    transition: border-color 0.15s;
  }
  .thumb-item.active { border-color: var(--accent); }
  .thumb-item img { width: 100%; height: 100%; object-fit: cover; }
  .thumb-play {
    position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: center; background: rgba(0,0,0,0.45); color: #fff; font-size: 1.2rem;
  }

  .modal-info { padding: 14px 16px 8px; }
  .modal-name { font-size: 1.1rem; font-weight: 700; }
  .modal-cat { font-size: 0.8rem; color: #888; margin-top: 3px; }

  /* ── CONTACT BUTTONS ── */
  .modal-description {
    padding: 0 16px 14px; font-size: 0.88rem; color: #555; line-height: 1.6;
    border-bottom: 1px solid #f0f0f0; margin-bottom: 4px;
  }
  .contact-btns { padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 10px; }
  .contact-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 13px 20px; border-radius: 50px; font-size: 0.9rem; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer; transition: opacity 0.15s;
  }
  .contact-btn:hover { opacity: 0.88; }
  .btn-whatsapp { background: #25D366; color: #fff; }
  .btn-telegram { background: #229ED9; color: #fff; }
  .btn-custom { background: #555; color: #fff; }
  .contact-btn-icon { font-size: 1.2rem; }

  /* ── MOBILE ── */
  .mobile-header {
    display: none; background: var(--sidebar-bg); color: #fff;
    padding: 14px 16px;
  }
  .mobile-header h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; letter-spacing: 0.03em; text-transform: uppercase; }
  #mobile-logo-img img { max-height: 70px; max-width: 200px; object-fit: contain; }
  .cat-pills {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 6px; margin-top: 10px;
  }
  .cat-pill {
    background: rgba(255,255,255,0.12); border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 8px; color: rgba(255,255,255,0.8); font-size: 0.72rem;
    font-weight: 500; padding: 7px 4px; text-align: center; cursor: pointer;
    transition: all 0.15s; line-height: 1.2; word-break: break-word;
    user-select: none;
  }
  .cat-pill:active { transform: scale(0.96); }
  .cat-pill.active {
    background: #fff; border-color: #fff; color: #1a1a1a; font-weight: 700;
  }

  /* Mobile swipe rows */
  .swipe-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .swipe-row::-webkit-scrollbar { height: 0; }
  .swipe-row .card { min-width: calc(50% - 7px); scroll-snap-align: start; }

  @media (max-width: 768px) {
    .sidebar { display: none; }
    .mobile-header { display: block; }
    .main { padding: 16px; }
    .product-grid { display: none; }
    .swipe-row { display: flex; }
    /* When category filtered on mobile: 2-col grid, no swipe */
    .filtered-grid { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 14px; overflow-x: visible !important; scroll-snap-type: none !important; }
    .filtered-grid .card { min-width: unset !important; scroll-snap-align: none !important; }
    .main-header { display: none; }
    .cat-title { font-size: 1.3rem; margin-bottom: 12px; }
  }
  @media (min-width: 769px) {
    .mobile-header { display: none; }
    .swipe-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; overflow-x: visible; }
    .swipe-row .card { min-width: unset; }
    .filtered-grid { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 18px; overflow-x: visible !important; }
    .filtered-grid .card { min-width: unset !important; }
  }


  .pw-gate {
    display: none; position: fixed; inset: 0; background: var(--sidebar-bg);
    z-index: 1000; align-items: center; justify-content: center;
  }
  .pw-gate.open { display: flex; }
  .pw-box {
    background: #fefefe; border-radius: 16px; padding: 36px 24px;
    width: 100%; max-width: 440px; text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  }
  .pw-logo { max-height: 220px; width: 100%; object-fit: contain; margin: 0 auto 20px; display: block; }
  .pw-title { font-family: var(--font-display); font-size: 1.9rem; font-weight: 400; letter-spacing: 0.03em; text-transform: uppercase; color: #1a1a1a; margin-bottom: 6px; }
  .pw-subtitle { font-size: 0.88rem; color: #888; margin-bottom: 24px; }
  .pw-input {
    width: 100%; padding: 12px 16px; border: 1.5px solid #ddd; border-radius: 10px;
    font-size: 1rem; text-align: center; letter-spacing: 0.1em;
    outline: none; margin-bottom: 12px; transition: border-color 0.2s;
  }
  .pw-input:focus { border-color: #1a1a1a; }
  .pw-btn {
    width: 100%; padding: 12px; background: #1a1a1a; color: #fff;
    border: none; border-radius: 10px; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: background 0.15s;
  }
  .pw-btn:hover { background: #333; }
  .pw-error { color: #e53e3e; font-size: 0.85rem; margin-top: 10px; min-height: 20px; }

  .age-gate-btns { display: flex; gap: 10px; }
  .age-gate-btns .pw-btn { width: auto; flex: 1; }
  .age-no-btn { background: #eee; color: #444; }
  .age-no-btn:hover { background: #e0e0e0; }

  /* Loading */
  .loading { text-align: center; padding: 60px 20px; color: #888; font-size: 1rem; }
  .spinner {
    width: 36px; height: 36px; border: 4px solid #e0e0e0;
    border-top-color: #333; border-radius: 50%; animation: spin 0.7s linear infinite;
    margin: 0 auto 16px;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ── CART ICON / BADGE ── */
  .cart-icon-btn {
    position: relative; background: none; border: none; cursor: pointer;
    color: inherit; font-size: 1.3rem; padding: 6px; display: inline-flex;
    align-items: center; justify-content: center;
  }
  .cart-badge {
    position: absolute; top: -2px; right: -2px; background: var(--accent);
    color: #fff; font-size: 0.65rem; font-weight: 700; min-width: 16px; height: 16px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    padding: 0 3px; border: 2px solid #fff;
  }
  .sidebar .cart-icon-btn { position: absolute; top: 22px; right: 16px; color: #fff; }
  .sidebar .cart-badge { border-color: var(--sidebar-bg); }
  .mobile-header .cart-icon-btn { color: #1a1a1a; flex-shrink: 0; }
  .mobile-header .cart-badge { border-color: #fefefe; }

  /* ── ADD TO CART BUTTON ── */
  .add-cart-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 13px 20px; border-radius: 50px; font-size: 0.9rem;
    font-weight: 600; border: none; cursor: pointer; transition: opacity 0.15s;
    background: var(--accent); color: #fff; margin-bottom: 4px;
  }
  .add-cart-btn:hover { opacity: 0.88; }
  .add-cart-btn.in-cart { background: #2f9e57; }

  /* ── CART DRAWER / CHECKOUT MODALS ── */
  .flow-header {
    padding: 18px 20px; border-bottom: 1px solid #f0f0f0;
    display: flex; align-items: center; justify-content: space-between;
  }
  .flow-header h3 { font-size: 1.15rem; font-weight: 700; }
  .flow-body { padding: 16px 20px; max-height: 55vh; overflow-y: auto; }
  .flow-footer { padding: 16px 20px; border-top: 1px solid #f0f0f0; }

  .cart-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
  }
  .cart-row-thumb {
    width: 52px; height: 52px; border-radius: 8px; background: #eee;
    overflow: hidden; flex-shrink: 0;
  }
  .cart-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .cart-row-info { flex: 1; min-width: 0; }
  .cart-row-name { font-size: 0.88rem; font-weight: 600; }
  .cart-row-qty { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
  .qty-btn {
    width: 24px; height: 24px; border-radius: 50%; border: 1px solid #ddd;
    background: #fff; cursor: pointer; font-size: 0.9rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
  }
  .qty-btn:hover { background: #f5f5f5; }
  .cart-row-remove {
    background: none; border: none; color: #c0392b; cursor: pointer;
    font-size: 1.1rem; padding: 4px; flex-shrink: 0;
  }
  .cart-row-price { font-size: 0.85rem; font-weight: 600; color: #333; white-space: nowrap; margin-right: 4px; }
  .cart-total-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0 4px; margin-top: 6px; border-top: 2px solid #eee;
    font-weight: 700; font-size: 1.05rem;
  }
  .cart-empty { text-align: center; padding: 40px 20px; color: #999; }

  .form-field { margin-bottom: 14px; }
  .form-field label {
    display: block; font-size: 0.75rem; font-weight: 600; color: #666;
    text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px;
  }
  .form-field input {
    width: 100%; padding: 11px 14px; border: 1.5px solid #ddd; border-radius: 8px;
    font-size: 0.92rem; outline: none; transition: border-color 0.15s;
  }
  .form-field input:focus { border-color: var(--accent); }
  .form-row { display: flex; gap: 10px; }
  .form-row .form-field { flex: 1; }
  .form-note { font-size: 0.75rem; color: #999; text-align: center; margin-top: 10px; line-height: 1.5; }

  .flow-btn {
    width: 100%; padding: 13px; border-radius: 10px; font-size: 0.92rem;
    font-weight: 600; border: none; cursor: pointer; transition: opacity 0.15s, background 0.15s;
  }
  .flow-btn:hover { opacity: 0.9; }
  .flow-btn-primary { background: var(--accent); color: #fff; }
  .flow-btn-secondary { background: #f0f0f0; color: #333; }
  .flow-btn-row { display: flex; gap: 10px; }
  .flow-btn-row .flow-btn { flex: 1; }

  .order-summary-box {
    background: #f9f9f9; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
    font-size: 0.85rem; color: #444; line-height: 1.7; white-space: pre-wrap;
  }
  .send-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 13px 20px; border-radius: 50px; font-size: 0.9rem;
    font-weight: 600; border: none; cursor: pointer; transition: opacity 0.15s;
    color: #fff; margin-bottom: 10px; text-decoration: none;
  }
  .send-btn:hover { opacity: 0.88; }
  .send-copy { background: #555; }
  .send-telegram { background: #229ED9; }
  .send-signal { background: #3A76F0; }
  .send-sms { background: #34C759; }
  .send-clear { background: none; color: #c0392b; text-decoration: underline; font-size: 0.82rem; }


* { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.card { border-radius: 14px; }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.14); }
.modal { border-radius: 20px; }
.contact-btn, .add-cart-btn, .flow-btn, .send-btn { border-radius: 14px; }


.sticky-top-wrap {
  position: sticky; top: 0; z-index: 60;
}
.marquee-bar {
  background: var(--accent); color: #fff;
  overflow: hidden; white-space: nowrap;
  padding: 10px 0;
}
.marquee-track {
  display: inline-block;
  padding-left: 100%;
  animation: marquee-scroll 22s linear infinite;
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase;
}
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}


.promo-carousel { margin-bottom: 24px; }
.promo-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.promo-title { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; letter-spacing: 0.03em; text-transform: uppercase; }
.promo-controls { display: flex; gap: 6px; }
.promo-ctrl-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  font-size: 0.85rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s;
}
.promo-ctrl-btn:hover { opacity: 0.8; }

.promo-viewport { overflow: hidden; }
.promo-carousel-track {
  display: flex; gap: 12px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.promo-slide {
  flex: 0 0 160px;
  cursor: pointer;
}
.promo-slide-img {
  width: 100%; height: 110px; border-radius: 12px;
  background-size: cover; background-position: center;
  margin-bottom: 6px;
}
.promo-slide-label {
  font-size: 0.8rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 768px) {
  .promo-slide { flex: 0 0 120px; }
  .promo-slide-img { height: 90px; }
}


@media (max-width: 768px) {
  body { background: #1a1a1a; color: #eee; }


  .modal, .card { color: #1a1a1a; }

  .mobile-header { background: #fefefe; color: #1a1a1a; }

  .cat-pill {
    background: rgba(26,26,26,0.06); border: 1.5px solid rgba(26,26,26,0.15);
    color: rgba(26,26,26,0.75);
  }
  .cat-pill.active { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }

  .cat-title { color: #eee; border-bottom-color: rgba(255,255,255,0.15); }
  .card { background: var(--card-bg); } /* cards stay white regardless of page bg */
  .loading { color: #999; }
}
