/* ============================================
   HELMETSTORE - RESPONSIVE CSS
   Breakpoints:
   XL: 1280px | LG: 1024px | MD: 900px
   SM: 640px  | XS: 480px  | XXS: 360px
   ============================================ */

/* ============================================
   XL - 1280px
   ============================================ */
@media (max-width: 1280px) {
  .container { max-width: 1100px; }

  .hero-title { font-size: 52px; }
  .hero-image img { max-height: 400px; }

  .footer-grid { gap: 28px; }

  .nav-list > li > a { padding: 0 12px; font-size: 13px; }
}

/* ============================================
   LG - 1024px
   ============================================ */
@media (max-width: 1024px) {
  .container { max-width: 960px; }

  /* HEADER */
  .header-search { max-width: 380px; }
  .logo-name { font-size: 18px; }

  /* HERO */
  .hero-title { font-size: 42px; }
  .hero-content { max-width: 460px; }
  .hero-image { width: 44%; }
  .hero-slide { min-height: 460px; }

  /* FOOTER */
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 24px;
  }
  .footer-about { grid-column: 1 / -1; }
  .footer-about p { max-width: 600px; }

  /* FEATURES */
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  /* BRANDS */
  .brand-showcase { gap: 20px; }
  .brand-showcase-card { padding: 36px 28px; min-height: 240px; }
  .brand-showcase-name { font-size: 40px; }

  /* PRODUCTS */
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }

  /* NAV */
  .nav-list > li > a { padding: 0 10px; font-size: 12px; }
  .mega-dropdown { min-width: 360px; }
}

/* ============================================
   MD - 900px  (TABLET)
   ============================================ */
@media (max-width: 900px) {

  /* TOPBAR */
  .topbar-left { display: none; }
  .topbar-right { gap: 14px; font-size: 11px; }
  .topbar-right span { display: none; } /* hide shipping/isi text */
  .topbar-right a { display: flex; }

  /* HEADER */
  .hamburger { display: flex; }
  .logo-brands { display: none; }
  .header-search { max-width: none; flex: 1; }

  /* STICKY NAV → OFF-CANVAS MOBILE MENU */
  .main-nav {
    display: block;
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: var(--dark-2);
    border-right: 2px solid var(--primary);
    z-index: 1001;
    overflow-y: auto;
    transition: left 0.35s cubic-bezier(.4,0,.2,1);
    padding: 0 0 40px;
    border-bottom: none;
  }
  .main-nav.open { left: 0; }

  /* MOBILE NAV HEADER */
  .mobile-nav-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--dark-4);
    background: var(--dark-3);
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .mobile-nav-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
  }
  .mobile-nav-close {
    width: 32px; height: 32px;
    background: var(--dark-5);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--light-3);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
  }
  .mobile-nav-close:hover { background: var(--primary); color: white; }

  /* NAV LIST MOBILE */
  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 0;
  }
  .nav-list > li {
    width: 100%;
    border-bottom: 1px solid var(--dark-4);
  }
  .nav-list > li:last-child { border-bottom: none; }
  .nav-list > li > a {
    padding: 14px 20px;
    height: auto;
    width: 100%;
    justify-content: space-between;
    font-size: 14px;
    border-radius: 0;
  }
  .nav-list > li > a::after { display: none; }
  .nav-list > li > a i.fa-chevron-down {
    font-size: 12px;
    transition: transform 0.3s ease;
  }
  .has-dropdown.open > a i.fa-chevron-down { transform: rotate(180deg); }

  /* DROPDOWNS MOBILE */
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: none;
    border-top: 1px solid var(--dark-4);
    background: var(--dark-3);
    box-shadow: none;
    display: none;
    border-radius: 0;
    min-width: unset;
  }
  .has-dropdown.open .dropdown { display: block; }
  .dropdown ul { padding: 6px 0; }
  .dropdown ul li a {
    padding: 11px 20px 11px 30px;
    font-size: 13px;
  }
  .dropdown ul li a:hover { padding-left: 36px; }

  /* MEGA DROPDOWN MOBILE */
  .mega-dropdown { padding: 16px; min-width: unset; }
  .brand-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .brand-card { padding: 16px 12px; }
  .brand-card h4 { font-size: 16px; }

  /* OVERLAY */
  .mobile-overlay { display: none; }
  .mobile-overlay.show { display: block; }

  /* HERO */
  .hero-image { display: none; }
  .hero-slide {
    min-height: 380px;
    justify-content: center;
    text-align: center;
  }
  .hero-content {
    max-width: 100%;
    padding: 50px 0;
  }
  .hero-btns { justify-content: center; }
  .hero-title { font-size: 38px; }
  .hero-desc { font-size: 15px; }
  .hero-arrow { display: none; }

  /* FEATURES */
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  /* BRANDS SHOWCASE */
  .brand-showcase { grid-template-columns: 1fr; gap: 16px; }
  .brand-showcase-card { min-height: 200px; padding: 30px 24px; }
  .brand-showcase-name { font-size: 36px; }

  /* PRODUCTS */
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }

  /* CATEGORIES */
  .categories-grid { grid-template-columns: repeat(4, 1fr); }

  /* SECTION */
  .section { padding: 60px 0; }
  .section-lg { padding: 70px 0; }
  .section-title { font-size: 32px; }

  /* PAGE LAYOUTS */
  .page-with-sidebar {
    grid-template-columns: 1fr !important;
  }
  .sidebar { display: none; }
  .sidebar.show { display: block; }
  .filter-toggle-btn { display: flex !important; }

  /* PRODUCT DETAIL */
  .product-detail-grid { grid-template-columns: 1fr !important; }
  .product-thumbnails { flex-direction: row !important; }

  /* CHECKOUT */
  .checkout-grid { grid-template-columns: 1fr !important; }

  /* FOOTER */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-about { grid-column: 1 / -1; }

  /* ADMIN */
  .admin-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
  }
  .admin-sidebar.open { left: 0; }
  .admin-main { margin-left: 0 !important; }
}

/* ============================================
   SM - 640px  (LARGE MOBILE)
   ============================================ */
@media (max-width: 640px) {

  /* TOPBAR */
  .topbar { display: none; }

  /* HEADER */
  .logo-icon { width: 38px; height: 38px; font-size: 18px; }
  .logo-name { font-size: 17px; }
  .action-btn { width: 40px; height: 40px; font-size: 16px; }
  .header-actions { gap: 6px; }

  /* SEARCH - hide text, show icon only on very small */
  .header-search { max-width: none; }
  .header-search input { font-size: 13px; padding: 9px 14px; }

  /* HERO */
  .hero-slide { min-height: 340px; }
  .hero-tag { font-size: 11px; padding: 5px 12px; }
  .hero-title { font-size: 30px; }
  .hero-desc { font-size: 14px; margin-bottom: 24px; }
  .hero-btns { flex-direction: column; align-items: center; gap: 10px; }
  .hero-btns .btn { width: 100%; max-width: 280px; justify-content: center; }
  .hero-controls { bottom: 14px; }

  /* TICKER */
  .ticker-item { padding: 0 24px; font-size: 12px; }

  /* FEATURES */
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .feature-item { flex-direction: column; text-align: center; gap: 8px; }
  .feature-icon { width: 44px; height: 44px; font-size: 18px; }
  .feature-text h5 { font-size: 13px; }
  .feature-text p { font-size: 11px; }

  /* SECTION */
  .section { padding: 44px 0; }
  .section-header { margin-bottom: 32px; }
  .section-title { font-size: 26px; }
  .section-desc { font-size: 14px; }

  /* PRODUCTS */
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card { border-radius: var(--radius); }
  .product-info { padding: 12px; }
  .product-name { font-size: 13px; }
  .current-price { font-size: 16px; }
  .original-price { font-size: 12px; }
  .btn-add-cart { font-size: 12px; padding: 9px 8px; gap: 5px; }
  .product-actions-hover { display: none; } /* hide on mobile for clean UX */

  /* CATEGORIES */
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .category-card { padding: 16px 10px; }
  .category-icon { width: 48px; height: 48px; font-size: 20px; }
  .category-card h4 { font-size: 13px; }
  .category-card p { display: none; }

  /* BRANDS SHOWCASE */
  .brand-showcase-name { font-size: 30px; }
  .brand-showcase-card { padding: 24px 20px; min-height: 160px; }
  .brand-showcase-desc { font-size: 13px; }

  /* FORMS */
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .btn-lg { padding: 13px 24px; font-size: 15px; }
  .btn { padding: 11px 20px; font-size: 14px; }

  /* TABLES */
  .table-wrap { border-radius: var(--radius); }
  thead th { font-size: 12px; padding: 12px 12px; }
  tbody td { font-size: 13px; padding: 12px 12px; }

  /* BREADCRUMB */
  .breadcrumb-list { font-size: 12px; gap: 6px; }

  /* PAGINATION */
  .pagination { gap: 4px; }
  .page-btn { width: 36px; height: 36px; font-size: 13px; }

  /* FOOTER */
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-top { padding: 40px 0 28px; }
  .footer-col h4 { font-size: 14px; margin-bottom: 14px; }
  .footer-col ul li a { font-size: 13px; }
  .footer-bottom .container { flex-direction: column; text-align: center; gap: 8px; }
  .footer-bottom-links { gap: 14px; flex-wrap: wrap; justify-content: center; }
  .footer-bottom p { font-size: 12px; }

  /* CART PAGE */
  .cart-table-item { flex-direction: column; gap: 12px; }
  .cart-item-img { width: 80px !important; }

  /* PROFILE / ORDERS */
  .profile-grid { grid-template-columns: 1fr !important; }
  .order-summary-grid { grid-template-columns: 1fr 1fr !important; }

  /* ADMIN STATS */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* TOAST */
  .toast-container { right: 12px; left: 12px; bottom: 16px; }
  .toast { min-width: unset; }

  /* BACK TO TOP */
  .back-to-top { bottom: 70px; right: 14px; width: 40px; height: 40px; font-size: 14px; }

  /* MODAL */
  .modal-box { width: 95% !important; padding: 24px 18px !important; }
}

/* ============================================
   XS - 480px
   ============================================ */
@media (max-width: 480px) {

  /* HEADER compact */
  .header-inner { gap: 10px; }
  .logo-name { font-size: 15px; }
  .logo-icon { width: 34px; height: 34px; font-size: 16px; }
  .action-btn { width: 36px; height: 36px; font-size: 15px; }
  .header-search input { padding: 8px 12px; font-size: 12px; }
  .header-search button { padding: 8px 14px; font-size: 14px; }

  /* HERO */
  .hero-slide { min-height: 300px; }
  .hero-title { font-size: 26px; }
  .hero-desc { display: none; }
  .hero-tag { font-size: 10px; }

  /* PRODUCTS */
  .products-grid { gap: 8px; }
  .product-img-wrap { aspect-ratio: 1; }
  .product-info { padding: 10px 10px 12px; }
  .product-name { font-size: 12px; margin-bottom: 6px; }
  .product-price { margin-bottom: 10px; gap: 6px; }
  .current-price { font-size: 15px; }
  .btn-add-cart { font-size: 11px; padding: 8px 6px; border-radius: 5px; }
  .product-badge { font-size: 10px; padding: 3px 7px; top: 8px; left: 8px; }

  /* CATEGORIES */
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .category-card { padding: 14px 8px; border-radius: var(--radius); }
  .category-icon { width: 40px; height: 40px; font-size: 18px; margin-bottom: 8px; }
  .category-card h4 { font-size: 12px; }

  /* SECTION */
  .section { padding: 36px 0; }
  .section-title { font-size: 22px; }
  .section-tag { font-size: 11px; letter-spacing: 2px; }

  /* FEATURES */
  .features-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .feature-text h5 { font-size: 12px; }
  .feature-text p { display: none; }

  /* BRAND SHOWCASE */
  .brand-showcase { gap: 10px; }
  .brand-showcase-name { font-size: 26px; }

  /* FORMS */
  .form-control { font-size: 13px; padding: 10px 12px; }
  .form-label { font-size: 12px; }

  /* TABLES - card style on mobile */
  .mobile-card-table thead { display: none; }
  .mobile-card-table tbody tr {
    display: block;
    background: var(--dark-3);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 14px;
  }
  .mobile-card-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    font-size: 13px;
  }
  .mobile-card-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-right: 10px;
  }

  /* CHECKOUT STEPS */
  .checkout-steps { gap: 4px !important; }
  .step-label { display: none; }
  .step-num { width: 32px !important; height: 32px !important; font-size: 13px !important; }

  /* ORDER DETAIL */
  .order-summary-grid { grid-template-columns: 1fr !important; }

  /* AUTH PAGES */
  .auth-card { padding: 24px 18px !important; }
  .auth-logo { font-size: 28px !important; }

  /* ADMIN */
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .stat-card { padding: 16px !important; }
  .stat-value { font-size: 24px !important; }
  .admin-table-actions { flex-direction: column; gap: 6px; }
}

/* ============================================
   XXS - 360px
   ============================================ */
@media (max-width: 360px) {

  .container { padding: 0 12px; }

  /* HEADER */
  .logo-name { font-size: 14px; letter-spacing: 0; }
  .logo-icon { display: none; }
  .action-btn { width: 34px; height: 34px; font-size: 14px; }
  .header-actions { gap: 4px; }
  .header-search { display: none; } /* only search via nav on very small */

  /* HERO */
  .hero-title { font-size: 22px; }
  .hero-slide { min-height: 260px; padding: 30px 0; }
  .hero-btns .btn { font-size: 13px; padding: 10px 16px; }

  /* PRODUCTS - 1 column */
  .products-grid { grid-template-columns: 1fr; }
  .product-card { display: flex; gap: 0; flex-direction: column; }

  /* CATEGORIES */
  .categories-grid { grid-template-columns: repeat(2, 1fr); }

  /* FEATURES */
  .features-grid { grid-template-columns: 1fr; }
  .feature-item { flex-direction: row; text-align: left; }

  /* SECTION */
  .section-title { font-size: 20px; }

  /* BUTTONS */
  .btn { font-size: 13px; padding: 10px 16px; }
  .btn-lg { font-size: 14px; padding: 12px 20px; }

  /* FOOTER */
  .social-links a { width: 34px; height: 34px; font-size: 13px; }
  .brand-badge { font-size: 12px; padding: 4px 10px; }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-width: 900px) and (orientation: landscape) {
  .hero-slide { min-height: 260px; }
  .hero-title { font-size: 28px; }
  .main-nav { width: 260px; }
  .section { padding: 36px 0; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .topbar, .main-header, .main-nav,
  .site-footer, .back-to-top,
  .toast-container, .btn-add-cart,
  .product-actions-hover { display: none !important; }

  body { background: white; color: black; }
  .container { max-width: 100%; padding: 0 16px; }
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .product-card { border: 1px solid #ddd; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }

  .order-detail { break-inside: avoid; }
}

/* ============================================
   DARK MODE PREFERENCE (already dark by default)
   Add light mode toggle support here if needed
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-image img { animation: none; }
  .ticker-inner { animation: none; }
}

/* ============================================
   HIGH CONTRAST / ACCESSIBILITY
   ============================================ */
@media (prefers-contrast: high) {
  :root {
    --primary: #FF8000;
    --dark-4: #333;
    --dark-5: #444;
    --muted: #AAA;
  }
  .product-card { border-width: 2px; }
  .btn-outline { border-width: 2px; }
}

/* ============================================
   TOUCH DEVICE IMPROVEMENTS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  /* Bigger tap targets */
  .nav-list > li > a { min-height: 48px; }
  .action-btn { min-width: 44px; min-height: 44px; }
  .btn { min-height: 44px; }
  .form-control { min-height: 44px; font-size: 16px; } /* prevent zoom on iOS */
  input, select, textarea { font-size: 16px !important; } /* prevent zoom */

  /* Remove hover effects that don't work on touch */
  .product-card:hover { transform: none; }
  .btn-primary:hover { transform: none; }
  .btn-outline:hover { transform: none; }
  .category-card:hover { transform: none; }

  /* Active states instead */
  .product-card:active { border-color: var(--primary); }
  .btn:active { opacity: 0.85; }
  .category-card:active { background: rgba(255,107,0,0.1); }

  /* Smooth scroll on iOS */
  .main-nav { -webkit-overflow-scrolling: touch; }
}