/* =========================================================
   File: sb-home.css
   Style: Apple/Instagram Clean Premium — Mobile First
   ========================================================= */

/* -----------------------------
   0) Tokens + Global
-------------------------------- */
body.sb-home-ready{
  /* fallback tokens (se non già definiti altrove) */
  --sb-brand: #01144f;
  --sb-dark: #0f172a;
  --sb-text: #334155;
  --sb-muted: #64748b;
  --sb-border: rgba(15, 23, 42, 0.10);

  background-color: #f8fafc;
}

/* Evita overflow orizzontali da elementi troppo larghi */
body.sb-home-ready,
body.sb-home-ready #inner-wrap,
body.sb-home-ready #page{
  overflow-x: clip;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  body.sb-home-ready *{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Se il tema aggiunge padding bottom “strano” su mobile */
@media (max-width: 767px){
  body.sb-home-ready{
    padding-bottom: 0 !important;
  }
}

/* Helpers spacing */
.sb-section-gap{
  padding: clamp(34px, 6vw, 60px) 0;
}

/* -----------------------------
   1) Hero
-------------------------------- */
.sb-home-hero{
  padding: clamp(48px, 9vw, 90px) 0 clamp(34px, 7vw, 70px);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%,
      rgba(239, 246, 255, 1) 0%,
      rgba(248, 250, 252, 0) 70%);
}

.sb-pill-tag{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #e0e7ff;
  color: var(--sb-brand);

  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;

  padding: 7px 14px;
  border-radius: 999px;

  margin-bottom: 16px;
}

.sb-hero-title{
  margin: 0 0 14px 0;
  color: var(--sb-dark);
  font-weight: 950;
  letter-spacing: -0.035em;
  line-height: 1.06;
  font-size: clamp(2.05rem, 5.6vw, 4rem);
}

.sb-text-gradient{
  background: linear-gradient(135deg, var(--sb-brand) 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sb-hero-sub{
  margin: 0 auto 22px;
  max-width: 44rem;

  font-size: clamp(1.02rem, 2.1vw, 1.2rem);
  line-height: 1.6;
  color: var(--sb-text);
}

.sb-hero-actions{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  justify-content: center;

  max-width: 420px;
  margin: 0 auto;
}

@media (min-width: 540px){
  .sb-hero-actions{
    grid-template-columns: 1fr 1fr;
    max-width: 560px;
  }
}

.sb-btn-hero{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--sb-brand);
  color: #fff;
  text-decoration: none;

  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.02rem;

  min-height: 46px;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.sb-btn-hero:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -8px rgba(1, 20, 79, 0.45);
  color: #fff;
}

/* Se il bottone ghost è un <a> col class sb-btn sb-btn-ghost */
.sb-btn-ghost{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 46px;
  padding: 14px 18px;
  border-radius: 999px;

  text-decoration: none;
}

/* Focus accessibility */
.sb-btn-hero:focus-visible,
.sb-btn-ghost:focus-visible,
.sb-cat-pill:focus-visible,
.sb-prod-link:focus-visible,
.sb-btn-buy:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(1, 20, 79, 0.18);
}

/* -----------------------------
   2) Category scroller (mobile native)
-------------------------------- */
.sb-cat-scroller{
  padding: 0 0 22px;
  overflow: hidden;
}

/* Track: scroll + snap */
.sb-cat-track{
  display: flex;
  gap: 10px;

  overflow-x: auto;
  -webkit-overflow-scrolling: touch;

  padding: 4px 20px 14px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 20px;
}

.sb-cat-track::-webkit-scrollbar{ display: none; }

/* Desktop: center, ma senza rompere lo scroll */
@media (min-width: 900px){
  .sb-cat-track{
    justify-content: center;
  }
}

.sb-cat-pill{
  scroll-snap-align: start;

  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--sb-border);

  padding: 10px 16px;
  border-radius: 999px;

  font-weight: 750;
  color: var(--sb-dark);
  font-size: 0.92rem;
  text-decoration: none;

  box-shadow: 0 2px 8px rgba(2, 8, 23, 0.04);
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.sb-cat-pill:hover,
.sb-cat-pill.active{
  background: var(--sb-dark);
  color: #fff;
  border-color: var(--sb-dark);
  transform: translateY(-1px);
}

/* -----------------------------
   3) Section header (wrap safe)
-------------------------------- */
.sb-section-header{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;

  margin-bottom: 18px;
  padding: 0 2px;

  flex-wrap: wrap; /* evita rotture su mobile */
}

.sb-section-header h2{
  margin: 0;
  font-size: clamp(1.25rem, 3.6vw, 1.85rem);
  letter-spacing: -0.02em;
  color: var(--sb-dark);
}

.sb-link-arrow{
  font-weight: 850;
  color: var(--sb-brand);
  text-decoration: none;
  white-space: nowrap;
}

.sb-link-arrow:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* -----------------------------
   4) Product grid (true responsive)
-------------------------------- */
/* 1 col sui telefoni piccoli, poi 2, poi 3/4 */
.sb-product-grid{
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr; /* safest default */
}

@media (min-width: 420px){
  .sb-product-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 780px){
  .sb-product-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }
}

@media (min-width: 1100px){
  .sb-product-grid{
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
  }
}

/* CARD */
.sb-prod-card{
  background: #fff;
  border-radius: 20px;
  overflow: hidden;

  border: 1px solid rgba(2, 8, 23, 0.06);
  box-shadow: 0 10px 26px rgba(2, 8, 23, 0.06);

  display: flex;
  flex-direction: column;
  height: 100%;

  transition: transform 220ms ease, box-shadow 220ms ease;
}

@media (hover:hover){
  .sb-prod-card:hover{
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(2, 8, 23, 0.10);
  }
}

.sb-prod-link{
  text-decoration: none;
  color: inherit;

  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Media */
.sb-prod-media{
  position: relative;
  aspect-ratio: 2 / 3;
  background: #f1f5f9;
  overflow: hidden;

  margin: 10px;
  border-radius: 14px;
}

.sb-prod-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;

  transition: transform 420ms ease;
}

@media (hover:hover){
  .sb-prod-card:hover .sb-prod-img{
    transform: scale(1.04);
  }
}

.sb-badge-sale{
  position: absolute;
  top: 8px;
  left: 8px;

  background: rgba(255, 255, 255, 0.92);
  color: var(--sb-brand);

  font-size: 0.72rem;
  font-weight: 900;

  padding: 4px 8px;
  border-radius: 8px;

  box-shadow: 0 10px 20px rgba(2, 8, 23, 0.10);
}

/* Info */
.sb-prod-info{
  padding: 8px 14px 0;
  flex-grow: 1;
}

.sb-prod-title{
  margin: 0 0 6px 0;
  color: var(--sb-dark);

  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.28;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  overflow-wrap: anywhere;
}

.sb-prod-meta{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sb-prod-price{
  font-weight: 900;
  color: var(--sb-text);
  font-size: 0.95rem;
}

.sb-prod-star{
  font-size: 0.82rem;
  color: #f59e0b;
  font-weight: 800;
  white-space: nowrap;
}

/* CTA */
.sb-prod-action{
  padding: 0 14px 14px;
  margin-top: auto;
}

.sb-btn-buy{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 44px;

  text-align: center;
  text-decoration: none;

  background: #f1f5f9;
  color: var(--sb-brand);

  font-weight: 900;
  font-size: 0.92rem;

  padding: 10px 12px;
  border-radius: 12px;

  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

@media (hover:hover){
  .sb-prod-card:hover .sb-btn-buy{
    background: var(--sb-brand);
    color: #fff;
    transform: translateY(-1px);
  }
}

/* -----------------------------
   5) Manifesto / Brand break
-------------------------------- */
.sb-brand-break{
  background: var(--sb-brand);
  padding: clamp(44px, 8vw, 84px) 18px;
  text-align: center;
  margin: clamp(34px, 6vw, 60px) 0;
  color: #fff;
}

.sb-brand-break blockquote{
  margin: 0 auto;
  max-width: 52rem;

  font-size: clamp(1.05rem, 3.2vw, 1.75rem);
  font-weight: 900;
  line-height: 1.35;

  border: none;
}
