/* ==========================================================================
   ASHRAFUL MADARIS - Responsive Styles
   Mobile-First & Mobile App Native Adaptation
   ========================================================================== */

/* Base Safe Area & Native Touch Settings */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-nav-height: 62px;
}

/* Tablet & Smaller Desktops (< 1024px) */
@media (max-width: 1024px) {
  /* Show Mobile App Bottom Bar */
  .mobile-app-bottom-nav {
    display: block;
  }

  body {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 10px);
  }

  /* Audio player floats above bottom nav */
  .global-audio-player {
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding: 0.6rem 1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  body.audio-playing {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 80px);
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .portal-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 1rem;
  }

  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .audio-player-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
  }

  .player-track-info {
    min-width: unset;
    width: 100%;
    justify-content: space-between;
  }

  .player-controls {
    width: 100%;
    max-width: 100%;
  }
}

/* Mobile Devices (< 768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  html {
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
  }

  .site-header {
    padding-top: var(--safe-top);
    height: calc(var(--header-height) + var(--safe-top));
  }

  .container {
    padding: 0 0.85rem;
  }

  .header-container {
    gap: 0.5rem;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-subtitle {
    display: none;
  }

  .brand-logo-icon {
    width: 38px;
    height: 38px;
  }

  .brand-logo-icon svg {
    width: 22px;
    height: 22px;
  }

  .district-select-wrap {
    padding: 0.25rem 0.45rem;
    font-size: 0.82rem;
  }

  .district-select-wrap select {
    max-width: 72px;
    font-size: 0.82rem;
  }

  /* --------------------------------------------------------------------------
     Home Page Full-Page Mobile App Launcher:
     12 Large, Touch-Friendly Core Icons (3 Columns x 4 Rows) filling the
     entire screen height & width like a native mobile app dashboard.
     -------------------------------------------------------------------------- */
  body.home-page {
    min-height: 100dvh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
  }

  body.home-page .portal-right,
  body.home-page .news-ticker-bar,
  body.home-page .daily-hadith-card,
  body.home-page .site-footer {
    display: none !important;
  }

  /* Compact header on mobile home page */
  body.home-page .site-header {
    flex-shrink: 0;
  }

  /* Compact prayer status bar on mobile home page to give maximum height to icons */
  body.home-page .prayer-status-bar {
    flex-shrink: 0;
    padding: 0.35rem 0.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
  }

  body.home-page .status-bar-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
  }

  body.home-page .dates-block {
    width: auto;
    font-size: 0.76rem;
    gap: 0.3rem;
  }

  body.home-page .next-prayer-card {
    width: auto;
    padding: 0.22rem 0.6rem;
    font-size: 0.78rem;
    gap: 0.4rem;
  }

  body.home-page .next-prayer-card .btn-primary {
    padding: 0.18rem 0.45rem;
    font-size: 0.72rem;
  }

  /* Main Container filling full screen height */
  body.home-page .portal-main,
  body.home-page main.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    padding: 0.4rem 0.65rem calc(var(--bottom-nav-height) + var(--safe-bottom) + 0.5rem);
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  body.home-page .portal-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
  }

  body.home-page .portal-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    margin: 0;
  }

  /* 12 Category App Launcher Grid (3 Columns x 4 Rows = Full Screen Layout) */
  .category-grid,
  body.home-page .category-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: clamp(0.5rem, 1.8vw, 0.75rem);
    width: 100%;
    height: 100%;
    min-height: calc(100dvh - var(--header-height) - var(--bottom-nav-height) - 105px);
    max-width: 100%;
    margin: 0 auto;
    padding: 0.2rem 0;
  }

  /* High-end Mobile Card Tile */
  .category-card,
  body.home-page .category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    padding: clamp(0.6rem, 1.8vh, 1.05rem) 0.3rem;
    border-radius: clamp(16px, 4.2vw, 22px);
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    gap: clamp(0.45rem, 1.4vh, 0.7rem);
    text-align: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0);
  }

  /* Smooth top ambient accent line */
  body.home-page .category-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    background: currentColor;
    opacity: 0.25;
    border-radius: 99px;
  }

  body.home-page .category-card:active {
    transform: scale(0.92);
    box-shadow: 0 2px 10px rgba(13, 120, 87, 0.22);
    background-color: var(--primary-light);
    border-color: var(--border-primary);
  }

  /* Large, Beautiful Icon Box (68px+ on typical mobile) */
  .category-icon-box,
  body.home-page .category-icon-box {
    width: clamp(62px, 16.5vw, 76px);
    height: clamp(62px, 16.5vw, 76px);
    border-radius: clamp(16px, 4.2vw, 22px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  }

  .category-icon-box svg,
  body.home-page .category-icon-box svg {
    width: clamp(32px, 8.5vw, 40px);
    height: clamp(32px, 8.5vw, 40px);
    stroke-width: 2.1;
    transition: transform 0.18s ease;
  }

  body.home-page .category-card:active .category-icon-box svg {
    transform: scale(1.1);
  }

  /* Large, Crisp Bangla Typography */
  .category-title,
  body.home-page .category-title {
    font-size: clamp(0.96rem, 2.9vw, 1.12rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    word-break: keep-all;
    white-space: nowrap;
    text-align: center;
    letter-spacing: -0.01em;
  }

  .category-arrow,
  body.home-page .category-arrow {
    display: none;
  }

  /* --------------------------------------------------------------------------
     12 Vibrant Theme Gradients & Accents for Each Core Icon
     -------------------------------------------------------------------------- */
  /* 1. Quran - Emerald */
  body.home-page .category-card.cat-quran,
  body.home-page .category-card:nth-child(1) { color: #0d7857; }
  body.home-page .category-card.cat-quran .category-icon-box,
  body.home-page .category-card:nth-child(1) .category-icon-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(13, 120, 87, 0.28) 100%);
    color: #0d7857;
    border: 1px solid rgba(13, 120, 87, 0.2);
    box-shadow: 0 6px 18px rgba(13, 120, 87, 0.14);
  }

  /* 2. Books - Sky Teal */
  body.home-page .category-card.cat-books,
  body.home-page .category-card:nth-child(2) { color: #0284c7; }
  body.home-page .category-card.cat-books .category-icon-box,
  body.home-page .category-card:nth-child(2) .category-icon-box {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18) 0%, rgba(2, 132, 199, 0.28) 100%);
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.2);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.14);
  }

  /* 3. Bayan - Royal Indigo */
  body.home-page .category-card.cat-bayan,
  body.home-page .category-card:nth-child(3) { color: #4f46e5; }
  body.home-page .category-card.cat-bayan .category-icon-box,
  body.home-page .category-card:nth-child(3) .category-icon-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(79, 70, 229, 0.28) 100%);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.2);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.14);
  }

  /* 4. Malfuzat - Warm Amber */
  body.home-page .category-card.cat-malfuzat,
  body.home-page .category-card:nth-child(4) { color: #d97706; }
  body.home-page .category-card.cat-malfuzat .category-icon-box,
  body.home-page .category-card:nth-child(4) .category-icon-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.28) 100%);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.2);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.14);
  }

  /* 5. Masail - Rich Violet */
  body.home-page .category-card.cat-masail,
  body.home-page .category-card:nth-child(5) { color: #7e22ce; }
  body.home-page .category-card.cat-masail .category-icon-box,
  body.home-page .category-card:nth-child(5) .category-icon-box {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18) 0%, rgba(126, 34, 206, 0.28) 100%);
    color: #7e22ce;
    border: 1px solid rgba(126, 34, 206, 0.2);
    box-shadow: 0 6px 18px rgba(126, 34, 206, 0.14);
  }

  /* 6. Dua & Durood - Rose Coral */
  body.home-page .category-card.cat-dua,
  body.home-page .category-card:nth-child(6) { color: #e11d48; }
  body.home-page .category-card.cat-dua .category-icon-box,
  body.home-page .category-card:nth-child(6) .category-icon-box {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.18) 0%, rgba(225, 29, 72, 0.28) 100%);
    color: #e11d48;
    border: 1px solid rgba(225, 29, 72, 0.2);
    box-shadow: 0 6px 18px rgba(225, 29, 72, 0.14);
  }

  /* 7. Articles - Cyan Ocean */
  body.home-page .category-card.cat-articles,
  body.home-page .category-card:nth-child(7) { color: #0891b2; }
  body.home-page .category-card.cat-articles .category-icon-box,
  body.home-page .category-card:nth-child(7) .category-icon-box {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.18) 0%, rgba(8, 145, 178, 0.28) 100%);
    color: #0891b2;
    border: 1px solid rgba(8, 145, 178, 0.2);
    box-shadow: 0 6px 18px rgba(8, 145, 178, 0.14);
  }

  /* 8. Al-Irshad - Prestige Gold */
  body.home-page .category-card.cat-irshad,
  body.home-page .category-card:nth-child(8) { color: #b45309; }
  body.home-page .category-card.cat-irshad .category-icon-box,
  body.home-page .category-card:nth-child(8) .category-icon-box {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(202, 138, 4, 0.32) 100%);
    color: #b45309;
    border: 1px solid rgba(202, 138, 4, 0.22);
    box-shadow: 0 6px 18px rgba(202, 138, 4, 0.14);
  }

  /* 9. Madrasah - Forest Emerald */
  body.home-page .category-card.cat-madrasah,
  body.home-page .category-card:nth-child(9) { color: #15803d; }
  body.home-page .category-card.cat-madrasah .category-icon-box,
  body.home-page .category-card:nth-child(9) .category-icon-box {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18) 0%, rgba(21, 128, 61, 0.28) 100%);
    color: #15803d;
    border: 1px solid rgba(21, 128, 61, 0.2);
    box-shadow: 0 6px 18px rgba(21, 128, 61, 0.14);
  }

  /* 10. Namaz - Sunset Orange */
  body.home-page .category-card.cat-namaz,
  body.home-page .category-card:nth-child(10) { color: #c2410c; }
  body.home-page .category-card.cat-namaz .category-icon-box,
  body.home-page .category-card:nth-child(10) .category-icon-box {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.18) 0%, rgba(194, 65, 12, 0.28) 100%);
    color: #c2410c;
    border: 1px solid rgba(194, 65, 12, 0.2);
    box-shadow: 0 6px 18px rgba(194, 65, 12, 0.14);
  }

  /* 11. Donation - Mint Teal */
  body.home-page .category-card.cat-donation,
  body.home-page .category-card:nth-child(11) { color: #0f766e; }
  body.home-page .category-card.cat-donation .category-icon-box,
  body.home-page .category-card:nth-child(11) .category-icon-box {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.18) 0%, rgba(15, 118, 110, 0.28) 100%);
    color: #0f766e;
    border: 1px solid rgba(15, 118, 110, 0.2);
    box-shadow: 0 6px 18px rgba(15, 118, 110, 0.14);
  }

  /* 12. Tasbeeh - Sapphire Blue */
  body.home-page .category-card.cat-tasbeeh,
  body.home-page .category-card:nth-child(12) { color: #1d4ed8; }
  body.home-page .category-card.cat-tasbeeh .category-icon-box,
  body.home-page .category-card:nth-child(12) .category-icon-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(29, 78, 216, 0.28) 100%);
    color: #1d4ed8;
    border: 1px solid rgba(29, 78, 216, 0.2);
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.14);
  }

  /* Dark Mode Adjustments for Category Gradients */
  [data-theme="dark"] body.home-page .category-card.cat-quran .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(1) .category-icon-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(13, 120, 87, 0.42) 100%);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.28);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-books .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(2) .category-icon-box {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(2, 132, 199, 0.42) 100%);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.28);
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-bayan .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(3) .category-icon-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(79, 70, 229, 0.42) 100%);
    color: #818cf8;
    border-color: rgba(129, 140, 248, 0.28);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-malfuzat .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(4) .category-icon-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.42) 100%);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.28);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-masail .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(5) .category-icon-box {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(126, 34, 206, 0.42) 100%);
    color: #c084fc;
    border-color: rgba(192, 132, 252, 0.28);
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-dua .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(6) .category-icon-box {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.25) 0%, rgba(225, 29, 72, 0.42) 100%);
    color: #fb7185;
    border-color: rgba(251, 113, 133, 0.28);
    box-shadow: 0 6px 18px rgba(244, 63, 94, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-articles .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(7) .category-icon-box {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(8, 145, 178, 0.42) 100%);
    color: #22d3ee;
    border-color: rgba(34, 211, 238, 0.28);
    box-shadow: 0 6px 18px rgba(6, 182, 212, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-irshad .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(8) .category-icon-box {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.25) 0%, rgba(202, 138, 4, 0.42) 100%);
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.28);
    box-shadow: 0 6px 18px rgba(234, 179, 8, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-madrasah .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(9) .category-icon-box {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(21, 128, 61, 0.42) 100%);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.28);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-namaz .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(10) .category-icon-box {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.25) 0%, rgba(194, 65, 12, 0.42) 100%);
    color: #fb923c;
    border-color: rgba(251, 146, 60, 0.28);
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-donation .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(11) .category-icon-box {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.25) 0%, rgba(15, 118, 110, 0.42) 100%);
    color: #2dd4bf;
    border-color: rgba(45, 212, 191, 0.28);
    box-shadow: 0 6px 18px rgba(20, 184, 166, 0.18);
  }
  [data-theme="dark"] body.home-page .category-card.cat-tasbeeh .category-icon-box,
  [data-theme="dark"] body.home-page .category-card:nth-child(12) .category-icon-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(29, 78, 216, 0.42) 100%);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.28);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.18);
  }

  /* Prayer Status Bar Mobile Layout */
  .prayer-status-bar {
    padding: 0.6rem 0;
  }

  .status-bar-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .dates-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    gap: 0.4rem;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .date-item svg {
    width: 14px;
    height: 14px;
  }

  .next-prayer-card {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
  }

  .next-prayer-text {
    font-size: 0.85rem;
  }

  .countdown-digits {
    font-size: 0.95rem;
  }

  /* Showcase Section Mobile Pills */
  .showcase-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .showcase-header > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .showcase-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0.45rem;
    padding-bottom: 4px;
    width: 100%;
  }

  .showcase-tabs::-webkit-scrollbar {
    display: none;
  }

  .showcase-tab-btn {
    flex-shrink: 0;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    white-space: nowrap;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
  }

  .showcase-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
  }

  /* Daily Hadith Card Mobile Optimization */
  .daily-hadith-card {
    padding: 1.15rem !important;
  }

  .daily-hadith-card .arabic-text {
    font-size: clamp(1.15rem, 4.5vw, 1.35rem) !important;
    line-height: 1.9 !important;
  }

  .daily-hadith-card p:not(.arabic-text) {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }

  /* News Ticker Bar */
  .news-ticker-bar {
    border-radius: var(--radius-md);
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
  }

  .ticker-label {
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
  }

  /* Mobile Modals as Bottom Sheets */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    width: 100%;
    max-width: 100% !important;
    max-height: 88vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.25rem;
    margin: 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .modal-overlay.open .modal-content,
  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }

  .modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 2;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
}

/* Very Small Phones (< 380px) */
@media (max-width: 380px) {
  body.home-page .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem 0.35rem;
    min-height: calc(100dvh - 165px);
  }

  body.home-page .category-card {
    padding: 0.5rem 0.25rem;
    border-radius: 16px;
    gap: 0.35rem;
  }

  body.home-page .category-icon-box {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  body.home-page .category-icon-box svg {
    width: 28px;
    height: 28px;
  }

  body.home-page .category-title {
    font-size: 0.92rem;
    font-weight: 700;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .lang-switch {
    display: none;
  }
}

/* Mobile Slide-in Drawer Menu */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 250;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-nav-drawer.open {
  display: block;
  opacity: 1;
}

.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 340px;
  height: 100%;
  background: var(--bg-card);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding-top: calc(1.5rem + var(--safe-top));
  padding-bottom: calc(1.5rem + var(--safe-bottom));
}

.mobile-nav-drawer.open .mobile-nav-panel {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active {
  transform: scale(0.97);
}

.mobile-nav-item:hover, .mobile-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

