/* =============================================
   MOBILE HEADER & BOTTOM NAV - MOBILE ONLY
   Mobile-first responsive design
   ============================================= */

@media (max-width: 991px) {

  /* ── HIDE ALL DESKTOP HEADER ELEMENTS ── */
  .main-header,
  .main-nav,
  .navbar-main,
  header.site-header,
  header.navbar,
  .header-container,
  .top-bar,
  .header-top,
  .navbar-nav.desktop-nav,
  .header-search-bar,
  .header-cart,
  .header-wishlist,
  .header-account,
  .desktop-only,
  .header-icons,
  .login-text,
  .search-bar,
  nav.navbar,
  .mobile-nav {
    display: none !important;
  }

  /* ── Mobile Header Bar ── */
  #mobile-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: fixed; /* make header always fixed at top */
    top: 0;
    z-index: 1050;
    height: 56px;
    width: 100%;
    left: 0;
    right: 0;
  }

  #mobile-header .mobile-logo {
    flex: 0 0 auto;
  }

  #mobile-header .mobile-logo a {
    display: flex;
    align-items: center;
  }

  #mobile-header .mobile-logo img {
    max-height: 36px;
    width: auto;
    display: block;
  }

  #mobile-header .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
  }

  #mobile-header .mobile-header-actions a,
  #mobile-header .mobile-header-actions button {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    transition: color 0.2s;
  }

  #mobile-header .mobile-header-actions a:hover,
  #mobile-header .mobile-header-actions button:hover {
    color: #1a73e8;
  }

  #mobile-header .mobile-header-actions svg {
    width: 20px;
    height: 20px;
  }

  #mobile-header .mobile-header-actions .badge-count {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #e53935;
    color: #fff;
    font-size: 9px;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: bold;
  }

  #mobile-header .mobile-header-actions .badge-count:empty,
  #mobile-header .mobile-header-actions .badge-count[data-count="0"] {
    display: none;
  }

  /* ── Sidebar Overlay ── */
  #mobile-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1200;
    animation: fadeIn 0.2s ease;
  }

  #mobile-sidebar-overlay.active {
    display: block;
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* ── Mobile Sidebar ── */
  #mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: #ffffff;
    z-index: 1300;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }

  #mobile-sidebar.open {
    left: 0;
  }

  #mobile-sidebar .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
    flex-shrink: 0;
  }

  #mobile-sidebar .sidebar-header img {
    max-height: 32px;
    width: auto;
  }

  #mobile-sidebar .sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
  }

  #mobile-sidebar .sidebar-close:hover {
    color: #000;
  }

  #mobile-sidebar .sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
  }

  /* Nav Links */
  #mobile-sidebar .sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  #mobile-sidebar .sidebar-nav li {
    margin: 0;
  }

  #mobile-sidebar .sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s;
  }

  #mobile-sidebar .sidebar-nav li a:active,
  #mobile-sidebar .sidebar-nav li a:hover {
    color: #1a73e8;
    background: #f0f4ff;
  }

  #mobile-sidebar .sidebar-nav li a svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
  }

  /* Categories Section */
  #mobile-sidebar .sidebar-categories-section {
    border-top: 8px solid #f5f5f5;
    margin-top: 8px;
    padding-top: 12px;
  }

  #mobile-sidebar .sidebar-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    padding: 12px 18px 8px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  #mobile-sidebar .sidebar-categories-list {
    display: flex;
    flex-direction: column;
  }

  #mobile-sidebar .sidebar-categories-list a {
    display: block;
    padding: 10px 24px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #efefef;
    transition: all 0.2s;
  }

  #mobile-sidebar .sidebar-categories-list a:active,
  #mobile-sidebar .sidebar-categories-list a:hover {
    color: #1a73e8;
    background: #f9f9f9;
    padding-left: 28px;
  }

  /* ── Mobile Search Bar ── */
  #mobile-search-bar {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1040;
    animation: slideDown 0.2s ease;
  }

  #mobile-search-bar.active {
    display: block;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  #mobile-search-bar .search-inner {
    display: flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fafafa;
  }

  #mobile-search-bar input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 9px 12px;
    font-size: 14px;
    background: transparent;
    color: #333;
  }

  #mobile-search-bar input[type="text"]::placeholder {
    color: #999;
  }

  #mobile-search-bar button[type="submit"] {
    background: #1a73e8;
    border: none;
    color: #fff;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
  }

  #mobile-search-bar button[type="submit"]:active {
    background: #1557b0;
  }

  /* ── Bottom Navigation Bar ── */
  #mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid #e8e8e8;
    z-index: 1050;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    width: 100%;
  }

  #mobile-bottom-nav .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #666;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px 4px;
    margin: 0;
    transition: color 0.2s;
    text-align: center;
    position: relative;
    min-width: 0;
  }

  #mobile-bottom-nav .bottom-nav-item:active,
  #mobile-bottom-nav .bottom-nav-item:hover {
    color: #1a73e8;
  }

  #mobile-bottom-nav .bottom-nav-item svg,
  #mobile-bottom-nav .bottom-nav-item i {
    font-size: 18px;
    line-height: 1;
    width: 20px;
    height: 20px;
  }

  #mobile-bottom-nav .bottom-nav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60px;
  }

  #mobile-bottom-nav .bottom-nav-item .nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #e53935;
    color: #fff;
    font-size: 8px;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
  }

  /* ── Body adjustments ── */
  body {
    padding-bottom: 60px !important;
  }

  /* Prevent scrollbar layout shift */
  html {
    overflow-y: scroll;
  }

  /* Mobile-only circular categories slider */
  .category-aligned-container .category-circle-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 12px; /* allow space for first/last items */
    margin: 0; /* remove negative gutters */
  }

  /* ensure bootstrap row class doesn't wrap */
  .category-aligned-container .category-circle-wrapper.row {
    flex-wrap: nowrap !important;
  }

  /* ensure wrapper children sit inline instead of using bootstrap grid widths */
  .category-aligned-container .category-circle-wrapper > div {
    flex: 0 0 auto;
    min-width: 80px; /* ensure item not shrunk, bigger than before */
    width: auto;
    margin: 0 8px; /* spacing between items */
    scroll-snap-align: start;
  }

  /* override bootstrap column behaviour on mobile for this section */
  .category-aligned-container .category-circle-wrapper .col-6,
  .category-aligned-container .category-circle-wrapper .col-sm-4,
  .category-aligned-container .category-circle-wrapper .col-md-3,
  .category-aligned-container .category-circle-wrapper .col-lg-2 {
    width: auto !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
  }

  .category-aligned-container .category-circle-wrapper::-webkit-scrollbar {
    display: none;
  }
  /* hide sticky desktop container on mobile */
  #sticky-navbar,
  #sticky-navbar .sticky-container,
  .sticky-container {
    display: none !important;
  }

  /* Explicitly hide desktop slider on mobile */
  .category-circle-wrapper {
    display: none !important;
  }

  /* Explicitly show mobile slider on mobile */
  .category-mobile-slider {
    display: flex !important;
  }
}

/* ═══════════════════════════════════════════════
   DESKTOP LAYOUT - 992px and up
   ═══════════════════════════════════════════════ */
@media (min-width: 992px) {
  #mobile-header,
  #mobile-sidebar,
  #mobile-sidebar-overlay,
  #mobile-search-bar,
  #mobile-bottom-nav {
    display: none !important;
  }

  body {
    padding-bottom: 0 !important;
  }

  /* Show desktop slider on desktop */
  .category-circle-wrapper {
    display: flex !important;
  }

  /* Hide mobile slider on desktop */
  .category-mobile-slider {
    display: none !important;
  }
}
