/*
 * Eptamed — Catalogo negozio (override archive-product.php)
 * Porting di negozio-prodotti.html.
 */

.ept-shop { background: #F0F4F8; font-family: 'Familjen Grotesk', -apple-system, BlinkMacSystemFont, sans-serif; }

/* ── Top bar ── */
.ept-shop-topbar { background: #0E2E4B; }
.ept-shop-topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; height: 52px; }
.ept-shop-topbar-left { display: flex; align-items: center; gap: 7px; font-size: .8125rem; color: rgba(255,255,255,.55); flex-shrink: 0; }
.ept-shop-topbar-left a { color: inherit; text-decoration: none; transition: color 150ms; }
.ept-shop-topbar-left a:hover { color: #fff; }
.ept-shop-topbar-left svg { color: rgba(255,255,255,.3); flex-shrink: 0; }
.ept-shop-topbar-current { color: #fff; font-weight: 600; white-space: nowrap; }
/* min-width:0 stesso motivo di .ept-shop-filtertabs: senza, un flex item
   non si restringe mai sotto il proprio contenuto e l'overflow-x:auto non
   scatta — traboccava dalla riga (es. "Offerte del mese" tagliato a bordo
   schermo) invece di scorrere. */
.ept-shop-topbar-right { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ept-shop-topbar-right::-webkit-scrollbar { display: none; }
.ept-shop-topbtn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 16px; border-radius: 100px; font-size: .8125rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 150ms, color 150ms; text-decoration: none; white-space: nowrap; border: none; }
.ept-shop-topbtn--a { background: #fff; color: #134169; }
.ept-shop-topbtn--a:hover { background: rgba(255,255,255,.9); }
.ept-shop-topbtn--b { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #fff; }
.ept-shop-topbtn--b:hover:not(:disabled) { background: rgba(255,255,255,.2); }
.ept-shop-topbtn--b:disabled { opacity: .5; cursor: default; }

/* ── Filter bar ── */
.ept-shop-filterbar { background: #fff; border-bottom: 1px solid #EBEFEF; position: sticky; top: 0; z-index: 20; }
.ept-shop-filterbar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 48px; display: flex; align-items: center; gap: 8px; }
/* min-width:0 è la parte che mancava: un elemento flex di default rifiuta
   di restringersi sotto la larghezza del proprio contenuto (min-width:auto
   implicito), quindi flex:1 + overflow-x:auto da solo non basta — trabocca
   dalla riga invece di scorrere internamente. */
.ept-shop-filtertabs { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ept-shop-filtertabs::-webkit-scrollbar { display: none; }
.ept-shop-filtertab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 100px; border: 1.5px solid #E4E9EC; background: #fff; font-family: inherit; font-size: .8rem; font-weight: 600; color: rgba(28,34,33,.65); cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: border-color 150ms, background 150ms, color 150ms; }
.ept-shop-filtertab:hover { border-color: #134169; color: #134169; }
.ept-shop-filtertab.active { border-color: #134169; background: #134169; color: #fff; }

.ept-shop-search-wrap { overflow: hidden; display: flex; align-items: center; position: relative; flex: 0 0 0; width: 0; min-width: 0; transition: flex 280ms cubic-bezier(.16,1,.3,1); }
.ept-shop-search-wrap.ept-shop-search-open { flex: 1 1 auto; width: auto; min-width: 0; overflow: visible; }
.ept-shop-search-input { min-width: 0; width: 100%; height: 36px; border: 1.5px solid #134169; border-radius: 100px; padding: 0 40px 0 16px; font-family: inherit; font-size: .875rem; outline: none; background: #fff; color: #1C2221; opacity: 0; transition: opacity 150ms; }
.ept-shop-search-open .ept-shop-search-input { min-width: 200px; opacity: 1; }
.ept-shop-search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 4px; color: #A0ABAB; display: none; align-items: center; justify-content: center; }
.ept-shop-search-open .ept-shop-search-clear { display: flex; }
.ept-shop-search-btn { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 1.5px solid #E4E9EC; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #4E5655; transition: border-color 150ms, color 150ms; }
.ept-shop-search-btn:hover { border-color: #134169; color: #134169; }
.ept-shop-filtertabs.ept-shop-hidden { opacity: 0; pointer-events: none; flex: 0; overflow: hidden; }

/* ── Content / groups ── */
.ept-shop-content { max-width: 1240px; margin: 0 auto; padding: 40px 48px 80px; }
.ept-shop-group { margin-bottom: 60px; }
.ept-shop-group.ept-shop-hidden { display: none; }
.ept-shop-group-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #EBEFEF; }
.ept-shop-group-title-wrap { display: flex; align-items: center; gap: 12px; }
.ept-shop-group-icon { width: 40px; height: 40px; border-radius: 12px; background: rgba(19,65,105,.1); display: grid; place-items: center; color: #134169; flex-shrink: 0; }
.ept-shop-group-title { font-size: 1.375rem; font-weight: 700; margin: 0; color: #1C2221; }
.ept-shop-group-sub { font-size: .875rem; color: #A0ABAB; margin: 3px 0 0; }
.ept-shop-group-count { font-size: .8125rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #A0ABAB; }

.ept-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

/* ── Product card ── */
.ept-shop-card { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 1px 8px rgba(19,65,105,.06); transition: box-shadow 200ms, transform 200ms; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.ept-shop-card:hover { box-shadow: 0 6px 32px rgba(19,65,105,.13); transform: translateY(-2px); }
.ept-shop-card.ept-shop-hidden { display: none; }
.ept-shop-card-img { height: 220px; overflow: hidden; background: #fff; position: relative; }
.ept-shop-card-main-img { width: 100%; height: 100%; object-fit: contain; transition: opacity 200ms; }
.ept-shop-model-badge { position: absolute; top: 12px; left: 12px; background: rgba(19,65,105,.08); border-radius: 100px; padding: 3px 10px; font-size: .6875rem; font-weight: 700; color: #134169; letter-spacing: .05em; }
.ept-shop-card-body { padding: 20px 20px 24px; display: flex; flex-direction: column; flex: 1; }
.ept-shop-card-name { font-size: 1.0625rem; font-weight: 700; color: #1C2221; margin: 0 0 6px; }
.ept-shop-variants { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; flex: 1; }
.ept-shop-variant { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid #F4F6F6; border-radius: 4px; transition: background 150ms; }
.ept-shop-variant:last-child { border-bottom: none; }
.ept-shop-variant:hover { background: #F8FAFA; }
.ept-shop-variant-name { font-size: .9rem; font-weight: 500; color: #1C2221; }
.ept-shop-variant svg { color: #A0ABAB; flex-shrink: 0; }

@media (max-width: 900px) {
  .ept-shop-topbar-inner, .ept-shop-filterbar-inner, .ept-shop-content { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 600px) {
  /* Breadcrumb ("Negozio > Prodotti") e i due bottoni ("Ordine veloce",
     "Offerte del mese") su una sola riga non ci stavano mai su schermi
     stretti — anche con lo scroll interno dei bottoni si sovrapponevano
     visivamente al breadcrumb. Due righe separate invece di una sola che
     trabocca/scorre. */
  .ept-shop-topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 8px;
  }
  .ept-shop-topbar-right {
    width: 100%;
  }
}
