/* =============================
   STORE PAGE - SIDEBAR STYLES
   ============================= */

.store-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.store-sidebar {
  position: sticky;
  top: 120px;
  background: #fff;
  border: 1px solid #e5eef7;
  border-radius: 12px;
  padding: 20px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(10, 58, 115, 0.08);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 800;
  color: #0a3a73;
  margin: 0;
  flex: 1;
}

.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: #0067b8;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  display: none;
}

.sidebar-collapse-btn:hover {
  color: #0a3a73;
}

/* Search Box */
.sidebar-search {
  margin-bottom: 20px;
}

.sidebar-search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  font-size: 13px;
  color: #0a3a73;
  outline: none;
  transition: all 0.3s ease;
}

.sidebar-search input:focus {
  border-color: #0067b8;
  box-shadow: 0 0 0 3px rgba(0, 103, 184, 0.1);
}

/* Categories Section */
.sidebar-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5eef7;
}

.sidebar-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #0a3a73;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-section-icon {
  font-size: 14px;
  color: #0067b8;
}

/* Category List */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-item {
  margin-bottom: 8px;
}

.category-link,
.subcategory-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #153a5f;
  font-size: 13px;
  font-weight: 600;
  background: #fdfefe;
  border: 1px solid #edf2f8;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
}

.category-link:hover,
.subcategory-link:hover {
  background: #f2f8ff;
  border-color: #c8dff5;
  color: #0a3a73;
}

.category-link.active,
.subcategory-link.active {
  background: #0067b8;
  color: #fff;
  border-color: #0067b8;
  font-weight: 700;
}

.category-name {
  flex: 1;
}

.product-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: rgba(0, 103, 184, 0.15);
  color: #0067b8;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

.category-link.active .product-count {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* Subcategories */
.subcategory-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.category-item.expanded .subcategory-list {
  max-height: 500px;
}

.subcategory-item {
  margin-bottom: 6px;
  margin-left: 12px;
}

.desktop-filter-view.hidden {
  display: none;
}

.desktop-category-list,
.desktop-subcategory-list {
  display: grid;
  gap: 8px;
}

.desktop-category-link,
.desktop-subcategory-link,
.desktop-subcategory-all {
  border: 1px solid #edf2f8;
}

.desktop-sub-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.desktop-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #eef5fc;
  color: #0a3a73;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.desktop-parent-chip {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0067b8 0%, #0a3a73 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.desktop-sub-panel {
  display: none;
}

.desktop-sub-panel.visible {
  display: block;
}

.desktop-subcategory-list {
  margin-top: 10px;
}

/* Category Toggle */
.category-toggle {
  position: relative;
  width: 100%;
}

.toggle-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
  color: #0067b8;
}

.category-item.expanded .toggle-arrow {
  transform: rotate(180deg);
}

/* Fullscreen Button */
.store-fullscreen-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0067b8 0%, #0052a3 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 103, 184, 0.3);
  transition: all 0.3s ease;
}

.store-fullscreen-toggle:hover {
  background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
  box-shadow: 0 6px 16px rgba(0, 103, 184, 0.4);
  transform: scale(1.05);
}

.store-fullscreen-toggle:active {
  transform: scale(0.95);
}

/* Fullscreen Mode */
body.store-fullscreen {
  background: #fff;
}

body.store-fullscreen .pn-header {
  display: none;
}

body.store-fullscreen .store-container {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 20px !important;
}

body.store-fullscreen .store-fullscreen-toggle i::before {
  content: '\f065'; /* fa-compress */
}

/* ============================================================
   MOBILE FILTER: Barre sticky + Drawer 2 vues
   (visible ≤1024px, masqué sur desktop)
   ============================================================ */

/* ── Desktop: masquer les éléments mobile ── */
@media (min-width: 1025px) {
  .store-mfbar,
  .smfd-overlay,
  .store-mobile-drawer {
    display: none !important;
  }

  /* If opened by script, force visibility even on desktop widths */
  .smfd-overlay.open {
    display: block !important;
  }

  .store-mobile-drawer.open {
    display: flex !important;
  }
}

/* ── Mobile layout ── */
@media (max-width: 1024px) {
  .store-container {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .store-sidebar { display: none; }
}

/* ── Barre filtre sticky ── */
@media (max-width: 1024px) {
  .store-mfbar {
    position: sticky;
    top: 62px;
    z-index: 90;
    background: #fff;
    border-bottom: 2px solid #e8f0fa;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(10,58,115,.07);
    margin-bottom: 12px;
  }
  .smfb-active {
    flex: 1; display: flex; align-items: center;
    gap: 8px; min-width: 0; overflow: hidden;
  }
  .smfb-all {
    color: #7a9cbf; font-size: 13px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .smfb-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: #e8f3fc; color: #0a3a73; border-radius: 999px;
    padding: 5px 12px; font-size: 12px; font-weight: 700;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .smfb-rem {
    color: #0067b8; display: flex; align-items: center;
    flex-shrink: 0; text-decoration: none; font-size: 11px; margin-left: 2px;
  }
  .smfb-btn {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; background: #0067b8; color: #fff;
    border: none; border-radius: 999px; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: background .2s; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,103,184,.25);
  }
  .smfb-btn:hover, .smfb-btn:active { background: #0052a3; }
}

/* ── Overlay ── */
.smfd-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(5,25,55,.55); z-index: 1099;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.smfd-overlay.open { display: block; }

/* ── Drawer ── */
.store-mobile-drawer {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: min(94vw, 560px);
  height: min(calc(100vh - 90px), 760px);
  max-height: calc(100vh - 90px);
  min-height: 460px;
  background: #fff;
  border-radius: 18px;
  display: none;
  flex-direction: column;
  box-shadow: 0 18px 48px rgba(10,58,115,.24);
  overflow: hidden;
}
.store-mobile-drawer.open {
  display: flex;
  animation: smfdPopIn .18s ease;
}

@keyframes smfdPopIn {
  from { transform: translateX(-50%) scale(.98); opacity: 0; }
  to   { transform: translateX(-50%) scale(1); opacity: 1; }
}

.smfd-drag-handle {
  display: none;
}

/* Header */
.smfd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 10px; border-bottom: 1px solid #edf2f8; flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}
.smfd-title {
  font-size: 16px; font-weight: 800; color: #0a3a73;
  display: flex; align-items: center; gap: 8px;
}
.smfd-title i { color: #0067b8; }
.smfd-close-btn {
  background: #f3f7fc; border: none; border-radius: 50%;
  width: 34px; height: 34px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: #0a3a73;
  font-size: 14px; transition: background .2s; flex-shrink: 0;
}
.smfd-close-btn:hover { background: #dceaf6; }

/* Body scrollable (overflow sur les vues, pas le drawer) */
.smfd-body {
  flex: 1; overflow: hidden; position: relative;
}

/* ── Les 2 vues ── */
.smfd-view {
  position: absolute; inset: 0;
  overflow-y: auto; padding: 16px 20px 12px;
  -webkit-overflow-scrolling: touch;
  transition: transform .26s cubic-bezier(.4,0,.2,1), opacity .26s;
}

/* Vue 1 : catégories (par défaut visible) */
#smfdViewCats { transform: translateX(0); opacity: 1; }
#smfdViewCats.hidden { transform: translateX(-100%); opacity: 0; pointer-events: none; }
#smfdViewCats.slide-out-left { transform: translateX(-100%); opacity: 0; }

/* Vue 2 : sous-catégories (cachée par défaut à droite) */
#smfdViewSubs { transform: translateX(100%); opacity: 0; pointer-events: none; }
#smfdViewSubs.hidden { transform: translateX(100%); opacity: 0; pointer-events: none; }
#smfdViewSubs:not(.hidden) { transform: translateX(0); opacity: 1; pointer-events: auto; }
#smfdViewSubs.slide-in { animation: smfdSlideInRight .26s cubic-bezier(.4,0,.2,1) forwards; }
#smfdViewSubs.slide-out-right { transform: translateX(100%); opacity: 0; }

@keyframes smfdSlideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Recherche ── */
.smfd-search-wrap {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.smfd-search {
  flex: 1; position: relative; display: flex; align-items: center;
}
.smfd-search-ico {
  position: absolute; left: 13px; color: #9ab3d0; font-size: 13px;
  pointer-events: none; z-index: 1;
}
.smfd-search input {
  width: 100%; padding: 11px 36px 11px 36px;
  border: 1.5px solid #dbe7f3; border-radius: 12px;
  font-size: 13px; color: #0a3a73; background: #f7fbff;
  outline: none; transition: border-color .2s, background .2s;
}
.smfd-search input:focus { border-color: #0067b8; background: #fff; }
.smfd-search-clear {
  position: absolute; right: 10px; background: transparent; border: none;
  color: #9ab3d0; cursor: pointer; font-size: 15px;
  display: none; align-items: center; padding: 4px;
}
.smfd-search-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 16px; background: #0067b8; color: #fff;
  border: none; border-radius: 12px; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background .2s;
  box-shadow: 0 2px 8px rgba(0,103,184,.25);
}
.smfd-search-btn:hover { background: #0052a3; }

.smfd-divider {
  height: 1px; background: #edf2f8; margin: 0 0 16px;
}

/* ── Premium collapsible sections ── */
.smfd-section-toggle {
  width: 100%;
  border: 0;
  background: #f5f9fe;
  color: #0a3a73;
  border-radius: 10px;
  padding: 9px 12px;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.smfd-collapsible {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .2s ease, opacity .2s ease;
}

.smfd-collapsible.open {
  max-height: 800px;
  opacity: 1;
}

/* ── Section label ── */
.smfd-section-label {
  font-size: 11px; font-weight: 800; color: #9ab3d0;
  text-transform: uppercase; letter-spacing: .8px;
  margin: 0 0 12px; display: flex; align-items: center; gap: 6px;
}

/* ── Grille catégories ── */
.smfd-cat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.smfd-cat-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 12px; border-radius: 14px;
  border: 1.5px solid #e0eaf5; background: #f8fbff;
  cursor: pointer; text-align: left;
  transition: all .18s ease; position: relative;
  outline: none;
}
.smfd-cat-card:hover { border-color: #0067b8; background: #edf5fc; }
.smfd-cat-card.active {
  background: #0067b8; border-color: #0067b8; color: #fff;
}
.smfd-cat-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(0,103,184,.1); display: flex;
  align-items: center; justify-content: center;
  font-size: 15px; color: #0067b8; flex-shrink: 0;
  transition: background .18s, color .18s;
}
.smfd-cat-card.active .smfd-cat-icon {
  background: rgba(255,255,255,.25); color: #fff;
}
.smfd-cat-name {
  flex: 1; font-size: 13px; font-weight: 700; color: #0a3a73;
  line-height: 1.3; min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
.smfd-cat-card.active .smfd-cat-name { color: #fff; }
.smfd-cat-count {
  background: rgba(0,103,184,.1); color: #0067b8;
  border-radius: 6px; font-size: 10px; font-weight: 800;
  padding: 2px 6px; flex-shrink: 0;
}
.smfd-cat-card.active .smfd-cat-count {
  background: rgba(255,255,255,.25); color: #fff;
}
.smfd-cat-arrow {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: #b8d0e8; font-size: 11px;
}
.smfd-cat-card.active .smfd-cat-arrow { color: rgba(255,255,255,.7); }

/* ── Vue 2 : sous-catégories ── */
.smfd-subs-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.smfd-back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: #f3f7fc; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #0a3a73; font-size: 14px; flex-shrink: 0;
  transition: background .2s;
}
.smfd-back-btn:hover { background: #dceaf6; }
.smfd-subs-title {
  font-size: 16px; font-weight: 800; color: #0a3a73;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Panels sous-catégories */
.smfd-sub-panel { display: none; }
.smfd-sub-panel.visible { display: block; }

.smfd-sub-all {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: 14px;
  border: 1.5px dashed #c8ddf0; background: #f0f7ff;
  text-decoration: none; margin-bottom: 12px;
  transition: all .18s;
}
.smfd-sub-all:hover { border-color: #0067b8; background: #edf5fc; }
.smfd-sub-all.active { background: #0067b8; border-color: #0067b8; border-style: solid; }
.smfd-sub-all .smfd-sub-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(0,103,184,.1); display: flex; align-items: center;
  justify-content: center; color: #0067b8; font-size: 13px; flex-shrink: 0;
}
.smfd-sub-all.active .smfd-sub-icon { background: rgba(255,255,255,.25); color: #fff; }
.smfd-sub-all .smfd-sub-name {
  flex: 1; font-size: 13px; font-weight: 700; color: #0a3a73;
}
.smfd-sub-all.active .smfd-sub-name { color: #fff; }
.smfd-sub-all .smfd-sub-count {
  background: rgba(0,103,184,.1); color: #0067b8;
  border-radius: 6px; font-size: 10px; font-weight: 800; padding: 2px 6px;
}
.smfd-sub-all.active .smfd-sub-count { background: rgba(255,255,255,.25); color: #fff; }

.smfd-sub-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 2px;
}

.smfd-sub-list::-webkit-scrollbar {
  width: 6px;
}

.smfd-sub-list::-webkit-scrollbar-thumb {
  background: #c8dff5;
  border-radius: 3px;
}
.smfd-sub-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid #e0eaf5; background: #f8fbff;
  text-decoration: none; transition: all .18s;
}
.smfd-sub-item:hover { border-color: #0067b8; background: #edf5fc; }
.smfd-sub-item.active { background: #eaf3fc; border-color: #0067b8; }
.smfd-sub-item .smfd-sub-name {
  flex: 1; font-size: 13px; font-weight: 600; color: #153a5f;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
.smfd-sub-item.active .smfd-sub-name { color: #0067b8; font-weight: 700; }
.smfd-sub-item .smfd-sub-count {
  background: rgba(0,103,184,.08); color: #0067b8;
  border-radius: 6px; font-size: 10px; font-weight: 800; padding: 2px 6px; flex-shrink: 0;
}
.smfd-sub-item.active .smfd-sub-count { background: #0067b8; color: #fff; }

/* ── Footer ── */
.smfd-footer {
  padding: 12px 20px 16px; border-top: 1px solid #edf2f8;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  position: sticky;
  bottom: 0;
  background: #fff;
}

.smfd-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border: 0;
  background: linear-gradient(135deg, #0067b8 0%, #0a3a73 100%);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,103,184,.28);
}
.smfd-reset-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 28px; border: 2px solid #d0dff0;
  color: #0a3a73; background: #f7fbff; border-radius: 999px;
  font-size: 13px; font-weight: 700; text-decoration: none; transition: all .2s;
}
.smfd-reset-btn:hover { border-color: #0067b8; color: #0067b8; background: #edf5fc; }

/* ── Petit écran : grille 1 colonne ── */
@media (max-width: 380px) {
  .smfd-cat-grid { grid-template-columns: 1fr; }
  .smfd-cat-arrow { display: none; }
  .store-mobile-drawer {
    width: 96vw;
    height: calc(100vh - 84px);
    max-height: calc(100vh - 84px);
    min-height: 420px;
    border-radius: 14px;
  }
}

/* ============================================================
   Scrollbar du store-sidebar (Desktop uniquement)
   ============================================================ */
@media (min-width: 1025px) {
  .store-sidebar::-webkit-scrollbar { width: 6px; }
  .store-sidebar::-webkit-scrollbar-track { background: transparent; }
  .store-sidebar::-webkit-scrollbar-thumb { background: #c8dff5; border-radius: 3px; }
  .store-sidebar::-webkit-scrollbar-thumb:hover { background: #95b8d8; }
}

/* Animations desktop sidebar */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.subcategory-list { animation: slideDown 0.25s ease forwards; }

/* Fullscreen btn — mobile */
@media (max-width: 576px) {
  .store-fullscreen-toggle { width: 42px; height: 42px; font-size: 15px; bottom: 14px; right: 14px; }
}
