/* ==========================================================================
   GR-LPB — Global CSS
   Reset, base, layout, utility classes.
   ========================================================================== */

/* --- Reset minimale ---------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Previene scroll orizzontale su mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

p {
  margin: 0;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* --- Custom Properties (bridge con theme.json) ------------------------- */
:root {
  --gr-transition-base: all 0.3s ease;
  --gr-transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --gr-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --gr-shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --gr-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.08);
  --gr-shadow-red: 0 8px 30px rgba(198, 40, 40, 0.3);
  --gr-radius-sm: 0;
  --gr-radius-md: 0;
  --gr-header-height: 80px;
  --gr-header-height-scrolled: 64px;
}

/* --- Layout base ------------------------------------------------------- */
.gr-container {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
}

@media (max-width: 1199px) {
  .gr-container {
    padding-left: 32px;
    padding-right: 32px;
  }
}

@media (max-width: 767px) {
  .gr-container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* --- Sezioni ----------------------------------------------------------- */
.gr-section {
  padding-top: 72px;
  padding-bottom: 72px;
}

@media (max-width: 1199px) {
  .gr-section {
    padding-top: 56px;
    padding-bottom: 56px;
  }
}

@media (max-width: 767px) {
  .gr-section {
    padding-top: 40px;
    padding-bottom: 40px;
  }
}

/* --- Section Header (label + title + divider) -------------------------- */
.gr-section-label {
  font-family: var(--wp--preset--font-family--body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--wp--preset--color--primary);
  margin-bottom: 16px;
}

.gr-section-title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--wp--preset--color--text-primary);
  margin-bottom: 20px;
}

.gr-section-divider {
  width: 60px;
  height: 3px;
  background: var(--wp--preset--color--primary);
  margin-bottom: 32px;
  margin-left: auto;
  margin-right: auto;
}

.gr-section-subtitle {
  font-family: var(--wp--preset--font-family--body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--wp--preset--color--text-primary);
  margin-bottom: 16px;
  max-width: 780px;
}

.gr-section-description {
  font-family: var(--wp--preset--font-family--body);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--wp--preset--color--text-secondary);
  max-width: 780px;
}

/* Variante centrata */
.gr-section-header--center {
  text-align: center;
}

.gr-section-header--center .gr-section-divider {
  margin-left: auto;
  margin-right: auto;
}

.gr-section-header--center .gr-section-description {
  margin-left: auto;
  margin-right: auto;
}

/* --- Griglia prodotti -------------------------------------------------- */
.gr-grid {
  display: grid;
  gap: 20px;
}

.gr-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.gr-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.gr-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1199px) {
  .gr-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .gr-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .gr-grid--3,
  .gr-grid--4,
  .gr-grid--2 {
    grid-template-columns: 1fr;
  }
}

/* --- Utility ----------------------------------------------------------- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-40 { gap: 40px; }
.gap-60 { gap: 60px; }

.mt-auto { margin-top: auto; }

/* --- Background varianti ---------------------------------------------- */
.bg-surface     { background-color: var(--wp--preset--color--surface); }
.bg-surface-alt { background-color: var(--wp--preset--color--surface-alt); }
.bg-dark        { background-color: var(--wp--preset--color--surface-dark); }
.bg-primary     { background-color: var(--wp--preset--color--primary); }

/* --- Animazioni scroll ------------------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: var(--gr-transition-smooth);
  transition-duration: 0.8s;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* --- Separatori -------------------------------------------------------- */
.gr-divider-red {
  width: 60px;
  height: 3px;
  background: var(--wp--preset--color--primary);
  border: none;
}
