/* ══════════════════════════════════════════════
   NEXARA — RESPONSIVE STYLES
   Breakpoints:
     xs  : < 400px   (small phones)
     sm  : < 600px   (phones)
     md  : < 900px   (tablets / landscape phones)
     lg  : < 1280px  (small laptops)
     xl  : ≥ 1280px  (desktops)
     xxl : ≥ 1920px  (full HD)
     tv  : ≥ 2560px  (4K / TV)
══════════════════════════════════════════════ */

/* ════════════════════════════════════════
   HAMBURGER + MOBILE MENU
════════════════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  transition: var(--transition);
  flex-shrink: 0;
}
.hamburger:hover { background: rgba(0,212,255,0.08); }
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--neon-cyan);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

#mobile-menu-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(3,5,15,0.75);
  backdrop-filter: blur(4px);
  z-index: 998;
}

#mobile-menu {
  position: fixed;
  top: 0; left: -300px;
  width: 280px; height: 100%;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-glow);
  z-index: 999;
  display: flex; flex-direction: column;
  transition: left 0.35s cubic-bezier(0.34,1.56,0.64,1);
  overflow-y: auto;
  box-shadow: 4px 0 40px rgba(0,0,0,0.4);
}
#mobile-menu.open { left: 0; }

.mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.mobile-menu-logo {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 900;
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 8px rgba(0,212,255,0.5));
}
.mobile-menu-header button {
  background: none; border: 1px solid var(--border-subtle);
  color: var(--text-muted); width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.mobile-menu-header button:hover { color: var(--neon-pink); border-color: var(--neon-pink); }

.mobile-menu-user {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: rgba(0,212,255,0.04);
  border-bottom: 1px solid var(--border-subtle);
}
.mobile-user-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: var(--bg-primary); flex-shrink: 0;
}
.mobile-user-name  { font-weight: 700; color: var(--text-primary); font-size: 0.95rem; }
.mobile-user-email { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.mobile-menu-location {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem; color: var(--text-secondary);
}
.mobile-menu-location:hover { background: rgba(0,212,255,0.05); color: var(--neon-cyan); }
.mobile-menu-location span:first-child { font-size: 1.1rem; color: var(--neon-cyan); }

.mobile-nav-links { flex: 1; padding: 8px 0; }
.mobile-nav-links a {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem; font-weight: 500;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.mobile-nav-links a:hover {
  background: rgba(0,212,255,0.05);
  color: var(--neon-cyan);
  padding-left: 28px;
}

.mobile-menu-footer {
  padding: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Mobile search bar (below navbar) */
#mobile-search-bar {
  display: none;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
#mobile-search-bar .search-bar { border-radius: var(--radius); }

/* Mobile bottom navigation */
#mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(7,13,26,0.98);
  border-top: 1px solid var(--border-glow);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  backdrop-filter: blur(20px);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.mbn-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
  position: relative;
}
.mbn-btn:hover, .mbn-btn:active { color: var(--neon-cyan); }
.mbn-icon { font-size: 1.3rem; }
.mbn-label { font-size: 0.6rem; letter-spacing: 0.05em; font-family: var(--font-mono); }
.mbn-cart { position: relative; }
.mbn-badge {
  position: absolute; top: 0; right: calc(50% - 18px);
  background: var(--neon-pink); color: white;
  font-size: 0.6rem; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 6px var(--neon-pink);
}

/* ════════════════════════════════════════
   TABLET — ≤ 1024px
════════════════════════════════════════ */
@media (max-width: 1024px) {
  .nav-orders { display: none; }
  .hero-content h1 { font-size: 2.2rem; }
  .hero-visual { right: 40px; width: 240px; height: 240px; }
  .holo-sphere { width: 120px; height: 120px; }
  .o1{width:160px;height:160px}.o2{width:200px;height:200px}.o3{width:240px;height:240px}
}

/* ════════════════════════════════════════
   TABLET PORTRAIT — ≤ 900px
════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-location { display: none; }
  .nav-orders   { display: none; }
  .hero-visual  { display: none; }
  .hero-slide   { padding: 28px 32px; }
  .hero-content h1 { font-size: 2rem; }

  /* Product detail stacks vertically */
  .product-detail-container {
    flex-direction: column;
    margin-top: 70px;
    gap: 24px;
  }
  .detail-left  { flex: none; width: 100%; max-width: 100%; }
  .detail-right { padding-top: 0; }
  .detail-img-frame { height: 260px; }
  .detail-title { font-size: 1.3rem; }

  /* Footer 2-col */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  footer { padding: 40px 24px 24px; }
}

/* ════════════════════════════════════════
   MOBILE LANDSCAPE + SMALL TABLET — ≤ 768px
════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Activate mobile nav elements */
  .hamburger            { display: flex; }
  #mobile-search-bar    { display: block; }
  #mobile-bottom-nav    { display: flex; }
  #mobile-menu-overlay  { display: block; }

  /* Hide desktop nav items */
  .nav-center   { display: none; }
  .nav-account  { display: none; }
  .nav-orders   { display: none; }
  .cart-label   { display: none; }

  /* Navbar compact */
  #navbar {
    padding: 10px 14px;
    gap: 10px;
  }
  .nav-logo { font-size: 1.2rem; }
  .nav-cart {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  /* Add bottom padding so content isn't behind bottom nav */
  #main-app { padding-bottom: 70px; }

  /* Hero shorter on mobile */
  #hero-section { height: 300px; }
  .hero-slide   { padding: 24px 20px; }
  .hero-content h1 { font-size: 1.6rem; }
  .hero-content p  { font-size: 0.88rem; margin-bottom: 16px; }
  .hero-tag { font-size: 0.7rem; margin-bottom: 10px; }
  .hero-cta { padding: 10px 20px; font-size: 0.8rem; }

  /* Products 2-column */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  #products-section { padding: 20px 12px; }
  .section-header h2 { font-size: 1.1rem; }

  /* Cart panel full width */
  .cart-panel {
    width: 100%;
    height: 100%;
    border-left: none;
    border-top: 1px solid var(--border-glow);
  }
  .cart-footer {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  /* Checkout & cancel modals — full screen on mobile */
  .checkout-modal-panel,
  .cancel-panel,
  .order-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    transform: none;
    animation: modalSlideUp 0.4s cubic-bezier(0.34,1.56,0.64,1);
  }
  @keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* Product detail */
  .product-detail-container {
    margin-top: 60px;
    padding: 0 12px;
    gap: 16px;
  }
  .close-detail { top: 12px; right: 12px; width: 38px; height: 38px; }
  .detail-img-frame { height: 240px; }
  .detail-title  { font-size: 1.2rem; }
  .detail-price  { font-size: 1.6rem; }
  .detail-specs  { grid-template-columns: 1fr; }
  .detail-actions { flex-direction: column; gap: 10px; }
  .add-cart-btn, .buy-now-btn { min-width: 0; width: 100%; }
  .wishlist-btn  { width: 100%; }
  .reviews-section { padding: 0 12px; margin-bottom: 80px; }

  /* Chatbot bottom-left on mobile */
  #chatbot-bubble {
    bottom: 80px; right: 16px;
  }
  #chatbot-panel {
    bottom: 140px; right: 16px;
    width: calc(100vw - 32px);
    max-width: 380px;
    height: 460px;
  }

  /* Location modal */
  .location-modal-panel { padding: 24px 16px; }

  /* Cancel order btn larger tap target */
  .cancel-order-btn {
    width: 100%;
    padding: 12px;
    text-align: center;
    font-size: 0.9rem;
  }

  /* Cancel modal */
  .cancel-actions { flex-direction: column; }
  .cancel-actions .cyber-btn-outline,
  .cancel-confirm-btn { width: 100%; }

  /* Toast */
  #toast {
    bottom: 80px;
    font-size: 0.85rem;
    padding: 10px 20px;
    white-space: normal;
    text-align: center;
    max-width: 90vw;
  }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  footer { padding: 32px 20px 24px; margin-top: 40px; }

}

/* ════════════════════════════════════════
   MOBILE — ≤ 600px
════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Intro */
  .intro-logo { gap: 2px; }
  .logo-letter { font-size: clamp(2.2rem, 12vw, 4rem); }
  .intro-welcome { font-size: 0.85rem; }
  .intro-tagline { font-size: 0.7rem; letter-spacing: 0.3em; }
  .intro-loader { width: 85vw; }

  /* Login */
  .login-card { padding: 32px 20px; }
  .login-brand { font-size: 1.6rem; }

  /* Hero */
  #hero-section { height: 260px; }
  .hero-content h1 { font-size: 1.4rem; }

  /* Cards */
  .products-grid { gap: 10px; }
  .card-image-wrap { height: 160px; }
  .card-emoji { font-size: 3.8rem; }
  .card-body { padding: 12px; }
  .card-name { font-size: 0.82rem; }
  .card-price { font-size: 1rem; }
  .card-add-btn { font-size: 0.78rem; padding: 8px; }

  /* Offline screen */
  .offline-content { gap: 20px; padding: 24px 16px; }
  .offline-plug-scene { transform: scale(0.75); width: 200px; height: 160px; }
  .offline-title { font-size: 1.6rem; }
  .offline-desc { font-size: 0.85rem; }

  /* Ticker */
  .ticker-label { padding: 0 10px; font-size: 0.65rem; }

  /* Delivery track */
  .delivery-track { gap: 0; font-size: 0.7rem; }
  .track-line { min-width: 10px; }

  /* Reviews */
  .review-card { flex-direction: column; gap: 12px; }

  /* Checkout addr row */
  .addr-row { flex-direction: column; }
}

/* ════════════════════════════════════════
   SMALL PHONES — ≤ 400px
════════════════════════════════════════ */
@media (max-width: 400px) {
  #navbar { padding: 8px 10px; gap: 6px; }
  .nav-logo { font-size: 1rem; }
  .nav-cart { padding: 8px 10px; font-size: 0.78rem; }

  .products-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card-image-wrap { height: 140px; }
  .card-emoji { font-size: 3.2rem; }

  #hero-section { height: 240px; }
  .hero-content h1 { font-size: 1.2rem; }
  .hero-content p  { display: none; }

  .login-card { padding: 24px 16px; }
  .login-brand { font-size: 1.4rem; }

  #mobile-bottom-nav { padding: 6px 0 max(6px, env(safe-area-inset-bottom)); }
  .mbn-icon { font-size: 1.1rem; }
  .mbn-label { font-size: 0.55rem; }

  #chatbot-panel {
    width: calc(100vw - 16px);
    right: 8px;
    left: 8px;
  }
}

/* ════════════════════════════════════════
   DESKTOP LARGE — ≥ 1280px
════════════════════════════════════════ */
@media (min-width: 1280px) {
  #navbar { padding: 14px 40px; }
  #products-section { padding: 50px 40px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  #hero-section { height: 480px; }
  .hero-content h1 { font-size: 3.2rem; }
}

/* ════════════════════════════════════════
   FULL HD — ≥ 1920px
════════════════════════════════════════ */
@media (min-width: 1920px) {
  #navbar { padding: 16px 80px; max-width: 2400px; margin: 0 auto; }
  .nav-logo { font-size: 1.8rem; }
  #products-section { padding: 60px 80px; max-width: 2000px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }
  .card-image-wrap { height: 240px; }
  .card-emoji { font-size: 6rem; }
  .card-body { padding: 20px; }
  .card-name { font-size: 1rem; }
  .card-price { font-size: 1.25rem; }
  #hero-section { height: 560px; }
  .hero-content h1 { font-size: 3.8rem; }
  .hero-content p { font-size: 1.15rem; }
  #category-bar { padding: 0 80px; }
  footer { padding: 80px 80px 32px; }
  .footer-grid { max-width: 1600px; }
  .modal-panel { width: 640px; }
  .cart-panel { width: 500px; }
  #chatbot-panel { width: 420px; height: 580px; }
}

/* ════════════════════════════════════════
   4K / TV — ≥ 2560px
════════════════════════════════════════ */
@media (min-width: 2560px) {
  html { font-size: 20px; }

  #navbar {
    padding: 20px 120px;
    max-width: 3200px; margin: 0 auto;
  }
  .nav-logo { font-size: 2.4rem; letter-spacing: 0.25em; }
  .nav-cart { padding: 14px 24px; }
  .search-bar input { font-size: 1.1rem; padding: 16px 24px; }
  .search-btn { padding: 16px 24px; font-size: 1.3rem; }

  #category-bar { padding: 0 120px; }
  .cat-btn { padding: 12px 24px; font-size: 1rem; }

  #hero-section { height: 700px; }
  .hero-slide { padding: 60px 120px; }
  .hero-content h1 { font-size: 5rem; }
  .hero-content p { font-size: 1.3rem; max-width: 600px; }
  .hero-cta { padding: 18px 48px; font-size: 1.1rem; }
  .hero-visual { right: 160px; width: 420px; height: 420px; }
  .holo-sphere { width: 220px; height: 220px; }
  .o1{width:280px;height:280px}.o2{width:340px;height:340px}.o3{width:400px;height:400px}

  #products-section { padding: 80px 120px; max-width: 3200px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 36px; }
  .card-image-wrap { height: 300px; }
  .card-emoji { font-size: 7rem; }
  .card-body { padding: 24px; }
  .card-name { font-size: 1.1rem; }
  .card-price { font-size: 1.4rem; }
  .card-add-btn { padding: 14px; font-size: 1rem; }

  .section-header h2 { font-size: 2rem; }

  footer { padding: 100px 120px 40px; }
  .footer-grid { max-width: 2400px; gap: 80px; }
  .footer-logo { font-size: 2rem; }
  .footer-col p, .footer-col a { font-size: 1.05rem; }

  /* Modals scale up */
  .modal-panel { width: 800px; padding: 60px; }
  .modal-title { font-size: 1.8rem; }
  .cart-panel { width: 640px; }
  #chatbot-panel { width: 500px; height: 680px; bottom: 160px; right: 60px; }
  #chatbot-bubble { bottom: 60px; right: 60px; }
  .chatbot-icon { width: 80px; height: 80px; font-size: 2rem; }

  /* Product detail */
  .product-detail-container { max-width: 1600px; gap: 100px; }
  .detail-left { flex: 0 0 600px; }
  .detail-img-frame { height: 560px; }
  .detail-title { font-size: 2.2rem; }
  .detail-price { font-size: 2.8rem; }

  /* Login */
  .login-card { width: 560px; padding: 64px 56px; }
  .login-brand { font-size: 2.8rem; }

  /* Intro */
  .intro-loader { width: 600px; }
}

/* ════════════════════════════════════════
   TOUCH DEVICE OPTIMISATIONS
════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets */
  .cat-btn { padding: 10px 18px; }
  .card-add-btn { padding: 12px; }
  .qty-btn { width: 32px; height: 32px; }
  .detail-qty button { width: 40px; height: 40px; }
  .rev-btn { padding: 12px 24px; }
  .pay-option { padding: 18px; }
  .city-item { padding: 16px 18px; }
  .reason-btn { padding: 12px 16px; }

  /* Always show wishlist button on touch */
  .card-wishlist { opacity: 1; }

  /* Remove hover effects that don't work well on touch */
  .city-item:hover { padding-left: 18px; }
  .footer-col a:hover { padding-left: 0; }
}

/* ════════════════════════════════════════
   LANDSCAPE PHONE
════════════════════════════════════════ */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  #hero-section { height: 200px; }
  .hero-content h1 { font-size: 1.3rem; }
  .hero-content p { display: none; }
  .hero-cta { padding: 8px 16px; font-size: 0.78rem; }
  #mobile-bottom-nav { padding: 4px 0 max(4px, env(safe-area-inset-bottom)); }
  .mbn-icon { font-size: 1rem; }
  .mbn-label { display: none; }
  #main-app { padding-bottom: 50px; }

  /* Modal takes full height on landscape */
  .modal-panel {
    position: fixed;
    top: 0; bottom: 0;
    left: 0; right: 0;
    border-radius: 0;
    max-height: 100vh;
    transform: none;
    animation: none;
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
  }
}

/* ════════════════════════════════════════
   SAFE AREA (iPhone notch / Dynamic Island)
════════════════════════════════════════ */
@supports (padding: max(0px)) {
  #navbar {
    padding-left:  max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  #mobile-bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left:   max(0px, env(safe-area-inset-left));
    padding-right:  max(0px, env(safe-area-inset-right));
  }
}

/* ════════════════════════════════════════
   PRINT (clean layout)
════════════════════════════════════════ */
@media print {
  #intro-overlay, #login-page, #chatbot-bubble,
  #chatbot-panel, #mobile-bottom-nav, #navbar,
  #deals-ticker, .load-more-wrap { display: none !important; }
  body { background: white; color: black; }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .card-price, .detail-price { color: black; }
}
