/* =========================================================
   Luna Bags — Search Panel
   ========================================================= */

   :root {
    --bg: #ffffff;
    --panel: #ffffff;
    --panel-2: #ffffff;
    --text: #0f0f0f;
    --muted: #6b7280;
    --line: #eaeaea;
    --shadow: 0 18px 60px rgba(15, 23, 42, 0.15);
    --accent: #111111;
    --brand: #b07a3a;
    --radius: 14px;
  }
  
  .results-footer button {
    display: none;
  }
  
  /* =========================================================
     OVERLAY
     ========================================================= */
  
  .search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .search-overlay.active {
    opacity: 1;
    pointer-events: all;
  }
  
  /* =========================================================
     PANEL CONTAINER
     ========================================================= */
  
  .search-panel {
    position: fixed;
    top: 0;
    right: -520px;
    width: 460px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.18);
    border-left: 1px solid #eee;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: right 0.32s ease;
  }
  
  .search-panel.active {
    right: 0;
  }
  
  /* =========================================================
     HEADER
     ========================================================= */
  
  .search-panel-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
    flex-wrap: nowrap;
  }
  
  #close-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 20px;
    color: #111;
    transition:
      background 0.12s ease,
      transform 0.06s ease,
      box-shadow 0.12s ease;
  }
  
  #close-search:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  }
  
  .searchbar-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
    background: #f6f6f6;
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    border: 1px solid #e8e8e8;
  }
  
  .searchbar-icon {
    font-size: 1.1rem;
    color: #666;
    flex-shrink: 0;
  }
  
  .searchbar-wrap input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #111;
  }
  
  .search-main-btn {
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    transition:
      transform 0.08s ease,
      background 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
    min-width: 64px;
  }
  
  .search-main-btn:hover {
    background: #000;
  }
  
  .search-main-btn:active {
    transform: scale(0.97);
  }
  
  .filters-toggle {
    margin-left: 0.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
  }
  
  .filters-toggle ion-icon {
    font-size: 1.1rem;
    color: #111;
  }
  
  .filters-toggle span {
    color: #111;
  }
  
  .filters-toggle.active {
    background: #111;
    border-color: #111;
    color: #fff;
  }
  
  .filters-toggle.active ion-icon,
  .filters-toggle.active span {
    color: #fff;
  }
  
  /* =========================================================
     BODY
     ========================================================= */
  
  .search-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
  }
  
  /* =========================================================
     FILTRI
     ========================================================= */
  
  .search-filters {
    margin-bottom: 1rem;
  }
  
  .search-filters.is-collapsed {
    display: none;
  }
  
  .filters-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
  }
  
  .filters-head h4 {
    font-size: 14px;
    margin: 0;
  }
  
  .link-reset {
    background: none;
    border: none;
    color: #111;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
  }
  
  .filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
  }
  
  .filter-group label {
    display: block;
    font-size: 12px;
    color: #333;
    margin-bottom: 0.3rem;
  }
  
  .filter-group select,
  .filter-group input {
    width: 100%;
    padding: 0.55rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    color: #111;
  }
  
  .hint {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 0.25rem;
  }
  
  .filter-btn {
    margin-top: 0.9rem;
    width: 100%;
    padding: 0.6rem;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
  }
  
  /* =========================================================
     RISULTATI
     ========================================================= */
  
  .results-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.6rem 0;
  }
  
  .results-head h4 {
    font-size: 14px;
    margin: 0;
  }
  
  .results-head .muted {
    font-size: 12px;
    color: #666;
  }
  
  .results-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .result-row {
    border-bottom: 1px solid #f0f0f0;
    padding: 0.7rem 0;
  }
  
  .result-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: space-between;
    width: 100%;
  }
  
  .result-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: #111;
    flex: 1;
    border-radius: 12px;
    padding: 0.2rem;
    min-width: 0;
  }
  
  .result-link:hover {
    background: #fafafa;
  }
  
  .result-thumb-wrap {
    position: relative;
    width: 68px;
    min-width: 68px;
    height: 68px;
    border-radius: 12px;
    overflow: hidden;
    background: #f4f4f5;
    border: 1px solid #eee;
  }
  
  .result-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition:
      filter 0.25s ease,
      transform 0.25s ease,
      opacity 0.25s ease;
  }
  
  /* blur SOLO quando il markup passa is-blurred */
  .result-thumb-wrap.is-blurred img {
    filter: blur(5px) grayscale(0.08);
    transform: scale(1.06);
    opacity: 0.84;
  }
  
  .result-info {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
  }
  
  .result-name {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    line-height: 1.35;
    word-break: break-word;
  }
  
  .result-meta {
    font-size: 12px;
    color: #666;
    line-height: 1.35;
  }
  
  .result-price {
    font-size: 12px;
    color: #222;
    line-height: 1.35;
  }
  
  .result-price-locked {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    display: block;
  }
  
  .result-item.is-archived .result-name,
  .result-item.is-archived .result-meta,
  .result-item.is-archived .result-price,
  .result-item.is-archived .result-price-locked {
    opacity: 0.82;
  }
  
.result-item.is-archived .add-to-cart-btn {
  display: inline-flex !important;
}
  .result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 42px;
}
  .add-to-cart-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .add-to-cart-btn ion-icon {
    font-size: 1.2rem;
    color: #111;
  }
  
  .add-to-cart-btn:hover {
    background: #111;
    border-color: #111;
  }
  
  .add-to-cart-btn:hover ion-icon {
    color: #fff;
  }
  
  .add-to-cart-btn.added {
    background: #00c853;
    border-color: #00c853;
  }
  
  .add-to-cart-btn.added ion-icon {
    color: #fff;
  }
  
  /* =========================================================
     FOOTER RISULTATI
     ========================================================= */
  
  .results-footer {
    padding: 0.6rem 0 1rem;
    display: flex;
    justify-content: center;
  }
  
  .btn-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #ddd;
    background: #fff;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
  }
  
  .btn-more:hover {
    background: #fafafa;
  }
  
  /* =========================================================
     LOADER
     ========================================================= */
  
  .search-loading {
    display: none;
    align-items: center;
    gap: 0.6rem;
    font-size: 12px;
    color: #555;
    padding: 0.4rem 0 0.6rem;
  }
  
  .search-loading.active {
    display: flex;
  }
  
  .search-loading .spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid #ddd;
    border-top-color: #111;
    animation: search-spin 0.7s linear infinite;
  }
  
  @keyframes search-spin {
    to {
      transform: rotate(360deg);
    }
  }
  
  /* =========================================================
     STATO VUOTO
     ========================================================= */
  
  .empty {
    padding: 1.2rem 0;
  }
  
  .empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #666;
  }
  
  .empty-box ion-icon {
    font-size: 2rem;
  }
  
  /* =========================================================
     SCROLL LOCK
     ========================================================= */
  
  body.no-scroll {
    overflow: hidden;
  }
  
  /* =========================================================
     RESPONSIVE – TABLET
     ========================================================= */
  
  @media (max-width: 1024px) {
    .search-panel {
      width: min(420px, 100vw);
      right: -100%;
    }
  }
  
  /* =========================================================
     RESPONSIVE – MOBILE
     ========================================================= */
  
  @media (max-width: 600px) {
    .search-panel {
      width: 100vw;
      right: -100vw;
    }
  
    .search-panel-header {
      padding: 0.7rem 0.75rem;
      gap: 0.5rem;
      flex-wrap: wrap;
    }
  
    #close-search {
      width: 32px;
      height: 32px;
      font-size: 18px;
      order: 1;
    }
  
    .filters-toggle {
      order: 2;
      margin-left: auto;
      width: auto;
      justify-content: center;
    }
  
    .searchbar-wrap {
      order: 3;
      width: 100%;
      margin-top: 0.4rem;
      padding: 0.45rem 0.55rem;
    }
  
    .filters-grid {
      grid-template-columns: 1fr;
    }
  
    .result-thumb-wrap {
      width: 56px;
      min-width: 56px;
      height: 56px;
    }
  
    .result-name {
      font-size: 12.5px;
    }
  
    .result-meta,
    .result-price,
    .result-price-locked {
      font-size: 11.5px;
    }
  }