/* ============================================================
   Shree Shree Laxminarayan Jewellery — Mobile Responsive CSS
   Handles all screen sizes: 480px, 640px, 768px, 992px
   Add this file AFTER style.css — no PHP changes needed
   ============================================================ */

/* ============================================================
   GLOBAL MOBILE IMPROVEMENTS
   ============================================================ */
@media (max-width: 768px) {

  /* Smoother touch scrolling */
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }

  .container { padding: 0 16px; }

  /* Better tap targets */
  a, button { -webkit-tap-highlight-color: rgba(123,28,46,0.1); }

  /* ── TOP BAR: hide on mobile (already in style.css) ── */
  .topbar { display: none; }

  /* ============================================================
     HEADER — MOBILE
     ============================================================ */
  .site-header { position: sticky; top: 0; z-index: 1000; }

  .header-inner {
    padding: 10px 16px;
    gap: 12px;
  }

  /* Logo — smaller on mobile */
  .logo-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 16px !important;
  }
  .logo-icon img {
    height: 38px !important;
    width: 38px !important;
  }
  .logo-main { font-size: 13px !important; }
  .logo-sub  { font-size: 11px !important; }

  /* ── MOBILE NAV — Modern Slide-in Drawer (right side) ── */

  /* Overlay backdrop — sits BEHIND the drawer, ABOVE the page */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42, 26, 14, 0.5);
    z-index: 8000;
    pointer-events: none;
  }
  .nav-overlay.open {
    display: block;
    pointer-events: all;
  }
  @keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }

  /* Drawer panel — hidden by default, slides in on .open */
  .main-nav {
    display: flex !important;
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--white);
    z-index: 9000;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(123,28,46,0.18);
    border-left: 3px solid var(--gold);
    visibility: hidden;
    pointer-events: none;
  }
  .main-nav.open {
    right: 0;
    visibility: visible;
    pointer-events: all;
  }

  /* Drawer header strip — only visible when drawer open */
  .main-nav.open::before {
    content: '';
    display: block;
    min-height: 64px;
    background: linear-gradient(135deg, var(--maroon-dark), var(--maroon));
    border-bottom: 2px solid var(--gold);
    flex-shrink: 0;
  }

  /* Nav links */
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0 40px;
    width: 100%;
    flex: 1;
  }

  .main-nav ul li a {
    padding: 15px 24px;
    border-bottom: 1px solid var(--cream-dark);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.6px;
    color: var(--text-dark);
  }
  .main-nav ul li:first-child a { border-top: none; }

  .main-nav ul li a:hover,
  .main-nav ul li a.active {
    background: var(--cream);
    color: var(--maroon);
    padding-left: 30px;
  }

  /* Mobile dropdown inside drawer */
  .dropdown {
    position: static;
    opacity: 1;
    pointer-events: all;
    transform: none;
    box-shadow: none;
    border-top: none;
    border-left: 3px solid var(--gold);
    margin-left: 20px;
    margin-right: 12px;
    margin-bottom: 4px;
    border-radius: 0 var(--radius) var(--radius) 0;
    display: none;
    background: var(--cream);
  }
  .has-dropdown.open .dropdown { display: block; }
  .dropdown li a {
    font-size: 13px;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(201,150,12,0.12);
    color: var(--text-mid);
  }

  /* Hamburger visible, animates to X */
  .hamburger { display: flex; z-index: 9999; position: relative; }
  .hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ============================================================
     HERO SLIDER — MOBILE
     ============================================================ */
  .hero-slider { min-height: 380px; }

  .hero-content {
    padding: 48px 20px 60px;
  }

  .hero-badge {
    font-size: 11px;
    padding: 5px 14px;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
  }

  .hero-title {
    font-size: clamp(22px, 7vw, 32px) !important;
    margin-bottom: 12px;
    line-height: 1.25;
  }

  .hero-sub {
    font-size: 15px;
    margin-bottom: 24px;
  }

  /* Stack hero buttons vertically */
  .hero-content .btn {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 0 auto 10px;
    text-align: center;
  }
  .hero-content .btn-outline {
    margin-left: auto;
  }

  .slider-dots { bottom: 14px; }

  /* ============================================================
     RATES TICKER — MOBILE
     ============================================================ */
  .ticker-label {
    padding: 10px 14px;
    font-size: 11px;
    letter-spacing: 1px;
  }
  .ticker-scroll { padding: 10px 0; }
  .ticker-item { font-size: 12px; }

  /* ============================================================
     SECTION COMMON — MOBILE
     ============================================================ */
  .section { padding: 44px 0; }
  .section-header { margin-bottom: 32px; }
  .section-title { font-size: clamp(20px, 5vw, 28px) !important; }
  .section-sub { font-size: 15px; }

  /* ============================================================
     RATES SECTION — MOBILE
     ============================================================ */
  .rates-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .rates-card-header { padding: 16px 18px; }
  .rates-card-header h3 { font-size: 17px; }
  .rates-icon { width: 42px; height: 42px; font-size: 18px; }

  .rates-table th,
  .rates-table td {
    padding: 11px 14px;
    font-size: 13px;
  }
  .rate-value { font-size: 14px; }

  /* ============================================================
     CATEGORIES GRID — MOBILE
     ============================================================ */
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .cat-card { padding: 20px 10px 16px; border-radius: 12px; }
  .cat-icon { width: 48px; height: 48px; font-size: 18px; margin-bottom: 10px; }
  .cat-name { font-size: 12px; }

  /* ============================================================
     PRODUCTS GRID — MOBILE (3 columns)
     ============================================================ */
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .product-card { border-radius: 10px; }
  .product-img-wrap { padding-top: 100%; }
  .product-info { padding: 8px 8px 10px; }
  .product-cat { font-size: 9px; letter-spacing: 0.8px; margin-bottom: 3px; }
  .product-name { font-size: 12px; margin-bottom: 4px; line-height: 1.3; }
  .product-meta { font-size: 10px; gap: 6px; margin-bottom: 5px; flex-wrap: wrap; }
  .product-meta span { display: flex; align-items: center; gap: 3px; }
  .product-price { font-size: 13px; }
  .product-price-note { font-size: 9px; }
  .product-enquire { padding: 7px 6px; font-size: 11px; margin-top: 7px; border-radius: 6px; }
  .product-badge { font-size: 9px; padding: 2px 6px; top: 6px; left: 6px; }

  /* View More button */
  .mobile-view-more {
    display: block;
    width: 100%;
    margin: 20px auto 0;
    padding: 13px 0;
    background: transparent;
    border: 1.5px solid var(--gold);
    border-radius: 6px;
    color: var(--maroon);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  .mobile-view-more:hover, .mobile-view-more:active {
    background: var(--gold);
    color: var(--maroon-dark);
  }
  .mobile-view-more i { margin-right: 6px; }

  /* Hidden products (shown after View More click) */
  .product-card.mobile-hidden {
    display: none;
  }

  /* ============================================================
     TESTIMONIALS — MOBILE
     ============================================================ */
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .testi-card { padding: 24px 20px; border-radius: 12px; }
  .testi-card::before { font-size: 60px; top: 12px; left: 14px; }
  .testi-msg { font-size: 15px; }
  .testi-name { font-size: 15px; }

  /* ============================================================
     WHY US — MOBILE
     ============================================================ */
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .why-card { padding: 26px 14px; border-radius: 12px; }
  .why-icon { width: 56px; height: 56px; font-size: 22px; margin-bottom: 14px; }
  .why-title { font-size: 15px; }
  .why-desc { font-size: 13px; }

  /* ============================================================
     ABOUT — MOBILE
     ============================================================ */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-img-wrap img { height: 260px !important; }
  .about-img-badge { bottom: 16px; right: 16px; padding: 12px 16px; }
  .about-img-badge .num { font-size: 28px; }
  .about-img-badge .lbl { font-size: 11px; }
  .about-text h2 { font-size: 24px; }
  .about-text p { font-size: 15px; }

  /* ============================================================
     CONTACT — MOBILE
     ============================================================ */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .contact-form { padding: 24px 18px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-group label { font-size: 13px; }
  .form-group input,
  .form-group textarea {
    font-size: 16px; /* prevents zoom on iOS */
    padding: 12px 14px;
  }

  /* ============================================================
     PAGE HERO — MOBILE
     ============================================================ */
  .page-hero { padding: 36px 0; }
  .page-hero h1 { font-size: clamp(20px, 6vw, 30px) !important; }
  .page-hero p { font-size: 14px; }
  .breadcrumb { font-size: 12px; margin-top: 10px; }

  /* ============================================================
     FOOTER — MOBILE
     ============================================================ */
  .footer-top { padding: 40px 0 28px; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-col h4 { font-size: 15px; margin-bottom: 14px; }
  .footer-col ul li a { font-size: 13px; }
  .footer-contact li { font-size: 13px; }
  .footer-logo { font-size: 16px; }
  .footer-tagline { font-size: 13px; }
  .footer-cert { font-size: 11px; }
  .footer-bottom { font-size: 12px; padding: 14px 0; }

  /* ============================================================
     WHATSAPP FLOAT — MOBILE
     ============================================================ */
  .whatsapp-float {
    bottom: 20px;
    right: 16px;
    width: 50px;
    height: 50px;
    font-size: 22px;
  }

  /* ============================================================
     ADMIN — MOBILE
     ============================================================ */
  .admin-topbar { flex-wrap: wrap; gap: 8px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .admin-table { font-size: 13px; }
  .admin-table th, .admin-table td { padding: 10px 12px; }

}

/* ============================================================
   VERY SMALL SCREENS (max 480px)
   ============================================================ */
@media (max-width: 480px) {

  .container { padding: 0 12px; }

  /* Keep 3 col on very small screens too, just tighter */
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .product-name { font-size: 11px; }
  .product-price { font-size: 12px; }
  .product-enquire { font-size: 10px; padding: 6px 4px; }

  /* 3 col categories */
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }

  .why-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* Hero */
  .hero-content { padding: 40px 16px 52px; }
  .hero-title { font-size: clamp(20px, 8vw, 26px) !important; }

  /* Product cards single col */
  .product-info { padding: 14px; }
  .product-name { font-size: 16px; }
  .product-price { font-size: 18px; }

  /* Rates table scrollable */
  .rates-card { overflow-x: auto; }
  .rates-table { min-width: 280px; }

  /* Stats smaller */
  .stats-grid { grid-template-columns: 1fr 1fr !important; }

  /* Footer 2 col quick links */
  .footer-grid { grid-template-columns: 1fr; }

  .section { padding: 36px 0; }
  .section-header { margin-bottom: 24px; }

}

/* ============================================================
   MEDIUM SCREENS (481px — 768px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 768px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   TABLET (769px — 992px)
   ============================================================ */
@media (min-width: 769px) and (max-width: 992px) {

  .container { padding: 0 24px; }

  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .rates-grid { grid-template-columns: 1fr; gap: 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr 1fr; }

  .hero-content { padding: 64px 24px; }
  .hero-title { font-size: clamp(26px, 5vw, 40px) !important; }

  .section { padding: 56px 0; }

  /* Nav still visible on tablet */
  .hamburger { display: none; }
  .main-nav { display: flex !important; position: static; right: auto; width: auto; height: auto; box-shadow: none; border-left: none; flex-direction: row; overflow-y: visible; }
}

/* ============================================================
   UTILITY — MOBILE ONLY HELPERS
   ============================================================ */
@media (max-width: 768px) {

  /* Text alignment helpers */
  .mobile-center { text-align: center !important; }
  .mobile-left   { text-align: left !important; }

  /* Spacing helpers */
  .mobile-mt-0 { margin-top: 0 !important; }
  .mobile-mb-0 { margin-bottom: 0 !important; }

  /* Hide on mobile */
  .desktop-only { display: none !important; }

  /* Show on mobile */
  .mobile-only { display: block !important; }

  /* Full width on mobile */
  .mobile-full { width: 100% !important; }

  /* Better button sizing on mobile */
  .btn {
    padding: 12px 24px;
    font-size: 13px;
    letter-spacing: 0.8px;
  }

  /* Prevent horizontal overflow */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Image quality */
  img { image-rendering: -webkit-optimize-contrast; }

  /* Smooth scrolling for anchor links */
  html { scroll-padding-top: 70px; } /* accounts for sticky header */

}

/* ============================================================
   TOUCH DEVICE IMPROVEMENTS
   ============================================================ */
@media (hover: none) and (pointer: coarse) {

  /* Remove hover transforms on touch — feels laggy */
  .product-card:hover { transform: none; }
  .cat-card:hover { transform: none; }
  .testi-card:hover { transform: none; }
  .why-card:hover { transform: none; }

  /* Keep visual feedback via active state instead */
  .product-card:active { transform: scale(0.98); }
  .cat-card:active { transform: scale(0.97); }
  .btn:active { transform: scale(0.97); opacity: 0.9; }

  /* Larger tap targets */
  .main-nav ul li a { min-height: 52px; }
  .footer-col ul li a { min-height: 44px; }
  .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }

}

/* ============================================================
   ADMIN PANEL MOBILE (admin pages)
   ============================================================ */
@media (max-width: 768px) {

  /* Admin sidebar collapses */
  .admin-sidebar {
    position: fixed;
    left: -280px;
    top: 0; bottom: 0;
    width: 260px;
    z-index: 9000;
    transition: left 0.3s ease;
    overflow-y: auto;
  }
  .admin-sidebar.open { left: 0; }

  .admin-main {
    margin-left: 0 !important;
    padding: 16px !important;
  }

  .admin-topbar {
    padding: 12px 16px;
    gap: 10px;
  }

  /* Admin stats grid 2 col on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* Admin tables scrollable */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-form { padding: 16px !important; }
  .form-grid-2 { grid-template-columns: 1fr !important; }
  .form-grid-3 { grid-template-columns: 1fr !important; }

  /* Admin cards full width */
  .admin-card { border-radius: 10px; }
  .admin-card-body { padding: 16px; }

}
