/* ══════════════════════════════════════════════════
   WMR — Componenti riutilizzabili
   Bottoni, label, sezioni, card, nav
   ══════════════════════════════════════════════════ */

/* ── BOTTONI ── */
.btn-primary {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--accent);
  padding: 20px 48px;
  border-radius: 4px;
  transition: background var(--transition), box-shadow var(--transition);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 32px var(--accent-glow);
}
/* Previeni stretch full-width in contesti flex column */
.btn-primary { align-self: flex-start; }
.btn-primary.btn-xl {
  padding: 22px 56px;
  font-size: 12px;
  text-align: center;
  align-self: auto; /* btn-xl in CTA sections può restare centrato */
}

/* Secondary button — outline variant */
.btn-secondary {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 20px 48px;
  border-radius: 4px;
  transition: background var(--transition), border-color var(--transition);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.4);
}
.btn-secondary.btn-xl {
  padding: 22px 56px;
  font-size: 12px;
  text-align: center;
}

.btn-ghost {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color var(--transition);
}
.btn-ghost::after {
  content: '\2192';
  font-size: 14px;
}
.btn-ghost:hover { color: var(--white); }

/* ── LABEL DI SEZIONE ── */
.section-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 5vw, 72px);
  line-height: 0.95;
  letter-spacing: 0.02em;
}

/* ── HEADER DI SEZIONE ── */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 80px;
}

.section-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition), border-color var(--transition);
}
.section-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── NAV DESKTOP ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-pad);
  height: var(--nav-height);
  background: rgba(13,13,13,0.98);
  backdrop-filter: none;
}

.nav-logo {
  display: flex;
  align-items: center;
}
.nav-logo img {
  height: 36px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 40px;
}
.nav-links a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--white); }

/* ── NAV DROPDOWN ── */
.nav-dropdown {
  position: relative;
}
.nav-chevron {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  transition: transform 0.2s;
}
.nav-dropdown:hover .nav-chevron {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: rgba(17,17,17,0.97);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 0;
  margin-top: 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
  transform: translateX(-50%) translateY(8px);
  z-index: 110;
}
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 10px 24px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s, background 0.15s, padding-left 0.15s;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover {
  color: var(--white);
  background: rgba(123,47,255,0.08);
  padding-left: 28px;
}
.nav-dropdown-menu a:first-child {
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  padding-bottom: 12px;
}
.nav-dropdown-menu a:first-child:hover {
  color: var(--white);
}

.nav-cta {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--accent);
  padding: 10px 24px;
  border-radius: 4px;
  transition: background var(--transition), box-shadow var(--transition);
}
.nav-cta:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 24px var(--accent-glow);
}

/* ── LANG SWITCHER ── */
.lang-switcher {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-right: 24px;
}
.lang-btn {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  padding: 7px 14px;
  font-family: var(--font-body);
  transition: all var(--transition);
}
.lang-btn.active {
  background: var(--accent);
  color: var(--white);
  border-radius: 2px;
}
.lang-btn:not(.active):hover { color: var(--white); }

/* ── CART BUTTON ── */
.cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 4px;
  transition: all var(--transition);
}
.cart-btn:hover { border-color: var(--accent); color: var(--accent); }
.cart-count {
  background: var(--accent);
  color: var(--white);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 500;
}

/* ── MOBILE BOTTOM NAV ── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(17,17,17,0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
}
.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
}
.mnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  transition: color var(--transition);
}
.mnav-item.active,
.mnav-item:hover { color: var(--accent); }
.mnav-icon { font-size: 20px; }

/* ── STAT BAR ── */
.stat {
  flex: 1;
  padding: 28px var(--page-pad);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--font-display);
  font-size: 72px;
  color: var(--white);
  line-height: 1;
}
.stat-num span { color: var(--accent); }
.stat-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── SERVICE CARD ── */
.service-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
}
.service-card.large { grid-row: span 2; aspect-ratio: 4/5; }
.service-card.small { /* height driven by grid row — no aspect-ratio */ }

.service-card-inner {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(10,10,10,0.9) 0%, rgba(10,10,10,0.2) 50%, transparent 100%);
  transition: background 0.3s;
}
.service-card:hover .service-card-inner {
  background: linear-gradient(to top, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.5) 60%, rgba(123,79,255,0.1) 100%);
}

.card-bg {
  position: absolute;
  inset: 0;
  transition: transform 0.6s var(--ease-out);
}
.card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.service-card:hover .card-bg { transform: scale(1.04); }

.service-tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 8px;
}
.service-name {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--white);
  margin-bottom: 12px;
}
.service-card.large .service-name { font-size: 52px; }
.service-desc {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(245,245,245,0.55);
  max-width: 320px;
}
.service-arrow {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 16px;
  transition: all var(--transition);
}
.service-card:hover .service-arrow {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── PORTFOLIO ITEM ── */
.portfolio-item {
  flex: 0 0 400px;
  aspect-ratio: 3/4;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}
.portfolio-item::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 80px 30px rgba(10,10,10,0.7);
  pointer-events: none;
  z-index: 1;
}
.portfolio-item-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s var(--ease-out);
}
.portfolio-item:hover .portfolio-item-bg { transform: scale(1.05); }
.portfolio-item-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: 24px;
  background: linear-gradient(to top, rgba(10,10,10,0.95) 0%, transparent 100%);
  transform: translateY(8px);
  transition: transform 0.3s;
}
.portfolio-item:hover .portfolio-item-info { transform: translateY(0); }
.pi-category {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.pi-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.03em;
  color: var(--white);
}
.pi-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── BACK TO TOP (globale) ── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 90;
  width: 48px;
  height: 48px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
  box-shadow: 0 4px 20px rgba(123,47,255,0.3);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 28px var(--accent-glow);
}
@media (max-width: 768px) {
  .back-to-top { bottom: 80px; right: 16px; width: 42px; height: 42px; }
  .stat-num { font-size: 36px; }
  .stat-label { font-size: 11px; }
  .stat { gap: 12px; padding: 20px var(--page-pad-mobile); }
}

/* ── ANIMAZIONI ── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeup 0.8s var(--ease-out) forwards;
}
.fade-up:nth-child(1) { animation-delay: 0.1s; }
.fade-up:nth-child(2) { animation-delay: 0.25s; }
.fade-up:nth-child(3) { animation-delay: 0.4s; }
.fade-up:nth-child(4) { animation-delay: 0.55s; }

@keyframes fadeup {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollpulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ── DESKTOP WIDE — nav con più respiro ── */
@media (min-width: 1440px) {
  .nav { padding: 0 8vw; }
}
@media (min-width: 1920px) {
  .nav { padding: 0 12vw; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav { padding: 0 var(--page-pad-mobile); }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .mobile-nav { display: block; }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .stat {
    padding: 16px var(--page-pad-mobile);
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .service-card.large {
    aspect-ratio: 3/2;
    grid-row: span 1;
  }

  .portfolio-item { flex: 0 0 280px; }
}
