/* =====================================================================
   EDICOLA POP - Vetrina pubblica
   Estende base.css con: search header, nav mobile, hero, sezioni
   homepage, footer multi-colonna, cookie banner, ricerca, pagine legali.
   ===================================================================== */

/* ---------- Utility ---------- */
.em-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Header esteso ---------- */
.em-header__inner {
  flex-wrap: nowrap;
  gap: 20px;
}
.em-header__logo {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  flex: 0 0 auto;
  text-decoration: none;
}
.em-header__logo:hover { text-decoration: none; }
.em-header__logo:hover .em-header__brand-name,
.em-header__logo:hover .em-header__brand-tagline { text-decoration: none; }
.em-header__logo img {
  max-height: 110px;
  max-width: 260px;
  width: auto;
  height: auto;
  display: block;
  background: transparent;
}
.em-header__logo-text {
  display: none;   /* mostrato solo se non c'è img */
  font-size: 24px;
  font-weight: 800;
  color: inherit;             /* eredita da .em-header (bianco) */
  letter-spacing: -0.3px;
}
.em-header__logo--no-img .em-header__logo-text { display: block; }
.em-header__brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
  flex: 0 1 auto;             /* può crescere ma non essere schiacciato */
  min-width: 0;               /* permette al testo di andare a capo se serve */
  white-space: nowrap;        /* di default resta su una riga */
}
/* Alta specificità per vincere sulla regola .em-header__logo span { color: rosso }
   presente in base.css che altrimenti rende invisibile il testo su verde. */
.em-header__logo .em-header__brand-name,
.em-header__brand .em-header__brand-name {
  font-size: 20px;
  font-weight: 800;
  color: #FFFCF2 !important;
  margin: 0;
  letter-spacing: -0.2px;
}
.em-header__logo .em-header__brand-tagline,
.em-header__brand .em-header__brand-tagline {
  font-size: 12px;
  color: #FFFCF2 !important;
  opacity: 0.75;
  margin: 2px 0 0;
  font-weight: 500;
  letter-spacing: 0.2px;
}
@media (max-width: 700px) {
  .em-header__logo img {
    max-height: 72px;
    max-width: 180px;
  }
  .em-header__brand-name { font-size: 16px; }
  .em-header__brand-tagline { display: none; }
}
.em-header__search {
  flex: 1 1 auto;
  max-width: 480px;
  display: flex;
  position: relative;
}
.em-header__search input[type="search"] {
  flex: 1;
  padding: 8px 40px 8px 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: var(--em-white);
  border-radius: var(--em-radius);
  font-size: 14px;
  font-family: inherit;
  transition: background .15s ease, border-color .15s ease;
}
.em-header__search input[type="search"]::placeholder {
  color: rgba(255,255,255,0.6);
}
.em-header__search input[type="search"]:focus {
  outline: none;
  background: rgba(255,255,255,0.14);
  border-color: var(--em-rosso);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.25);
}
.em-header__search button {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.7);
  padding: 6px 8px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--em-radius);
  transition: color .15s ease, background .15s ease;
}
.em-header__search button:hover {
  color: var(--em-white);
  background: rgba(255,255,255,0.1);
}
.em-header__nav {
  display: flex;
  gap: 18px;
  flex: 0 0 auto;
}
.em-header__toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--em-white);
  padding: 6px;
  border-radius: var(--em-radius);
}
.em-header__toggle:hover { background: rgba(255,255,255,0.1); }

@media (max-width: 880px) {
  .em-header__search { max-width: none; }
  .em-header__nav a { font-size: 14px; }
}
@media (max-width: 720px) {
  .em-header__inner { flex-wrap: wrap; row-gap: 12px; }
  .em-header__logo { order: 1; }
  .em-header__toggle { display: flex; order: 2; margin-left: auto; }
  .em-header__search { order: 3; flex: 1 1 100%; max-width: none; }
  .em-header__nav {
    order: 4;
    flex: 1 1 100%;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0 4px;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 4px;
    display: none;
  }
  .em-header__nav.is-open { display: flex; }
  .em-header__nav a { padding: 10px 4px; font-size: 16px; }
}

/* ---------- Hero homepage ---------- */
.em-hero {
  background: linear-gradient(135deg, var(--em-rosso) 0%, var(--em-bordeaux) 100%);
  color: var(--em-white);
  padding: 56px 28px;
  border-radius: var(--em-radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--em-shadow);
}
.em-hero::before {
  /* texture sottile a strisce di carta giornale */
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 0px,
    rgba(255,255,255,0.04) 1px,
    transparent 1px,
    transparent 14px
  );
  pointer-events: none;
}
.em-hero__title {
  margin: 0 0 12px;
  font-size: clamp(28px, 4.2vw, 40px);
  font-weight: 800;
  color: var(--em-white);
  line-height: 1.15;
  position: relative;
}
.em-hero__subtitle {
  margin: 0 0 24px;
  font-size: clamp(16px, 2vw, 19px);
  opacity: 0.95;
  position: relative;
}
.em-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  position: relative;
}
.em-hero__cta .em-btn {
  background: var(--em-white);
  color: var(--em-bordeaux);
  border-color: var(--em-white);
  font-weight: 700;
}
.em-hero__cta .em-btn:hover {
  background: var(--em-bg-2);
  color: var(--em-bordeaux);
}
.em-hero__cta .em-btn--ghost-on-dark {
  background: transparent;
  color: var(--em-white);
  border-color: rgba(255,255,255,0.5);
}
.em-hero__cta .em-btn--ghost-on-dark:hover {
  background: rgba(255,255,255,0.12);
  color: var(--em-white);
}

/* ---------- Sezioni homepage ---------- */
.em-section { margin: 48px 0; }
.em-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.em-section__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--em-antracite);
  position: relative;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--em-rosso);
  display: inline-block;
}
.em-section__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--em-rosso);
}

/* ---------- Card prodotto (riusabile) ---------- */
.em-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.em-product-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  background: var(--em-white);
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
}
.em-product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--em-shadow-lg);
  border-color: var(--em-antracite-2);
  text-decoration: none;
  color: inherit;
}
.em-product-card__media {
  width: 100%;
  aspect-ratio: 1;
  background: #ffffff;
  position: relative;
}
.em-product-card__media img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.em-product-card__media--empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--em-text-muted);
  font-size: 13px;
}
.em-product-card__body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.em-product-card__cat {
  font-size: 11px;
  color: var(--em-rosso);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}
.em-product-card__title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--em-antracite);
  line-height: 1.3;
}
.em-product-card__price {
  margin-top: auto;
  font-size: 18px;
  font-weight: 800;
  color: var(--em-rosso);
}
.em-product-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--em-bordeaux);
  color: var(--em-white);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  z-index: 1;
}
.em-product-card__badge--new { background: var(--em-rosso); }

/* ---------- Categorie tile (homepage) ---------- */
.em-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.em-cat-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px;
  background: var(--em-white);
  border: 1px solid var(--em-border);
  border-left: 4px solid var(--em-rosso);
  border-radius: var(--em-radius);
  text-decoration: none;
  color: var(--em-antracite);
  font-weight: 600;
  font-size: 15px;
  transition: background .15s ease, transform .15s ease, border-left-color .15s ease;
}
.em-cat-tile:hover {
  background: var(--em-bg-2);
  transform: translateX(2px);
  border-left-color: var(--em-bordeaux);
  text-decoration: none;
  color: var(--em-antracite);
}
.em-cat-tile__count {
  font-size: 12px;
  color: var(--em-text-muted);
  font-weight: 500;
}

/* ---------- Empty state ---------- */
.em-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--em-white);
  border: 1px dashed var(--em-border);
  border-radius: var(--em-radius);
  color: var(--em-text-muted);
}
.em-empty h3 {
  color: var(--em-antracite);
  margin: 0 0 8px;
}

/* ---------- Ricerca ---------- */
.em-search-form {
  background: var(--em-white);
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 200px 200px auto;
  gap: 12px;
  align-items: end;
}
@media (max-width: 720px) {
  .em-search-form { grid-template-columns: 1fr; }
}
.em-search-summary {
  margin-bottom: 18px;
  color: var(--em-text-muted);
  font-size: 14px;
}
.em-search-summary strong { color: var(--em-antracite); }
.em-search-highlight {
  background: rgba(200, 16, 46, 0.15);
  color: var(--em-bordeaux);
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
}

/* Pager */
.em-pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px 0 8px;
  flex-wrap: wrap;
}
.em-pager a, .em-pager span {
  min-width: 38px;
  padding: 8px 12px;
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius);
  text-align: center;
  text-decoration: none;
  color: var(--em-antracite);
  background: var(--em-white);
  font-weight: 600;
  font-size: 14px;
}
.em-pager a:hover {
  background: var(--em-bg-2);
  text-decoration: none;
}
.em-pager .is-current {
  background: var(--em-rosso);
  color: var(--em-white);
  border-color: var(--em-rosso);
}
.em-pager .is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Pagine legali / contatti ---------- */
.em-legal {
  background: var(--em-white);
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius-lg);
  padding: 40px;
  line-height: 1.7;
  color: var(--em-text);
}
.em-legal h1 {
  margin: 0 0 8px;
  font-size: 30px;
  color: var(--em-antracite);
  border-bottom: 3px solid var(--em-rosso);
  padding-bottom: 8px;
  display: inline-block;
}
.em-legal h2 {
  font-size: 20px;
  color: var(--em-antracite);
  margin: 32px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--em-rosso);
}
.em-legal h3 { font-size: 16px; color: var(--em-antracite-2); margin: 22px 0 8px; }
.em-legal p, .em-legal li { color: var(--em-text); }
.em-legal ul { padding-left: 22px; }
.em-legal li { margin-bottom: 6px; }
.em-legal__updated {
  color: var(--em-text-muted);
  font-size: 13px;
  font-style: italic;
  margin-bottom: 24px;
}
.em-legal__custom {
  background: var(--em-bg-2);
  border-left: 3px solid var(--em-info);
  padding: 12px 16px;
  border-radius: var(--em-radius);
  margin: 16px 0;
}
@media (max-width: 720px) {
  .em-legal { padding: 24px 18px; }
  .em-legal h1 { font-size: 24px; }
}

/* ---------- Contatti ---------- */
.em-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 720px) {
  .em-contact-grid { grid-template-columns: 1fr; }
}
.em-contact-info p { margin: 0 0 14px; }
.em-contact-info strong {
  display: block;
  color: var(--em-antracite);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.em-contact-info .em-icon {
  display: inline-block;
  width: 16px; height: 16px;
  vertical-align: -3px;
  margin-right: 6px;
  color: var(--em-rosso);
}

/* ---------- 404 ---------- */
.em-404 {
  text-align: center;
  padding: 60px 24px;
}
.em-404__code {
  font-size: 96px;
  font-weight: 900;
  color: var(--em-rosso);
  line-height: 1;
  margin: 0 0 12px;
  letter-spacing: -2px;
}
.em-404__title {
  font-size: 24px;
  color: var(--em-antracite);
  margin: 0 0 12px;
}
.em-404__msg {
  color: var(--em-text-muted);
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Footer multi-colonna ---------- */
.em-footer { margin-top: 64px; padding: 40px 0 0; }
.em-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (max-width: 720px) {
  .em-footer__grid { grid-template-columns: 1fr; gap: 24px; }
}
.em-footer__col h4 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--em-white);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--em-rosso);
  padding-bottom: 6px;
  display: inline-block;
}
.em-footer__col p { margin: 0 0 8px; font-size: 14px; }
.em-footer__col ul { list-style: none; padding: 0; margin: 0; }
.em-footer__col li { margin-bottom: 6px; }
.em-footer__col a { color: var(--em-bg-2); font-size: 14px; }
.em-footer__col a:hover { color: var(--em-white); text-decoration: underline; }
.em-footer__hours {
  white-space: pre-line;
  font-size: 13px;
  color: rgba(247, 245, 242, 0.75);
}
.em-footer__legal {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(247, 245, 242, 0.6);
  line-height: 1.5;
}
.em-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  font-size: 13px;
  color: rgba(247, 245, 242, 0.7);
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 720px) {
  .em-footer__bottom { justify-content: center; text-align: center; }
}
.em-footer__credits {
  display: flex; align-items: center; gap: 10px;
}
.em-credits__link {
  color: var(--em-bg-2) !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity .15s ease;
}
.em-credits__link:hover {
  color: var(--em-white) !important;
  text-decoration: none;
  opacity: 0.85;
}
.em-credits__logo {
  display: inline-flex;
  align-items: center;
  background: transparent;
}
.em-credits__logo img {
  height: 56px;
  width: auto;
  display: block;
  background: transparent;
}

/* ---------- Cookie banner ---------- */
/* Forza il banner nascosto quando ha l'attributo hidden o la classe hidden.
   Il browser rispetta [hidden] nativamente ma alcuni CSS con display:flex
   potrebbero sovrascriverlo. Regola difensiva: */
.em-cookie-banner[hidden],
.em-cookie-banner--hidden {
  display: none !important;
}
.em-cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--em-white);
  border-top: 4px solid var(--em-rosso);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 9999;
  animation: em-cookie-in .35s ease;
}
@keyframes em-cookie-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.em-cookie-banner__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
@media (max-width: 720px) {
  .em-cookie-banner__inner { grid-template-columns: 1fr; }
}
.em-cookie-banner__text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--em-text);
}
.em-cookie-banner__text strong { color: var(--em-antracite); }
.em-cookie-banner__text a { color: var(--em-rosso); font-weight: 600; }
.em-cookie-banner__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .em-cookie-banner__actions { justify-content: stretch; }
  .em-cookie-banner__actions .em-btn { flex: 1; }
}

.em-cookie-prefs {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 34, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
}
.em-cookie-prefs[hidden] { display: none; }
.em-cookie-prefs__inner {
  max-width: 560px;
  width: 100%;
  background: var(--em-white);
  border-radius: var(--em-radius-lg);
  padding: 28px;
  box-shadow: var(--em-shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.em-cookie-prefs h3 {
  margin: 0 0 8px;
  color: var(--em-antracite);
  font-size: 20px;
  border-bottom: 2px solid var(--em-rosso);
  padding-bottom: 6px;
  display: inline-block;
}
.em-cookie-prefs__intro {
  font-size: 14px; color: var(--em-text-muted);
  margin: 12px 0 20px;
}
.em-cookie-row {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius);
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  align-items: flex-start;
}
.em-cookie-row:hover { background: var(--em-bg-2); }
.em-cookie-row input[type="checkbox"] {
  margin-top: 3px;
  width: 18px; height: 18px;
  accent-color: var(--em-rosso);
  flex: 0 0 auto;
}
.em-cookie-row strong {
  display: block;
  color: var(--em-antracite);
  margin-bottom: 4px;
  font-size: 14px;
}
.em-cookie-row span {
  display: block;
  font-size: 13px;
  color: var(--em-text-muted);
  line-height: 1.5;
}
.em-cookie-prefs__actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--em-border);
  flex-wrap: wrap;
}

/* =====================================================================
   BANNER PROMOZIONALI (homepage)
   Spazi liberi per pubblicizzare servizi (Amazon Point, ricariche, ecc.)
   Layout: strip orizzontale compatto, immagine a sinistra + testo a destra
   Responsive: su mobile diventa verticale con immagine ridotta
   ===================================================================== */
/* ==========================================================================
   BANNER CAROSELLO
   - Larghezza max 1200px, altezza automatica per rispettare le proporzioni
     dell'immagine originale (no crop, no forzature)
   - Carosello automatico: una slide alla volta, slide ogni 5 sec
   - Frecce + dots solo se ci sono più banner
   ========================================================================== */

.em-banner-carousel {
  position: relative;
  max-width: 1200px;
  margin: 24px auto;
  padding: 0;
}

.em-banner-carousel__viewport {
  overflow: hidden;
  border-radius: var(--em-radius);
  background: var(--em-bg-2);
  /* Min-height piccola: una slide solo testo non collassa, ma se ha immagine
     l'altezza si adatta a quella dell'immagine */
  min-height: 80px;
}

.em-banner-carousel__track {
  position: relative;
  width: 100%;
}

.em-banner-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: block;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.em-banner-slide[data-active="1"] {
  position: relative;   /* la slide attiva determina l'altezza del viewport */
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

a.em-banner-slide:hover {
  text-decoration: none;
}

/* Immagine: larghezza 100%, altezza automatica (mantiene il rapporto originale).
   Se carichi 1200x300 -> banner basso. Se carichi 1200x600 -> banner alto. */
.em-banner-slide__media {
  width: 100%;
  line-height: 0;
}

.em-banner-slide__media img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* Body testo: sovrapposto in basso con sfondo semi-trasparente quando c'è immagine */
.em-banner-slide--with-image .em-banner-slide__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 22px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.45) 60%, transparent 100%);
  color: #fff;
}

.em-banner-slide--with-image .em-banner-slide__title,
.em-banner-slide--with-image .em-banner-slide__subtitle,
.em-banner-slide--with-image .em-banner-slide__text,
.em-banner-slide--with-image .em-banner-slide__cta {
  color: #fff;
}

/* Senza immagine: card colorata semplice */
.em-banner-slide:not(.em-banner-slide--with-image) .em-banner-slide__body {
  padding: 28px 24px;
  background: var(--em-white);
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius);
}

.em-banner-slide__title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.em-banner-slide__subtitle {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.95;
}

.em-banner-slide__text {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.92;
}

.em-banner-slide__cta {
  display: inline-block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
}

a.em-banner-slide:hover .em-banner-slide__cta {
  text-decoration: underline;
}

/* Frecce navigazione */
.em-banner-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--em-border);
  color: var(--em-antracite);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.em-banner-carousel__nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}

.em-banner-carousel__nav--prev { left: 10px; }
.em-banner-carousel__nav--next { right: 10px; }

/* Dots */
.em-banner-carousel__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.em-banner-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.em-banner-carousel__dot:hover {
  background: rgba(255,255,255,0.9);
}

.em-banner-carousel__dot.is-active {
  background: var(--em-rosso);
  transform: scale(1.3);
}

/* Su mobile, frecce più piccole e dots più visibili */
@media (max-width: 600px) {
  .em-banner-carousel__nav {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  .em-banner-slide--with-image .em-banner-slide__body {
    padding: 12px 16px;
  }
  .em-banner-slide__title { font-size: 16px; }
  .em-banner-slide__subtitle { font-size: 12px; }
  .em-banner-slide__text { font-size: 12px; }
}

/* =========================================================================
   HOMEPAGE - RAIL SIDEBAR + MAIN + HERO AMBRA + CATEGORY TILES + BOTTOM SHEET
   ========================================================================= */

.em-home {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  margin: 0;
  padding: 0;
}

/* ---------- RAIL SIDEBAR (desktop) ---------- */
.em-rail {
  background: var(--em-white);
  border-radius: 14px;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: sticky;
  top: 20px;
  align-self: start;
  /* Niente overflow-y: auto qui — verrebbe tagliato il tooltip che si estende
     a destra. Se il rail è più lungo dello schermo, l'utente scrolla la pagina. */
  overflow: visible;
  border: 1px solid var(--em-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  /* z-index alto per creare uno stacking context sopra l'hero ambra e i suoi
     contenuti, così il tooltip che sbuca a destra è sempre visibile sopra tutto */
  z-index: 100;
}
.em-rail__section-title {
  font-size: 8px;
  color: var(--em-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 6px 0 4px;
  font-weight: 700;
}

.em-rail__item {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--em-verde-primary);
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, color 0.15s ease;
  cursor: pointer;
  font-size: 22px;
}
.em-rail__item:hover,
.em-rail__item:focus-visible,
.em-rail__item.is-active {
  background: var(--em-bg-2);
  color: var(--em-verde-primary);
  text-decoration: none;
}
.em-rail__item:hover { transform: scale(1.05); }
.em-rail__item i { line-height: 1; }
.em-rail__item--service { color: var(--em-text-muted); }
.em-rail__item--service:hover { color: var(--em-verde-primary); }

.em-rail__badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: var(--em-rosso);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  line-height: 1.3;
  min-width: 16px;
  text-align: center;
}

.em-rail__tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background: var(--em-antracite, #2C2C2E);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;                  /* massimo per stare sopra hero, banner, ecc. */
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.2px;
}
.em-rail__tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--em-antracite, #2C2C2E);
}
.em-rail__item:hover .em-rail__tooltip,
.em-rail__item:focus-visible .em-rail__tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.em-rail__divider {
  width: 40%;
  height: 1px;
  background: var(--em-border);
  margin: 8px 0;
}

/* ---------- MAIN ---------- */
.em-home__main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

/* ---------- HERO AMBRA con visual ---------- */
.em-hero-amber {
  background: linear-gradient(135deg, #E8A82C 0%, #F4C568 100%);
  border-radius: 16px;
  padding: 34px 40px;
  min-height: 200px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
}
.em-hero-amber::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  background: rgba(31, 77, 58, 0.07);
  border-radius: 50%;
  pointer-events: none;
}
.em-hero-amber__content {
  flex: 1;
  position: relative;
  z-index: 1;
  max-width: 600px;
}
.em-hero-amber__eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #5A3A00;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 10px;
}
.em-hero-amber__title {
  font-size: 36px;
  font-weight: 800;
  color: #5A3A00;
  margin: 0 0 12px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.em-hero-amber__sub {
  font-size: 16px;
  color: #5A3A00;
  opacity: 0.9;
  margin: 0 0 22px;
  line-height: 1.5;
  font-weight: 500;
}
.em-hero-amber__ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.em-hero-amber__cta {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: 8px;
  background: var(--em-verde-primary);
  color: white;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.em-hero-amber__cta:hover {
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(31, 77, 58, 0.25);
}
.em-hero-amber__cta--ghost {
  background: transparent;
  color: #5A3A00;
  border: 2px solid rgba(90, 58, 0, 0.4);
}
.em-hero-amber__cta--ghost:hover {
  background: rgba(90, 58, 0, 0.1);
  color: #5A3A00;
  box-shadow: none;
}

.em-hero-amber__visual {
  flex: 0 0 auto;
  width: 150px;
  height: 130px;
  background: rgba(31, 77, 58, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.em-hero-amber__visual i {
  font-size: 60px;
  color: rgba(31, 77, 58, 0.35);
  line-height: 1;
}

/* ---------- CATEGORY TILES ---------- */
.em-cats-tile-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.em-cat-tile-v2 {
  background: var(--em-white);
  border-radius: 10px;
  padding: 16px 8px 12px;
  text-align: center;
  border: 1px solid var(--em-border);
  text-decoration: none;
  color: var(--em-verde-primary);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.em-cat-tile-v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--em-ambra, #E8A82C);
  text-decoration: none;
  color: var(--em-verde-primary);
}
.em-cat-tile-v2__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--em-bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.em-cat-tile-v2:hover .em-cat-tile-v2__icon {
  background: linear-gradient(135deg, #E8A82C 0%, #F4C568 100%);
}
.em-cat-tile-v2__icon i {
  font-size: 22px;
  color: var(--em-verde-primary);
  line-height: 1;
  transition: color 0.15s ease;
}
.em-cat-tile-v2:hover .em-cat-tile-v2__icon i { color: #5A3A00; }
.em-cat-tile-v2__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--em-verde-primary);
  line-height: 1.2;
}
.em-cat-tile-v2__count {
  font-size: 11px;
  color: var(--em-text-muted);
  font-weight: 500;
}

/* Product grid tight per fit dentro area main */
.em-product-grid--tight {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* ---------- MOBILE BOTTONE REPARTI + BOTTOM SHEET ---------- */
.em-mobile-reparti-btn {
  display: none;   /* nascosto su desktop */
  width: 100%;
  align-items: center;
  gap: 10px;
  background: var(--em-white);
  border: 1px solid var(--em-border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--em-verde-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.em-mobile-reparti-btn:active { background: var(--em-bg-2); }
.em-mobile-reparti-btn > i:first-child { font-size: 22px; }
.em-mobile-reparti-btn > i:last-child { font-size: 18px; margin-left: auto; color: var(--em-text-muted); }
.em-mobile-reparti-btn__count {
  font-size: 12px;
  font-weight: 500;
  color: var(--em-text-muted);
  margin-left: auto;
}

/* Bottom sheet mobile */
.em-bottomsheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.em-bottomsheet.is-open {
  pointer-events: auto;
  opacity: 1;
}
.em-bottomsheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.em-bottomsheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--em-white);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 24px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
}
.em-bottomsheet.is-open .em-bottomsheet__panel {
  transform: translateY(0);
}
.em-bottomsheet__handle {
  width: 44px;
  height: 5px;
  background: #ddd;
  border-radius: 3px;
  margin: 0 auto 14px;
  cursor: grab;
}
.em-bottomsheet__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--em-verde-primary);
  margin: 0 0 14px;
}
.em-bottomsheet__subtitle {
  font-size: 11px;
  color: var(--em-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 4px 0 8px;
  font-weight: 700;
}
.em-bottomsheet__list {
  display: flex;
  flex-direction: column;
}
.em-bottomsheet__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--em-border);
  font-size: 15px;
  color: var(--em-verde-primary);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.1s ease;
}
.em-bottomsheet__item:last-child { border-bottom: none; }
.em-bottomsheet__item:active { background: var(--em-bg-2); }
.em-bottomsheet__item i {
  font-size: 22px;
  color: var(--em-verde-primary);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.em-bottomsheet__item-name { flex: 1; }
.em-bottomsheet__item-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--em-text-muted);
  background: var(--em-bg-2);
  padding: 3px 10px;
  border-radius: 999px;
}
.em-bottomsheet__item--service i { color: var(--em-text-muted); }
.em-bottomsheet__divider {
  height: 1px;
  background: var(--em-border);
  margin: 14px 0 6px;
}

/* ---------- MOBILE RESPONSIVE ---------- */
@media (max-width: 900px) {
  .em-home {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .em-rail {
    display: none;   /* nascondo rail su mobile, uso bottom sheet */
  }
  .em-mobile-reparti-btn {
    display: flex;
  }
  .em-hero-amber {
    padding: 24px 22px;
    min-height: 160px;
    gap: 12px;
  }
  .em-hero-amber__title { font-size: 26px; }
  .em-hero-amber__sub { font-size: 13px; }
  .em-hero-amber__visual {
    width: 90px;
    height: 80px;
  }
  .em-hero-amber__visual i { font-size: 40px; }
  .em-cats-tile-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .em-cat-tile-v2 { padding: 12px 6px 10px; }
  .em-cat-tile-v2__icon { width: 38px; height: 38px; }
  .em-cat-tile-v2__icon i { font-size: 18px; }
  .em-cat-tile-v2__name { font-size: 12px; }
  .em-cat-tile-v2__count { font-size: 10px; }
}
@media (max-width: 480px) {
  .em-hero-amber { flex-direction: column; align-items: flex-start; text-align: left; }
  .em-hero-amber__visual { align-self: flex-end; margin-top: -60px; }
  .em-cats-tile-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================================
   SCHEDA PRODOTTO - Layout responsive con sticky bottom bar su mobile
   ========================================================================= */

.em-prod-page__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* MEDIA COL */
.em-prod-page__main-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--em-border);
  background: var(--em-bg-2);
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.em-prod-page__main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.em-prod-page__main-image--empty {
  color: var(--em-text-muted);
  font-size: 14px;
}

.em-prod-page__gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.em-prod-page__thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--em-border);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.em-prod-page__thumb:hover {
  border-color: var(--em-rosso, #C8102E);
  transform: translateY(-2px);
}

/* INFO COL */
.em-prod-page__cat {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--em-rosso, #C8102E);
  text-decoration: none;
  margin-bottom: 10px;
  padding: 4px 10px;
  background: rgba(200, 16, 46, 0.08);
  border-radius: 999px;
  transition: background 0.15s;
}
.em-prod-page__cat:hover {
  background: rgba(200, 16, 46, 0.15);
  text-decoration: none;
  color: var(--em-rosso, #C8102E);
}

.em-prod-page__title {
  font-size: 30px;
  font-weight: 800;
  color: var(--em-antracite, #2C2C2E);
  margin: 0 0 16px;
  line-height: 1.2;
  letter-spacing: -0.4px;
}

.em-prod-page__price {
  font-size: 34px;
  font-weight: 800;
  color: var(--em-rosso, #C8102E);
  margin: 0 0 20px;
  letter-spacing: -0.5px;
}

.em-prod-page__actions {
  margin: 0 0 24px;
  padding: 18px;
  background: var(--em-bg, #FAF6E9);
  border-radius: 12px;
  border: 1px solid var(--em-border);
}

/* =========================================================================
   MOBILE (<= 900px): layout verticale + sticky bottom bar
   ========================================================================= */
@media (max-width: 900px) {
  .em-prod-page {
    /* Padding extra sotto per non sovrapporre la sticky bar */
    padding-bottom: 100px;
  }

  .em-prod-page__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .em-prod-page__main-image {
    aspect-ratio: 4 / 3;
    border-radius: 10px;
  }

  /* Galleria orizzontale scorrevole con swipe */
  .em-prod-page__gallery {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 2px 0 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .em-prod-page__gallery::-webkit-scrollbar { display: none; }
  .em-prod-page__thumb {
    flex: 0 0 72px;
    scroll-snap-align: start;
  }

  .em-prod-page__title {
    font-size: 22px;
    letter-spacing: -0.2px;
    margin-bottom: 12px;
  }

  .em-prod-page__price {
    font-size: 28px;
    margin-bottom: 16px;
  }

  .em-prod-page__actions {
    padding: 14px;
  }

  /* Sticky bottom bar con prezzo + bottone prenota, sempre visibile */
  .em-prod-page__sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--em-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .em-prod-page__sticky-price {
    font-weight: 800;
    color: var(--em-rosso, #C8102E);
    font-size: 18px;
    flex-shrink: 0;
  }
  .em-prod-page__sticky-btn {
    flex: 1;
    padding: 12px 16px;
    background: var(--em-rosso, #C8102E);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    text-align: center;
    display: block;
  }
  .em-prod-page__sticky-btn:hover,
  .em-prod-page__sticky-btn:active {
    background: #a80c25;
    color: white;
    text-decoration: none;
  }
  .em-prod-page__sticky-btn--disabled {
    background: #999 !important;
    cursor: not-allowed;
  }
}
@media (min-width: 901px) {
  /* Sticky bar solo mobile */
  .em-prod-page__sticky-bar { display: none; }
}

/* =========================================================================
   PREFERITI - Cuore (fav button)
   ========================================================================= */
.em-fav-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--em-border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  padding: 0;
}
.em-fav-btn:hover {
  border-color: var(--em-rosso, #C8102E);
  transform: scale(1.08);
}
.em-fav-btn__icon {
  font-size: 22px;
  line-height: 1;
  color: #ccc;
  transition: color 0.2s ease, transform 0.2s ease;
}
.em-fav-btn:hover .em-fav-btn__icon {
  color: var(--em-rosso, #C8102E);
}
.em-fav-btn.is-active {
  border-color: var(--em-rosso, #C8102E);
  background: rgba(200, 16, 46, 0.06);
}
.em-fav-btn.is-active .em-fav-btn__icon {
  color: var(--em-rosso, #C8102E);
}
/* Animazione "pop" quando si attiva */
.em-fav-btn.just-toggled .em-fav-btn__icon {
  animation: em-fav-pop 0.35s ease;
}
@keyframes em-fav-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* Cuore piccolo sulle card prodotto (vetrina) */
.em-fav-btn--card {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.em-fav-btn--card .em-fav-btn__icon {
  font-size: 17px;
}

/* Cuore categoria (nella pagina categoria, accanto al titolo) */
.em-fav-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 24px;
  border: 2px solid var(--em-border);
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--em-text-muted);
  transition: all 0.2s ease;
  text-decoration: none;
}
.em-fav-cat-btn:hover {
  border-color: var(--em-rosso, #C8102E);
  color: var(--em-rosso, #C8102E);
}
.em-fav-cat-btn__icon { font-size: 17px; color: #ccc; transition: color 0.2s; }
.em-fav-cat-btn:hover .em-fav-cat-btn__icon { color: var(--em-rosso, #C8102E); }
.em-fav-cat-btn.is-active {
  border-color: var(--em-rosso, #C8102E);
  background: rgba(200,16,46,0.06);
  color: var(--em-rosso, #C8102E);
}
.em-fav-cat-btn.is-active .em-fav-cat-btn__icon { color: var(--em-rosso, #C8102E); }

/* Toast preferiti */
.em-fav-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--em-verde-primary, #1F4D3A);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  pointer-events: none;
}
.em-fav-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =========================================================================
   CONDIVISIONE SOCIAL
   ========================================================================= */
.em-share {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--em-border);
}
.em-share__label {
  margin: 0 0 14px;
  font-weight: 700;
  color: var(--em-antracite);
  font-size: 15px;
}
.em-share__grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.em-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--em-border);
  background: white;
  color: var(--em-antracite);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  line-height: 1;
}
.em-share__btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.em-share__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.em-share__btn.is-done {
  background: #E8F5E9 !important;
  border-color: #1F7A3A !important;
  color: #1F7A3A !important;
}

/* Colori brand (al hover il bottone prende il colore del social) */
.em-share__btn--native {
  background: var(--em-verde-primary, #1F4D3A);
  border-color: var(--em-verde-primary, #1F4D3A);
  color: white;
}
.em-share__btn--native:hover {
  background: var(--em-verde-hover, #2A5840);
  border-color: var(--em-verde-hover, #2A5840);
}
.em-share__btn--wa:hover  { background: #25D366; border-color: #25D366; color: white; }
.em-share__btn--fb:hover  { background: #1877F2; border-color: #1877F2; color: white; }
.em-share__btn--tg:hover  { background: #229ED9; border-color: #229ED9; color: white; }
.em-share__btn--x:hover   { background: #000000; border-color: #000000; color: white; }
.em-share__btn--ig:hover  {
  background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF, #515BD4);
  border-color: #DD2A7B;
  color: white;
}
.em-share__btn--copy:hover {
  background: var(--em-antracite, #2C2C2E);
  border-color: var(--em-antracite, #2C2C2E);
  color: white;
}

.em-share__hint {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #FFF8E7;
  border-left: 3px solid #E8A82C;
  border-radius: 6px;
  font-size: 13px;
  color: #6B5518;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .em-share__grid { gap: 6px; }
  .em-share__btn {
    padding: 9px 12px;
    font-size: 12.5px;
  }
  .em-share__btn svg { width: 16px; height: 16px; }
}

/* =========================================================================
   MODAL ANTEPRIMA STORIA INSTAGRAM
   ========================================================================= */
.em-story-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.em-story-modal[hidden] { display: none; }

.em-story-modal__inner {
  background: white;
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  text-align: center;
}
.em-story-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: var(--em-text-muted);
  cursor: pointer;
  padding: 4px 8px;
}
.em-story-modal__close:hover { color: var(--em-antracite); }

.em-story-modal__title {
  margin: 0 0 16px;
  font-size: 19px;
  color: var(--em-antracite);
}

/* L'anteprima mantiene le proporzioni 9:16 della storia */
.em-story-modal__preview {
  aspect-ratio: 9 / 16;
  max-height: 52vh;
  margin: 0 auto 16px;
  background: #f2f2f2;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.em-story-modal__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.em-story-modal__loading {
  color: var(--em-text-muted);
  font-size: 14px;
}

.em-story-modal__hint {
  font-size: 13px;
  color: var(--em-text-muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

.em-story-modal__actions {
  display: flex;
  gap: 10px;
  flex-direction: column;
}
.em-story-modal__actions .em-btn { width: 100%; }

.em-story-modal__note {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: #FFF8E7;
  border-left: 3px solid #E8A82C;
  border-radius: 6px;
  font-size: 12.5px;
  color: #6B5518;
  line-height: 1.5;
  text-align: left;
}

/* Tab selettore formato (Storia / Post) nel modal Instagram */
.em-story-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.em-story-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--em-border);
  background: white;
  color: var(--em-text-muted);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.em-story-tab small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.7;
}
.em-story-tab:hover {
  border-color: var(--em-verde-primary, #1F4D3A);
  color: var(--em-verde-primary, #1F4D3A);
}
.em-story-tab.is-active {
  background: var(--em-verde-primary, #1F4D3A);
  border-color: var(--em-verde-primary, #1F4D3A);
  color: #FFFCF2;
}
.em-story-tab.is-active small { opacity: 0.85; }

/* L'anteprima si adatta al formato selezionato (storia 9:16, post 4:5 o 1:1).
   Senza questo il box resterebbe verticale e i post apparirebbero schiacciati. */
.em-story-modal__preview[data-formato="post45"] { aspect-ratio: 4 / 5; }
.em-story-modal__preview[data-formato="post"]   { aspect-ratio: 1 / 1; }
