/* 1. LAYOUT CONTAINERS & Z-INDEX */
.navbar, .offcanvas, .announcement-bar {
  z-index: 2000 !important;
}

.category-sidebar {
  position: sticky;
  top: 70px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1) !important; 
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1050 !important;
  border-bottom: 1px solid #eee;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
}

.sub-nav-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* 2. FLIPPER (Title & Arrows) */
.main-cat-flipper {
  display: grid;
  /* Columns: [Left Arrow 50px] [Gap 15px] [Word 220px] [Gap 15px] [Right Arrow 50px] */
  grid-template-columns: 50px 220px 50px; 
  justify-content: center; /* Centers the entire grid on screen */
  align-items: center;
  gap: 20px;               /* Fixed extra distance between arrows and box */
  padding: 0 15px;
  margin-bottom: 0px;
}

.current-main-cat 
{
  /* FIXED WIDTH - The box will NEVER change size */
  width: 100%;             
  text-align: center;      
  
  font-weight: 800;
  font-size: 0.9rem;
  background: linear-gradient(to right, #42adad 30%, #0c2626 70%);
  color: #fff;
  border-radius: 10px;
  padding: 10px 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;     
  overflow: hidden;        /* Prevents text from pushing the box wider */
  text-overflow: ellipsis; /* Adds "..." if a word is impossibly long */
  display: block;
}

.flip-arrow {
  background: none;
  border: none;
  font-size: 1.8rem;
  font-weight: 900;
  color: #dc3545;
  transition: transform 0.2;
  
  /* THICKER & WIDER */
  -webkit-text-stroke: 1.5px #dc3545; 
  transform: scaleX(1.7);   /* Ultra-wide arrows */
  
  /* ARROW STABILIZER */
  width: 100%;             /* Fills the 50px grid column perfectly */
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

/* Maintain position during click */
.flip-arrow:active { 
  transform: scaleX(1.7) scale(0.9); 
}

/* 3. SUB-CATEGORY CHIPS */
.sub-chip-container {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 8px 15px;
  gap: 8px;
  width: 100%;
  scrollbar-width: none;
}
.sub-chip-container::-webkit-scrollbar { display: none; }

.sub-chip {
  background: #f1f1f1;
  color: #444;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.8rem;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid #ddd;
  transition: 0.3s;
}
.sub-chip:hover { background: #dc3545; color: white; border-color: #dc3545; }

/* 4. NAVIGATION BUTTONS */
.nav-btn {
  display: none;
  background: rgba(255, 255, 255, 0.6);
  border: none;
  font-size: 1.2rem;
  color: #888;
  padding: 5px 10px;
  z-index: 5;
}
.nav-btn.visible { display: block; }
.nav-btn:active { color: #dc3545; }

/* 5. ANCHOR SCROLLING FIX */
.py-5[id] {
  scroll-margin-top: 66px;
}

/* 6. RESPONSIVE: SHORT SCREENS (Landscape) */
@media screen and (max-height: 650px) {
  .navbar-styled {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
  }

  /* Shrink Search Bar & Inputs */
  .search-form {
    max-width: 180px !important; /* Limits width so it doesn't crowd icons */
    margin: 0 5px !important;
  }

  .search-form .input-group,
  .search-form .form-control,
  .search-form .input-group-text {
    height: 28px !important; /* Slimmer height */
    font-size: 0.75rem !important; /* Smaller text */
    padding: 0 5px !important;
  }

  .navbar-brand, .nav-link {
    font-size: 0.85rem !important;
    padding: 0 5px !important;
  }

  .category-sidebar {
    top: 40px !important;
    padding: 2px 0 !important;
  }

  .main-cat-flipper {
    margin-bottom: 2px !important;
    padding: 0 10px !important;
  }

  .current-main-cat { font-size: 0.85rem !important; }
  .flip-arrow { font-size: 1.1rem !important; }

  .sub-chip-container {
    padding: 2px 10px !important;
    gap: 5px !important;
  }

  .sub-chip {
    padding: 2px 12px !important;
    font-size: 0.7rem !important;
  }

  .py-5[id] {
    scroll-margin-top: 80px !important;
  }
}
