
/* ===== Popup Overlay ===== */
.popup {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.popup.hidden { display: none; }

.popup-content {
  background: #fff;
  border-radius: 10px;
  width: 90%; max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.4);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {opacity: 0; transform: translateY(-20px);}
  to {opacity: 1; transform: translateY(0);}
}

/* ===== Header ===== */
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #eee;
  margin-bottom: 15px;
}
.popup-header h2 {
  font-size: 20px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}
.close-btn {
  font-size: 26px;
  cursor: pointer;
  color: #888;
  transition: color 0.2s;
}
.close-btn:hover { color: #000; }

/* ===== Main Buttons (top navigation) ===== */
.main-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.main-buttons button {
  background: #004080;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.3s;
}
.main-buttons button:hover,
.main-buttons button.active {
  background: #d4af37;
  color: #000;
}

/* ===== Filter Panels ===== */
.filter-panel {
  display: none;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  background: #d4af37;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.filter-panel.active { display: block; }
.filter-panel h3 {
  margin-bottom: 10px;
  color: #222;
  font-size: 18px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

/* ===== Level 1 Buttons (Maintype) ===== */
.level1-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
  background: rgba(0, 64, 128, 0.08);
  border: 1px solid #004080;
  padding: 10px;
  border-radius: 6px;
}
.level1-buttons button {
  background: #eee;
  border: 1px solid #ccc;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.level1-buttons button:hover,
.level1-buttons button.active {
  background: #004080;
  color: #fff;
  border-color: #004080;
}

/* ===== Subtype Groups ===== */
.subtypes .subtype-group {
  display: none;
  flex-wrap: wrap;
  gap: 2px;
  background: rgba(0, 64, 128, 0.05);
  border: 1px dashed #004080;
  padding: 2px;
  border-radius: 5px;
}
.subtypes .subtype-group.active { display: flex; }

.subtype-group label {
  font-size: 10px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  margin: 2px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: 0.2s;
}
.subtype-group label:has(input:checked) {
  background: blue; /* last defined wins */
  color: #fff;
  font-weight: 600;
}
.subtype-group input { margin-right: 6px; }

/* ===== Chips ===== */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}
.chip {
  background: #f0f0f0;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip i {
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
}
.chip i:hover { color: #000; }

/* ===== Checkbox Style (Allergy) ===== */
#allergy label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}
#allergy input[type="checkbox"] { margin-right: 8px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .main-buttons { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .main-buttons { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .main-buttons { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Generic Labels in Panels ===== */
.filter-panel label {
  font-size: 10px;
  background: #f2f2f2;
  color: #333;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 3px;
  transition: 0.2s;
}
.filter-panel input[type="radio"],
.filter-panel input[type="checkbox"] { margin: 0; }
.filter-panel label:has(input:checked) {
  background: #3b7d3b;
  color: #fff;
  font-weight: 600;
}





.popup-content {
  background: #fff;
  border-radius: 10px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 10px 8px;   /* 🔹 10px top/bottom, 8px left/right */
  box-shadow: 0 5px 20px rgba(0,0,0,0.4);
  animation: fadeIn 0.3s ease;
}


/* === Header icons/links color scheme (scoped) === */
#header-bar .le-btn,
#header-bar .le-btn i {
  color: #ffffff !important;      /* white default */
}

/* Hover/active state */
#header-bar .le-btn:hover,
#header-bar .le-btn:hover i,
#header-bar .le-btn.active,
#header-bar .le-btn.active i {
  color: #004080 !important;      /* bluish rollover/active */
}

/* Smooth color transition */
#header-bar .le-btn,
#header-bar .le-btn i {
  transition: color 0.2s ease-in-out;
}




.browse-detail.hidden { display: none; }
.back-btn {
  display: inline-block;
  margin-bottom: 10px;
  background: #004080;
  color: #fff;
  padding: 6px 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.back-btn:hover { background: #2e7d32; }

.hidden { display: none !important; }



/* === Browse Popup Fixes === */

/* Ensure content stacks correctly */
#browse-popup .custom-modal-content {
  display: block;           /* vertical flow */
  position: relative;
  overflow: visible;
}

/* Back button always on top row */
#browse-popup .custom-modal-content .back-btn {
  display: block;
  width: auto;
  margin: 0 0 12px 0;       /* bottom spacing only */
  background: #004080;      /* dark blue */
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
#browse-popup .custom-modal-content .back-btn:hover {
  background: #2e7d32;      /* green hover */
}

/* Subtype grids always stay inside */
#browse-popup .modal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#browse-popup #spiritSubWrap,
#browse-popup #styleSubWrap,
#browse-popup #complexitySubWrap,
#browse-popup #strengthSubWrap,
#browse-popup #allergySubWrap,
#browse-popup #nutrientSubWrap,
#browse-popup #healthSubWrap {
  margin-top: 12px;
  clear: both;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #browse-popup .modal-grid {
    gap: 6px;                  /* tighter spacing on small screens */
  }
  #browse-popup .custom-modal-content .back-btn {
    font-size: 13px;
    padding: 5px 10px;
  }
}


/* Back button row always on its own line */
#browse-popup .back-row {
  width: 100%;
  margin-bottom: 12px;   /* space between Back and main types */
}

#browse-popup .back-btn {
  display: inline-block;
  background: #004080;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

#browse-popup .back-btn:hover {
  background: #2e7d32;
}

/* Make sure main grid starts below */
#browse-popup .modal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}


/* Default (desktop/tablet) */
#browse-popup .modal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/*MOVED FROM CUSOTM */

/* ===== MODAL OVERLAY ===== */
.browse-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0,0,0,0.65);
  overflow-y: auto;
  padding: 40px 16px;
}

/* Modal box */
.browse-content {
  background: #fff;
  max-width: 900px;
  width: 95%;
  margin: 0 auto;
  padding: 24px;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: fadeInUp .25s ease;
}

/* Close button */
.browse-close {
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 26px;
  cursor: pointer;
  color: #444;
  font-weight: bold;
  transition: color 0.2s ease;
}
.browse-close:hover { color: #e53935; }

/* Grid inside modal */
.browse-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

/* Main categories = 4 per row */
#spirit-main.browse-grid {
  grid-template-columns: repeat(4, 1fr);
}

/* Subtypes = 3 per row */
#subtype-grid.browse-grid {
  grid-template-columns: repeat(3, 1fr);
}

.browse-grid a {
  display: block;
  text-align: center;
  padding: 10px 6px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  color: #2b4e73;
  background: #f1f5f9;
  transition: all 0.2s ease;
}
.browse-grid a:hover {
  background: #2b4e73;
  color: #fff;
}

/* Selected (default for All) */
.browse-grid a.selected {
  background: #2e7d32; /* sober green */
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

/* Group headings */
.browse-group {
  margin-bottom: 22px;
}
.browse-group h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 8px 0 10px;
  color: #2b4e73;
  border-left: 4px solid #f4c637;
  padding-left: 6px;
}

/* Small screen modal */
@media (max-width: 768px) {
  .browse-content {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
    padding: 18px;
    box-sizing: border-box;
  }
  .browse-close {
    top: 12px;
    right: 16px;
    font-size: 28px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Modal Wrapper --- */
.custom-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
}
.custom-modal-content {
  background: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 12px;
  max-width: 900px;
}
.custom-close {
  float: right;
  font-size: 28px;
  cursor: pointer;
}
.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
  gap: 15px;
  margin-top: 20px;
}
.modal-item {
  background: #f0f0f0;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: 0.3s;
}
.modal-item:hover {
  background: #dbeafe;
}
.hidden { display: none; }


/* Modal framework */
.custom-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: none; background: rgba(0,0,0,.65);
}
.custom-modal-content {
  background: #fff; max-width: 900px; width: 95%;
  margin: 48px auto; padding: 22px; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.custom-close {
  float: right; font-size: 28px; cursor: pointer; color: #444;
}
.custom-close:hover { color: #e53935; }
.hidden { display: none; }

/* Grids */
.modal-grid {
  display: grid; gap: 12px; margin-top: 14px;
}
.spirit-main      { grid-template-columns: repeat(4, 1fr); }
.spirit-sub       { grid-template-columns: repeat(3, 1fr); }
.style-cats       { grid-template-columns: repeat(3, 1fr); }
.style-options    { grid-template-columns: repeat(4, 1fr); }

/* Items */
.modal-item {
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 10px 8px; border-radius: 8px;
  font-weight: 700; font-size: 13px; text-decoration: none;
  color: #2b4e73; background: #f1f5f9; transition: .18s;
  cursor: pointer;
}
.modal-item:hover { background: #2b4e73; color: #fff; }

/* Selected state (sober green) */
.modal-item.selected {
  background: #2e7d32; color: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

/* Divider / subheader */
.modal-subheader {
  margin-top: 10px; padding: 6px 8px; font-weight: 800; color: #2b4e73;
  border-left: 4px solid #f4c637; background: #f9fafb; border-radius: 6px;
}

/* Small note */
.empty-note {
  padding: 8px; font-weight: 600; color: #2b4e73; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 8px; margin-top: 10px;
}

/* Mobile tweaks */
@media (max-width: 680px) {
  .custom-modal-content { width: 100%; margin: 0; min-height: 100vh; border-radius: 0; }
  .spirit-main   { grid-template-columns: repeat(4, 1fr); } /* keep 4 */
  .spirit-sub    { grid-template-columns: repeat(3, 1fr); } /* keep 3 */
  .style-cats    { grid-template-columns: repeat(3, 1fr); }
  .style-options { grid-template-columns: repeat(4, 1fr); }
}
.hb-card .hb-desc {
  background: #f9f9f9;    /* light background */
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 10px;
  margin-top: 6px;
  text-align: center;
  color: #333;            /* dark text */
}
.hb-tagline {
  background: #f4f6f9;       /* soft light grey/blue */
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
  margin-top: 6px;
  text-align: center;
  color: #333;
  line-height: 1.4;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.hb-tagline p {
  margin: 0;
}
@media (max-width: 767px) {
  .hb-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 per row on mobile */
    gap: 12px;                              /* a bit tighter spacing */
  }

  .hb-card {
    font-size: 12px;
    padding: 14px 8px;
    min-height: 76px;
  }
  .hb-card i { font-size: 20px; margin-bottom: 6px; }
  .hb-card span { font-size: 11px; }

  /* Tagline tweaks for mobile */
  .hb-tagline {
    font-size: 12px;
    padding: 6px 8px;
    margin-top: 4px;
  }
}

.recipe-footer-box {
  border: 1px solid #ddd;
  background: #fafafa;
  padding: 12px 15px;
  margin-top: 20px;
  border-radius: 6px;
  font-size: 9px;            /* 🔹 very small fine print */
  line-height: 1.4;
  color: #555;
  text-align: justify;       /* 🔹 justified edges */
  font-style: italic;        /* 🔹 poem-like look */
}

.recipe-footer-box p {
  margin-bottom: 10px;       /* space between quotes */
}

.recipe-footer-box p:last-child {
  margin-bottom: 0;
}

.recipe-footer-box a {
  color: #2b4e73;
  font-weight: 500;
  text-decoration: underline;
}

.recipe-footer-box a:hover {
  color: #1448f4;
}

.recipe-footer-box strong {
  font-weight: 600;
  color: #000;
}





/* ===== Namespaced Popup Styles ===== */


/* ===== HOME BROWSE BLOCKS ===== */
.home-browse-blocks {
  text-align: center;
  margin: 3px auto;
}

/* Section Title */
.hb-title {
  text-align: center;
  font-size: 18px; /* sober size */
  font-weight: 800;
  color: #2b4e73;                 /* dark blue */
  margin: 2px auto;
  padding-bottom: 6px;
  border-bottom: 3px solid #f4c637; /* gold underline accent */
  display: inline-block;
}

/* Grid: always 4 columns */
.hb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 900px;
  margin: 16px auto;
}

/* Card base */
.hb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 90px;
  text-align: center;
}

.hb-card i {
  font-size: 24px;
  margin-bottom: 6px;
}

.hb-card span {
  font-size: 13px;
}

/* Blue cards */
.hb-card.blue {
  background: #2b4e73;
}
.hb-card.blue:hover {
  background: #1448f4;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}

/* Red cards (for risk ones) */
.hb-card.red {
  background: #8b1e1e;  /* sober red */
}
.hb-card.red:hover {
  background: #a93232;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}

/* Active/Selected (sober green) */
.hb-card.active {
  background: #2e7d32 !important;  /* green */
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

/* Responsive: keep 4 per row, just shrink */

  .hb-card {
    font-size: 12px;
    padding: 14px 8px;
    min-height: 70px;
  }
  .hb-card i {
    font-size: 20px;
    margin-bottom: 6px;
  }
  .hb-card span {
    font-size: 11px;
  }
}

#searchPopup.popup-overlay {
  display:none;
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  background:rgba(0,0,0,0.6);
  z-index:99999 !important;
}
#searchPopup .popup-box {
  background:#fff !important;
  max-width:600px;
  margin:5% auto;
  padding:20px !important;
  border-radius:10px !important;
  overflow-y:auto;
  max-height:85vh;
  position:relative;
}
#searchPopup .popup-close {
  float:right;
  font-size:24px;
  cursor:pointer;
}
#searchPopup .accordion-item { border-bottom:1px solid #ddd; }
#searchPopup .accordion-header {
  width:100%;
  text-align:left;
  padding:10px;
  background:#f7f7f7;
  font-weight:600;
  cursor:pointer;
  border:none;
}
#searchPopup .accordion-body { display:none; padding:10px; }
#searchPopup .accordion-body.active { display:block; }
#searchPopup .chip-grid {
  display:flex; flex-wrap:wrap; gap:8px; margin:10px 0;
}
#searchPopup .chip {
  padding:6px 12px;
  border:1px solid #ccc;
  border-radius:20px;
  cursor:pointer;
  background:#fafafa;
}
#searchPopup .chip:hover { background:#f1f1f1; }
#searchPopup .radio-group, 
#searchPopup .checkbox-grid {
  margin:10px 0;
  display:flex;
  flex-wrap:wrap;
  gap:15px;
}
#searchPopup .range-labels {
  font-size:12px; margin-top:4px; color:#666;
}
#searchPopup .tabs {
  display:flex; gap:10px; margin:10px 0;
}
#searchPopup .tab {
  flex:1; padding:6px;
  border:1px solid #ccc;
  background:#f7f7f7;
  cursor:pointer;
}
#searchPopup .tab.active {
  background:#ddd; font-weight:600;
}
#searchPopup .btn-apply {
  margin-top:20px;
  padding:10px 20px;
  background:#007bff;
  color:#fff;
  border:none;
  border-radius:5px;
  cursor:pointer;
}
#searchPopup .active-filters { margin:10px 0; }
#searchPopup .active-filters .chip {
  background:#007bff; color:#fff;
}
body {
  background-color: #fafafa;  /* replace with your recipe wrapper’s color */
}
/* Mobile: 2 blocks per row */
@media (max-width: 767px) {
  .hb-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 per row ✅ */
    gap: 12px;
  }

  .hb-card {
    font-size: 12px;
    padding: 14px 8px;
    min-height: 76px;
  }

  .hb-card i { font-size: 20px; margin-bottom: 6px; }
  .hb-card span { font-size: 11px; }
}
/* === Search Filter Breadcrumb Chips (Green + Tick) === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin: 4px;
  background: #2e7d32 !important;   /* site green */
  color: #fff !important;           /* white text */
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  position: relative;
}

.chip::before {
  content: "✓";                    /* tick mark */
  font-size: 12px;
  font-weight: bold;
  margin-right: 4px;
}
.chip i.fa-times {                  /* the remove X */
  margin-left: 6px;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.85;
}
.chip i.fa-times:hover {
  opacity: 1;
}
.chip i.fa-times {                  
  margin-left: 6px;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.85;
  color: #fff;    /* 👈 force white cross */
}
.chip i.fa-times:hover {
  opacity: 1;
  color: #ffcccc; /* 👈 optional: light red on hover */
}
/*new*/
/* === Search Panel Redesign: 3 Columns (Block | Main | Subtype) === */

.filter-panel {
  display: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
  background: #fafafa;
  font-size: 13px; /* reduced font */
}
.filter-panel.active { display: block; }

/* Grid: Block, Main, Subtype */
.filter-panel .search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* Column 1 – Block title */
.filter-panel h3 {
  font-size: 14px;
  margin: 0 0 10px 0;
  color: #2b4e73;
  text-align: left;
}

/* Column 2 – Main types */
.level1-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.level1-buttons label {
  background: #f1f5f9;
  border: 1px solid #ccc;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.level1-buttons input { display: none; }
.level1-buttons input:checked + label {
  background: #2b4e73;
  color: #fff;
  border-color: #2b4e73;
}

/* Column 3 – Subtypes */
.subtypes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.subtypes .subtype-group {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
}
.subtypes .subtype-group.active { display: flex; }
.subtypes .subtype-group label {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.subtypes .subtype-group input { display: none; }
.subtypes .subtype-group input:checked + label {
  background: #2e7d32;
  color: #fff;
}

/* Mobile responsive: stack into rows */
@media (max-width: 768px) {
  .filter-panel .search-grid {
    grid-template-columns: 1fr; /* 1 col stacked */
  }
}



/* Remove side padding on filter panels */
.filter-panel {
  padding: 12px 0;        /* top/bottom only, no left/right */
  margin-bottom: 20px;
}

/* Tighten grid spacing */
.filter-panel .search-grid {
  gap: 0 8px;             /* no horizontal gap, only small vertical */
}

.level1-buttons {
  padding: 0;             /* remove inner padding */
  margin: 0;              /* reset default margin */
  gap: 4px;               /* small gap between items */
  width: 100%;            /* stretch across container */
}
.chip {
  margin: 1px;   /* reduced spacing between chips */
  gap: 4px;      /* optional: tighten icon/text spacing */
}
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;      /* minimal gap between rows */
}
.level1-buttons {
  gap: 2px;        /* very tight space between buttons */
  padding: 2px;    /* remove almost all inner padding */
  margin-bottom: 6px;
}

.level1-buttons button {
  padding: 4px 6px;   /* smaller button size */
  font-size: 12px;    /* optional: smaller text */
}
/* Subtype radios compact */
.subtypes .subtype-group label {
  background: #f9f9f9;
  border: 1px solid #ccc;
  padding: 2px 6px;     /* smaller padding */
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;      /* smaller font */
  line-height: 1.2;
  margin: 1px;          /* tight spacing */
}

.subtypes .subtype-group {
  gap: 2px;             /* less gap between items */
}

.subtypes .subtype-group input { display: none; } /* hide default radio */

/* Active style */
.subtypes .subtype-group input:checked + label {
  background: #004080;
  color: #fff;
  border-color: #004080;
}
/* Compact style for ALL radios in filter panels (main + subtype) */
.filter-panel label {
  background: #f9f9f9;
  border: 1px solid #ccc;
  padding: 2px 6px;        /* very small padding */
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;         /* smaller font */
  line-height: 1.2;
  margin: 1px;             /* minimal spacing */
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.filter-panel input[type="radio"],
.filter-panel input[type="checkbox"] {
  display: none;           /* hide default controls */
}

.filter-panel input:checked + label {
  background: #004080;     /* site blue */
  color: #fff;
  border-color: #004080;
  font-weight: 600;
}
/* Only affect Allergy panel */
/* === Allergy block: match subtype radios look & feel === */
#allergy label {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  margin: 2px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: 0.2s;
}

/* Hide the native box */
#allergy input[type="checkbox"] {
  display: none;
}

/* Turn pill green when selected */
#allergy label:has(input:checked) {
  background: #2e7d32;   /* ✅ site green */
  color: #fff;
  border-color: #2e7d32;
  font-weight: 600;
}

/* Hover effect (optional, like radios) */
#allergy label:hover {
  background: #e6e6e6;
}
/*hidn*/
.filter-panel > h3 {
  position: absolute;   /* take out of flow */
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);  /* hide visually but keep for JS/accessibility */
  white-space: nowrap;
  border: 0;
}
/*btn*/
/* === Apply & Reset buttons styled in site green === */
.popup-footer .apply-btn {
  background: #2e7d32;    /* sober green */
  color: #fff;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.popup-footer .apply-btn:hover {
  background: #256628;    /* darker green */
}

.popup-footer .reset-btn {
  background: transparent;
  border: 2px solid #2e7d32;
  color: #2e7d32;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.popup-footer .reset-btn:hover {
  background: #e8f5e9;    /* light green background */
}
/*button*/
.main-buttons button {
  background: #004080;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;

  padding: 7px 12px !important;   /* 🔹 more vertical padding than 4px */
  font-size: 13px !important;     /* 🔹 slightly bigger text */
  line-height: 1.3 !important;    /* 🔹 text spacing */
  height: auto !important;
  min-height: auto !important;
  transition: background 0.3s;
}

.main-buttons button i {
  font-size: 15px !important;     /* 🔹 icon proportion */
}

.main-buttons {
  gap: 8px !important;            /* 🔹 comfortable spacing between rows */
  grid-auto-rows: min-content !important;
}

/*popupwidh*/
.popup-content {
  background: #fff;
  border-radius: 10px;
  width: 800px;              /* fixed width desktop */
  max-height: 90vh;          /* flexible height */
  overflow-y: auto;          /* scroll inside if needed */
  padding: 20px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.4);
  animation: fadeIn 0.3s ease;
}

/* Mobile override */
@media (max-width: 768px) {
  .popup-content {
    width: 95%;              /* fixed % width for small screens */
    max-width: none;         /* remove 1000px cap */
  }
}

/*keyword*/
.popup {
  display: flex;
  justify-content: center;   /* center horizontally */
  align-items: flex-start;   /* 👈 stick to top */
  padding-top: 40px;         /* optional gap from header */
}


/* Keyword box spacing */
/* Keyword Search Bar */
.keyword-box {
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #2b4e73; /* theme blue */
}

/* Icon */
.keyword-box label {
  display: flex;
  align-items: center;
  font-size: 16px;
  color: #2b4e73;   /* simple blue icon */
  margin-right: 4px;
}

/* Input field */
.keyword-box input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background: #f9fafb;  /* soft light grey */
  color: #333;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Placeholder hint */
.keyword-box input::placeholder {
  color: #999;
  font-style: italic;
}

/* Focus */
.keyword-box input:focus {
  border-color: #2b4e73;   /* theme blue border */
  box-shadow: 0 0 4px rgba(43,78,115,0.25);
  outline: none;
}

/* Mobile full-width */
@media (max-width: 768px) {
  .keyword-box {
    margin-top: 20px;
  }
  .keyword-box input[type="text"] {
    width: 100%;
    font-size: 14px;
    padding: 9px 12px;
  }
}

/* Level 1 main type buttons */
/* 🔹 Force all main type groups (with or without subtypes) to align inline */
.filter-panel .level1-buttons {
  display: flex !important;
  flex-direction: row !important;   /* inline, not stacked */
  flex-wrap: wrap !important;       /* allow wrapping to multiple rows */
  gap: 8px 10px;                    /* spacing between buttons */
}
/* 🔹 Make ALL main type radios look the same, regardless of subtype */
/* 🔹 Align main types with subtypes to match main types without subtypes */
/* === MAIN TYPES: unify look for with/without subtypes === */
.filter-panel .level1-buttons {
  display: flex;
  flex-wrap: wrap;        /* inline like Base */
  gap: 3px;               /* same gap as Base */
}

.filter-panel .level1-buttons label {
  background: #f9f9f9;
  border: 1px solid #ccc;
  padding: 2px 6px;       /* same padding as Base */
  border-radius: 4px;
  font-size: 11px;        /* same font size as Base */
  margin: 1px;            /* same margin as Base */
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.filter-panel .level1-buttons input:checked + label {
  background: #004080;    /* same selected color as Base */
  color: #fff;
  border-color: #004080;
  font-weight: 600;
}
/* === Fix Spirits/Mixers main type alignment === */
.filter-panel .level1-buttons {
  display: flex !important;
  flex-wrap: wrap !important;     /* inline chips like Base */
  flex-direction: row !important; /* no vertical stack */
  gap: 0 !important;              /* remove extra spacing */
}

.filter-panel .level1-buttons label {
  padding: 2px 6px !important;    /* same as Base */
  margin: 1px !important;         /* same tight margin */
  font-size: 11px !important;     /* same font */
}


/*subtype different*/
/* Subtypes container always exists, but groups hidden until active */
.filter-panel .subtypes {
  margin-top: 10px;
  padding-left: 12px;
}

.filter-panel .subtypes .subtype-group {
  display: none;
}

.filter-panel .subtypes .subtype-group.active {
  display: flex;          /* show when JS adds .active */
  flex-wrap: wrap;
  gap: 3px;
}
/*popuptop*/
/* Popup container fills screen but starts from top */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;   /* horizontally centered */
  align-items: flex-start;   /* stick to top */
  padding-top: 0;            /* remove artificial gap */
}

/* Popup box */
.popup-content {
  margin-top: 0;             /* kill margin */
  padding-top: 10px;         /* just a little breathing space inside */
}




/* Kill default form margins inside popup */
#filter-popup form {
  margin: 0; 
  padding: 0;
}

/* Reduce popup-content padding */
.popup-content {
  padding-top: 5px !important;  /* much smaller */
  margin-top: 0 !important;
}

/* Header aligned tightly */
.popup-header {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
/* Compact green crumb chips */
.chip {
  font-size: 10px !important;       /* smaller text */
  font-weight: 500 !important;      /* slightly lighter */
  padding: 2px 6px !important;      /* less height */
  margin: 2px !important;           /* tighter spacing around */
  line-height: 1.2 !important;      /* compact line height */
}


