/* =========================
   VD · Rail Tier Showcase
   Uniformato al design system
   vd-showcase / vd-chi-siamo
   ========================= */

.vd-rail-tier-page {
  --vd-dark: #0c2931;
  --vd-light: #ededed;
  --vd-mid: #4a5f6a;
  --vd-soft: #b7c5cd;
  --vd-accent: #ff810a;
  --vd-accent-border: rgba(255, 129, 10, 0.72);
  --vd-muted: rgba(237, 237, 237, 0.7);
  --vd-section-bg: #0c2931;
  --vd-section-text: #ededed;

  --vd-glass: rgba(255, 255, 255, 0.08);
  --vd-glass-strong: rgba(255, 255, 255, 0.14);
  --vd-glass-stroke: rgba(237, 237, 237, 0.22);
  --vd-shadow: rgba(5, 20, 24, 0.35);

  --vd-h1-size: clamp(30px, 6vw, 58px);
  --vd-h2-size: clamp(1.2rem, 2.8vw, 1.7rem);
  --vd-lead-size: clamp(16px, 2.6vw, 22px);
  --vd-body-size: clamp(1rem, 2.4vw, 1.1rem);
  --vd-eyebrow-size: clamp(12px, 1.2vw, 16px);

  --vd-section-padding: clamp(56px, 9vw, 120px);
  --vd-radius-pill: 9999px;
  --vd-duration-fast: 0.2s;
  --vd-duration: 0.3s;
  --vd-duration-slow: 0.35s;
  --vd-ease: ease;

  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--vd-dark);
  color: var(--vd-light);
}

.vd-rail-tier-page * {
  box-sizing: border-box;
}

/* ── Section surface ── */

.vdrt-rail-surface {
  position: relative;
  overflow: hidden;
  margin: 0 calc(50% - 50vw);
  padding: var(--vd-section-padding) 16px;
  background: var(--vd-section-bg);
  color: var(--vd-section-text);
}

.vdrt-rail-surface::before,
.vdrt-rail-surface::after {
  content: none;
}

.vdrt-rail-surface > * {
  position: relative;
  z-index: 1;
}

/* ── Heading ── */

.vdrt-rail-heading {
  max-width: 1180px;
  margin: 0 auto clamp(32px, 6vw, 56px);
  text-align: center;
  display: grid;
  gap: 12px;
}

.vdrt-eyebrow {
  font-size: var(--vd-eyebrow-size);
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--vd-section-text);
  margin: 0;
  opacity: 0.85;
}

.vdrt-rail-title {
  font-size: var(--vd-h1-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  color: var(--vd-section-text);
}

.vdrt-rail-lead {
  font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  font-size: var(--vd-lead-size);
  line-height: 1.75;
  color: var(--vd-muted);
  margin: 0;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

/* ── Glass wrapper ── */

.vdrt-rail-bg {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  border: 1px solid var(--vd-glass-stroke);
  border-radius: 24px;
  box-shadow: 0 18px 40px var(--vd-shadow);
  overflow: hidden;
}

/* ── Rail mobile (carousel) ── */

.vdrt-rail {
  --pad-x: 0px;
  --gap: 16px;
}

.vdrt-track {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  padding: 0 var(--pad-x);
  width: 100%;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.vdrt-track::-webkit-scrollbar {
  display: none;
}

.vdrt-slot {
  flex: 0 0 calc(100% - var(--pad-x) * 2);
  max-width: calc(100% - var(--pad-x) * 2);
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

/* ── Pager mobile ── */

.vdrt-pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 18px 0 0;
  max-width: 1180px;
  margin: 0 auto;
}

.vdrt-dot {
  all: unset;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(237, 237, 237, 0.45);
  background: rgba(237, 237, 237, 0.18);
  cursor: pointer;
  transition: background var(--vd-duration-fast) var(--vd-ease),
    border-color var(--vd-duration-fast) var(--vd-ease),
    transform var(--vd-duration-fast) var(--vd-ease);
}

.vdrt-dot[aria-current="true"] {
  background: var(--vd-accent);
  border-color: var(--vd-accent);
  transform: scale(1.2);
}

.vdrt-dot:focus-visible {
  outline: 2px solid rgba(255, 129, 10, 0.65);
  outline-offset: 2px;
}

.vdrt-dot:hover {
  transform: scale(1.08);
}

.vdrt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Tier card ── */

.vdrt-tier {
  background: none;
  border: none;
  box-shadow: none;
  margin: 32px auto;
  max-width: 920px;
  padding: 24px 18px;
  line-height: 1.6;
}

.vdrt-tier-wrap {
  display: grid;
  gap: 20px;
  color: var(--vd-light);
}

/* ── Header ── */

.vdrt-head {
  text-align: center;
}

.vdrt-title {
  font-size: var(--vd-h2-size);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  color: var(--vd-section-text);
}

.vdrt-sub {
  font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  color: var(--vd-soft);
  margin: 0.35rem 0 0.6rem;
  line-height: 1.6;
}

.vdrt-price {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 700;
  margin: 0;
}

.vdrt-price span {
  display: block;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 0.55em;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vd-soft);
  opacity: 0.75;
  margin-top: 2px;
}

/* ── Description ── */

.vdrt-desc {
  font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  font-size: var(--vd-body-size);
  color: var(--vd-muted);
  text-align: center;
  line-height: 1.75;
}

.vdrt-desc p {
  margin: 0;
}

/* ── CTA — pattern identico a vd-showcase-cta ── */

.vdrt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: var(--vd-radius-pill);
  background: transparent;
  border: 1px solid currentColor;
  color: var(--vd-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: color var(--vd-duration) var(--vd-ease),
    border-color var(--vd-duration) var(--vd-ease);
}

.vdrt-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--vd-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--vd-duration-slow) var(--vd-ease);
  z-index: -1;
}

.vdrt-btn:hover {
  color: var(--vd-dark);
  border-color: var(--vd-accent);
}

.vdrt-btn:hover::before {
  transform: scaleX(1);
}

.vdrt-btn:focus-visible {
  outline: 2px solid rgba(255, 129, 10, 0.65);
  outline-offset: 3px;
}

.vdrt-cta-top,
.vdrt-cta-btm {
  display: flex;
  justify-content: center;
}

/* ── Includes / Tech glass cards ── */

.vdrt-includes,
.vdrt-tech {
  background: var(--vd-glass);
  border: 1px solid var(--vd-glass-stroke);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--vd-light);
}

.vdrt-includes h3,
.vdrt-extra-wrap h4,
.vdrt-tech-content h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vd-soft);
  margin: 0;
}

.vdrt-includes p {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
}

.vdrt-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.vdrt-points li {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ── Tech details ── */

.vdrt-tech summary {
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--vd-soft);
  list-style: none;
  padding: 4px 0;
}

.vdrt-tech summary::-webkit-details-marker {
  display: none;
}

.vdrt-tech-content {
  display: grid;
  gap: 16px;
  padding-top: 12px;
}

.vdrt-tech-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.vdrt-tech-content li::before {
  content: '•';
  margin-right: 6px;
  opacity: 0.85;
}

.vdrt-tech-content li {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ── Extra toggle ── */

.vdrt-extra-wrap {
  display: grid;
  gap: 16px;
}

.vdrt-extra-wrap ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.vdrt-extra-wrap li::before {
  content: '•';
  margin-right: 6px;
  opacity: 0.85;
}

.vdrt-extra-wrap li {
  font-size: 0.95rem;
  line-height: 1.5;
}

.vdrt-extra-wrap p {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
}

.vdrt-extra-box {
  border-top: 1px solid var(--vd-glass-stroke);
  padding-top: 14px;
  margin-top: 4px;
}

.vdrt-toggle-wrap {
  text-align: center;
  margin-top: auto;
}

.vdrt-extra {
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 0.6s var(--vd-ease), opacity 0.5s var(--vd-ease);
}

.vdrt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--vd-soft);
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--vd-duration-fast) var(--vd-ease);
}

.vdrt-toggle:hover {
  color: var(--vd-light);
}

.vdrt-toggle:focus-visible {
  outline: 2px solid rgba(255, 129, 10, 0.65);
  outline-offset: 4px;
}

.vdrt-arrow {
  transition: transform var(--vd-duration) var(--vd-ease);
}

.vdrt-toggle.open .vdrt-arrow {
  transform: rotate(180deg);
}

/* ── Desktop: grid 4 colonne ── */

@media (min-width: 1024px) {
  .vdrt-rail-surface {
    padding-left: clamp(16px, 3vw, 48px);
    padding-right: clamp(16px, 3vw, 48px);
  }

  .vdrt-rail-bg {
    max-width: 100%;
  }

  .vdrt-pager {
    display: none;
  }

  .vdrt-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    overflow: visible;
    padding: 0;
    background: none;
    border: none;
  }

  .vdrt-tier {
    margin: 0;
    padding: 0;
    height: 100%;
  }

  .vdrt-tier-wrap {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
    height: 100%;
  }

  .vdrt-head {
    text-align: center;
  }

  .vdrt-desc {
    text-align: left;
  }

  .vdrt-desc {
    min-height: 11.5rem;
  }

  .vdrt-cta-top,
  .vdrt-cta-btm {
    justify-content: center;
  }

  .vdrt-includes {
    flex: 1 1 auto;
  }

  /* Push CTA bottom to the end */
  .vdrt-cta-btm {
    margin-top: auto;
  }

  .vdrt-slot {
    position: relative;
    flex: 1;
    max-width: none;
  }

  .vdrt-slot:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(
      to bottom,
      rgba(237, 237, 237, 0) 0%,
      rgba(237, 237, 237, 0.45) 40%,
      rgba(237, 237, 237, 0.45) 60%,
      rgba(237, 237, 237, 0) 100%
    );
    pointer-events: none;
  }

  .vdrt-more-anchor {
    display: none;
  }

  .vdrt-toggle-wrap {
    display: block;
    text-align: left;
  }

  .vdrt-toggle.open ~ .vdrt-extra {
    height: auto;
    opacity: 1;
    overflow: visible;
  }
}

/* ── Ultrawide: cap at 1920px ── */

@media (min-width: 1920px) {
  .vdrt-rail-bg {
    max-width: 1800px;
    margin: 0 auto;
  }
}

/* ── Mobile small ── */

@media (max-width: 720px) {
  .vdrt-rail-title {
    letter-spacing: 0.05em;
  }

  .vdrt-btn {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    padding: 10px 20px;
  }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .vdrt-toggle,
  .vdrt-arrow,
  .vdrt-btn,
  .vdrt-btn::before,
  .vdrt-dot,
  .vdrt-extra {
    transition: none;
  }

  .vdrt-track {
    scroll-behavior: auto;
  }
}
