/* ============================================================
   Vishwanath Traders — CATEGORY PAGES responsive (Samsung-style)
   Scoped to body.cat-page (category/index.html pages) so other
   pages stay unaffected. Linked per category page.
   - Samsung-style right side drawer nav
   - Compact mobile navbar (hamburger + search)
   - Hero, filter bar, product cards, footer mobile-friendly
   ============================================================ */

/* ---- Navbar: hamburger + hide desktop nav ---- */
@media (max-width: 992px) {
  body.cat-page .navbar .hamburger { display: flex; }
  /* Restore hamburger 3-bar icon (shared `.navbar *` rule zeroes all transforms) */
  body.cat-page .navbar .hamburger span {
    position: absolute;
    left: 50%;
    margin-left: -11px;
    transform: translateY(0) !important;
  }
  body.cat-page .navbar .hamburger span:nth-child(1) { transform: translateY(-7px) !important; }
  body.cat-page .navbar .hamburger span:nth-child(2) { transform: translateY(0) !important; }
  body.cat-page .navbar .hamburger span:nth-child(3) { transform: translateY(7px) !important; }
  body.cat-page .navbar .hamburger.active span:nth-child(1) { transform: translateY(0) rotate(45deg) !important; }
  body.cat-page .navbar .hamburger.active span:nth-child(2) { transform: translateY(0) !important; opacity: 0; }
  body.cat-page .navbar .hamburger.active span:nth-child(3) { transform: translateY(0) rotate(-45deg) !important; }
  body.cat-page .navbar .nav-center,
  body.cat-page .navbar .nav-links { display: none; }
  body.cat-page .navbar .cta-btn { display: none; }
  body.cat-page .navbar .nav-right { gap: 4px; margin-left: auto; margin-right: 4px; }
  body.cat-page .navbar { height: 60px; padding: 0 10px; }
  body.cat-page .nav-container { height: 60px; }
  body.cat-page .navbar::before { width: 47%; }

  /* Sticky offsets follow the 60px navbar + search bar */
  body.cat-page .mobile-search-bar { top: 60px; }
  body.cat-page .fs-bar { top: 60px; }
}

/* ---- Hero: fit mobile height (was 90vh) ---- */
@media (max-width: 992px) {
  body.cat-page .cat-hero {
    min-height: 0;
    min-height: auto;
    padding: 72px 0 128px;
  }
  body.cat-page .cat-hero .cat-container {
    margin-left: clamp(16px, 4vw, 24px);
    margin-right: clamp(16px, 4vw, 24px);
    gap: 12px;
    padding-bottom: 8px;
  }
  body.cat-page .cat-hero h1 {
    font-size: 28px !important;
    line-height: 1.25 !important;
  }
  body.cat-page .cat-hero p {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }
  body.cat-page .cat-hero-cta { margin-top: 20px; gap: 12px; }
  body.cat-page .cat-hero-cta .btn-primary,
  body.cat-page .cat-hero-cta .btn-secondary {
    padding: 13px 24px;
    font-size: 15px;
    border-radius: 8px;
  }
}

/* ---- Section headings more compact on mobile ---- */
@media (max-width: 992px) {
  body.cat-page .cat-products { padding: 40px 0 56px; }
  body.cat-page .cat-products h2 { font-size: 24px; }
  body.cat-page .cat-products .cat-prod-sub { font-size: 15px; margin-bottom: 28px; }
  body.cat-page .cat-info { padding: 40px 0; }
  body.cat-page .cat-info h2 { font-size: 22px; }
  body.cat-page .cat-info p,
  body.cat-page .cat-info li { font-size: 15px; line-height: 1.7; }
  body.cat-page .cat-faq { padding: 40px 0; }
  body.cat-page .cat-faq h2 { font-size: 22px; }
  body.cat-page .cat-cta { padding: 44px 12px; }
  body.cat-page .cat-cta h2 { font-size: 22px; }
}

/* ---- Filter / Sort bar — Samsung-style organized ----
   Row 1 (title/count); Row 2 [Filter btn][pills][Sort] */
@media (max-width: 992px) {
  body.cat-page .fs-bar { padding: 12px 0; }
  body.cat-page .fs-container {
    flex-direction: column;
    gap: 10px;
    padding: 0 12px;
    align-items: stretch;
  }
  body.cat-page .fs-left {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: center;
  }
  body.cat-page .fs-left .fs-badge { font-size: 14px; }
  body.cat-page .fs-left .fs-count { font-size: 12px; white-space: nowrap; }
  body.cat-page .fs-right {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: hidden;
  }
  body.cat-page .fs-pills {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  body.cat-page .fs-pills::-webkit-scrollbar { display: none; }
  body.cat-page .fs-pill { flex: 0 0 auto; font-size: 12px; padding: 5px 14px; }
  body.cat-page .fs-sort { flex: 0 0 auto; margin-left: 0; }
  body.cat-page .fs-select { font-size: 12px; padding: 6px 30px 6px 12px; }
  body.cat-page .filter-toggle-mobile { flex: 0 0 auto; }
}

/* ---- Filter area: hide sidebar, full-width grid, show toggle ---- */
@media (max-width: 992px) {
  body.cat-page .filter-sidebar { display: none; }
  body.cat-page .filter-container { flex-direction: column; padding: 0 12px; }
  body.cat-page .product-grid-container { width: 100%; }
  body.cat-page .filter-toggle-mobile { display: inline-flex !important; align-items: center; gap: 6px; }
}

/* ---- Mobile filter bottom-sheet (activate base styles) ---- */
@media (max-width: 992px) {
  body.cat-page .mobile-filter-overlay { display: flex; }
  body.cat-page .mobile-filter-overlay:not(.active) { display: none; }
  body.cat-page .mobile-filter-sheet { display: block; }
}

/* ---- Category product cards (static .cat-prod-card) ----
   2-col on tablet, 1-col on phone, images keep proportion */
@media (max-width: 768px) {
  body.cat-page .cat-prod-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  body.cat-page .cat-prod-card img { height: 150px; padding: 12px; }
  body.cat-page .cat-prod-card .cp-title { font-size: 14px; }
}
@media (max-width: 480px) {
  body.cat-page .cat-prod-grid { grid-template-columns: 1fr; gap: 12px; }
  body.cat-page .cat-prod-card img { height: 200px; }
}

/* ---- JS-populated product cards (.product-grid-card) ----
   Same card as desktop, fewer columns (matches products page) */
@media (max-width: 992px) {
  body.cat-page .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  body.cat-page .product-grid-card {
    width: 100%;
    height: auto;
    border-radius: 12px;
  }
  body.cat-page .product-grid-card img {
    width: 100%;
    height: 230px;
    object-fit: contain;
    padding: 8px 8px 0;
    display: block;
    margin-top: 0;
  }
  body.cat-page .product-content { margin-top: 0; padding: 8px 12px 0; }
  body.cat-page .product-brand { font-size: 15px; }
  body.cat-page .product-model { font-size: 14px; }
  body.cat-page .product-title { font-size: 15px; -webkit-line-clamp: 3; }
  body.cat-page .product-usage { font-size: 13px; }
  body.cat-page .product-size { font-size: 15px; }
  body.cat-page .product-divider { margin: 6px 0 10px; }
  body.cat-page .product-cta { padding: 10px 12px 12px; }
  body.cat-page .quote-btn { min-width: 0; width: 100%; height: 38px; font-size: 15px; }
}
@media (max-width: 768px) {
  body.cat-page .product-grid-card img { height: 170px; }
}
@media (max-width: 480px) {
  body.cat-page .product-grid { grid-template-columns: 1fr; gap: 16px; }
  body.cat-page .product-grid-card img { height: 280px; }
}

/* ---- Footer cleanup (accordion-collapsed footer stays expanded) ---- */
@media (max-width: 992px) {
  body.cat-page .footer h3,
  body.cat-page .footer h4 {
    font-size: 15px !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: default !important;
    display: block !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
    color: #E6C369 !important;
  }
  body.cat-page .footer h3::after,
  body.cat-page .footer h4::after { content: none !important; }
  body.cat-page .footer .footer-col ul {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body.cat-page .footer .footer-col ul li { font-size: 14px !important; margin-bottom: 9px !important; }
  body.cat-page .footer .footer-col p:not(.legal):not(.tagline) {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 0 6px !important;
    margin: 0 !important;
  }
  body.cat-page .footer .footer-col { flex-direction: column; gap: 4px; }
  body.cat-page .footer .footer-col > h4 { margin-top: 22px !important; }
  body.cat-page .footer .footer-col:first-child h3 {
    font-size: 22px !important;
    text-transform: none;
    color: #FFFFFF !important;
    margin-bottom: 10px !important;
  }
  body.cat-page .footer .footer-col:first-child p { font-size: 14px !important; line-height: 1.65 !important; }
  body.cat-page .footer .footer-social { margin-top: 14px; }
  body.cat-page .footer .footer-bottom { margin-top: 32px; }
}
@media (max-width: 768px) {
  body.cat-page .footer .footer-container { grid-template-columns: 1fr 1fr !important; gap: 28px; }
  body.cat-page .footer { padding: 40px 16px; }
}
@media (max-width: 420px) {
  body.cat-page .footer .footer-container { grid-template-columns: 1fr !important; }
}

/* ============================================================
   Samsung-style mobile NAVIGATION DRAWER (category pages)
   Full-height drawer sliding in from the RIGHT
   ============================================================ */
@media (max-width: 992px) {
  body.cat-page .mobile-menu-sheet {
    position: fixed !important;
    top: 0 !important;
    left: auto !important;
    right: 0 !important;
    width: min(360px, 88vw) !important;
    max-width: none !important;
    max-height: 100vh !important;
    height: 100vh !important;
    transform: translateX(100%) !important;
    transition: transform 0.3s cubic-bezier(0.6, 0, 0.4, 1) !important;
    border-radius: 0 !important;
    box-shadow: -6px 0 30px rgba(0,0,0,0.18) !important;
    display: flex !important;
    flex-direction: column;
    pointer-events: auto;
    opacity: 1;
    z-index: 2000 !important;
  }
  body.cat-page .mobile-menu-sheet.active {
    transform: translateX(0) !important;
    opacity: 1;
  }
  body.cat-page .mobile-menu-sheet .menu-header {
    background: #0F3334;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0;
    flex: 0 0 auto;
  }
  body.cat-page .mobile-menu-sheet .menu-header img { height: 30px; }
  body.cat-page .mobile-menu-sheet .menu-header .menu-header-brand {
    font-family: 'CalSans', sans-serif;
    font-size: 15px;
    color: #FFFFFF;
    flex: 1;
  }
  body.cat-page .mobile-menu-sheet .menu-close {
    position: static;
    margin-left: auto;
    color: #FFFFFF;
    font-size: 26px;
    opacity: 0.9;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
  }
  body.cat-page .mobile-menu-sheet .menu-search {
    flex: 0 0 auto;
    position: relative;
    padding: 10px 16px;
    border-bottom: 1px solid #EAECEF;
    background: #FFFFFF;
  }
  body.cat-page .mobile-menu-sheet .menu-search i {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 14px;
    pointer-events: none;
  }
  body.cat-page .mobile-menu-sheet .menu-search-input {
    width: 100%;
    padding: 10px 30px 10px 34px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #111827;
    background: #F9FAFB;
    outline: none;
  }
  body.cat-page .mobile-menu-sheet .menu-search-input:focus {
    border-color: #0F3334;
    background: #FFFFFF;
  }
  body.cat-page .mobile-menu-sheet .menu-search-results {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 100%;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    z-index: 5;
    max-height: 220px;
    overflow-y: auto;
    display: none;
  }
  body.cat-page .mobile-menu-sheet .menu-search-results.open { display: block; }
  body.cat-page .mobile-menu-sheet .menu-search-results a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #F3F4F6;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
  }
  body.cat-page .mobile-menu-sheet .menu-search-results a:active,
  body.cat-page .mobile-menu-sheet .menu-search-results a:hover { background: #F3F4F6; }
  body.cat-page .mobile-menu-sheet .menu-list {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    padding: 6px 0;
    margin: 0;
  }
  body.cat-page .mobile-menu-sheet .menu-list li.menu-label {
    font-family: 'CalSans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 20px 6px;
  }
  body.cat-page .mobile-menu-sheet .menu-list li:first-child.menu-label { padding-top: 10px; }
  body.cat-page .mobile-menu-sheet .menu-list li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    color: #111827;
    text-decoration: none;
    font-size: 15px;
    font-family: 'Roboto', sans-serif;
    border-bottom: none;
    transition: background 0.15s;
  }
  body.cat-page .mobile-menu-sheet .menu-list li a:active,
  body.cat-page .mobile-menu-sheet .menu-list li a:hover { background: #F3F6F5; }
  body.cat-page .mobile-menu-sheet .menu-list li a i {
    width: 20px;
    text-align: center;
    color: #0F3334;
    font-size: 15px;
  }
  body.cat-page .mobile-menu-sheet .menu-footer {
    flex: 0 0 auto;
    border-top: 1px solid #EAECEF;
    padding: 14px 20px 20px;
    background: #FFFFFF;
  }
  body.cat-page .mobile-menu-sheet .menu-footer .menu-footer-q {
    margin: 0 0 8px;
    font-size: 13px;
    color: #9CA3AF;
    font-family: 'Inter', sans-serif;
  }
  body.cat-page .mobile-menu-sheet .menu-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
  }
  body.cat-page .mobile-menu-sheet .menu-footer .menu-call-btn {
    background: #0F3334;
    color: #FFFFFF;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    justify-content: center;
    margin-bottom: 8px;
  }
  body.cat-page .mobile-menu-sheet .menu-footer .menu-contact-link {
    color: #0F3334;
    font-size: 14px;
    justify-content: center;
    padding: 4px;
  }
  body.cat-page .mobile-menu-sheet .menu-footer .menu-call-btn i { color: #EBC569; }
  body.cat-page .mobile-menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    display: none;
  }
  body.cat-page .mobile-menu-overlay.active { display: block !important; }
}
