/* ==== SHOP CAROUSEL (clean rewrite) ==== */
.am-shop{
  position: relative;
  max-width: var(--am-maxw, 1200px);
  margin: 10px auto 40px;
  padding: 0 var(--am-pad, 20px);
  font-family: var(--am-font, "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  color: var(--am-text, #111);
}

/* Header */
.am-shop__head{ text-align: center; margin: 4px 0 16px; }
.am-shop__title{
  margin: 0;
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.15;
}
.am-shop__sub{
  margin: 6px 0 0;
  color: var(--am-muted, #666);
  font-size: 14px;
}

/* Viewport */
.am-shop__viewport{
  position: relative;
  overflow: auto hidden;                 /* scroll X */
  border-radius: 14px;
  padding: 0 48px;                       /* spazio frecce */
  scroll-behavior: smooth;
  -ms-overflow-style: none;              /* IE/Edge vecchi */
  scrollbar-width: none;                 /* Firefox */
}
.am-shop__viewport::-webkit-scrollbar{ height:0; width:0; display:none; }

/* Track */
.am-shop__track{
  display: flex;
  gap: 18px;
  padding: 6px 0;
  margin: 0;
  list-style: none;
  will-change: transform;
}

/* ===== CARD ===== */
.am-card{
  flex: 0 0 calc((100% - 18px*3)/4);     /* 4 in desktop */
  background: #fff;
  border: 1px solid var(--am-border, rgba(0,0,0,.08));
  border-radius: 0;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex;                         /* layout colonna */
  flex-direction: column;
}
.am-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0,0,0,.08);
  border-color: rgba(0,0,0,.12);
}

/* Media */
.am-card__media{
  position: relative;
  display: block;
  overflow: hidden;
  background: #f6f6f6;
  flex: 0 0 auto;                        /* non cresce */
}
.am-card__media::before{ content:""; display:block; padding-top: 133.333%; } /* ratio 3:4 verticale */
.am-card__media img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit: cover; display:block;
  transition: transform .3s ease;
}
.am-card:hover .am-card__media img{ transform: scale(1.03) }

/* Body */
.am-card__body{
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;                        /* occupa lo spazio verticale */
  padding: 12px 12px 14px;
}

/* Titolo (clamp 2 righe) */
.am-card__title{
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--am-text, #111);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.25em * 2);          /* riserva spazio per 2 righe */
}
.am-card__title a{ color: inherit; text-decoration: none; }
.am-card__title a:focus-visible{
  outline: 2px solid #000; outline-offset: 2px; border-radius: 6px;
}

/* Descrizione (clamp 2 righe) */
.am-card__desc{
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--am-muted, #666);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Prezzi: SEMPRE in basso */
.am-card__price{
  margin-top: auto;                      /* spinge in basso */
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}
.am-card__price-new{ font-size: 16px; }
.am-card__price-old{
  font-size: 13px;
  color: var(--am-muted, #666);
  text-decoration: line-through;
}

/* Frecce (ancorate alla section) */
.am-shop__arrow{
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 999px; background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  pointer-events: auto;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.am-shop__arrow--prev{ left: calc(var(--am-pad, 20px) + 8px); }
.am-shop__arrow--next{ right: calc(var(--am-pad, 20px) + 8px); }
.am-shop__arrow:hover{ background: #f8f8f8; }
.am-shop__arrow:focus-visible{ outline: 2px solid #000; outline-offset: 2px; }

/* ===== Responsive ===== */
@media (max-width: 1220px){
  .am-card{ flex-basis: calc((100% - 18px*2)/3); }   /* 3 per vista */
}
@media (max-width: 979px){
  .am-card{ flex-basis: calc((100% - 18px)/2); }     /* 2 per vista */
  .am-shop__viewport{ padding: 0 40px; }
}
@media (max-width: 540px){
  .am-card{ flex-basis: 88%; }                       /* 1 quasi full */
}

/* ===== Accessibilità / Motion ===== */
@media (prefers-reduced-motion: reduce){
  .am-card, .am-card__media img{ transition: none !important; }
  .am-shop__viewport{ scroll-behavior: auto; }
}
