@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ========== TOKENS ========== */
:root {
  --dark: #ffffff;
  --dark-2: #fbedd6;
  --dark-3: #fbedd6;
  --muted: #968B7B;
  --light: #1a1a1a;
  --white: #0f0f0f;
  --accent: #EE6C23;
  --accent-h: #EC8D23;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Source Sans 3', system-ui, sans-serif;
  --title-color: #EE6C23;
  --label-color: #000000;
  --max-w: 1280px;
  --radius: 12px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== RESET ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  scroll-behavior: smooth;
  font-size: 16px
}

body {
  font-family: var(--sans);
  background: #ffffff;
  color: #1a1a1a;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow text selection inside inputs and textareas for forms */
input,
textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

img {
  display: block;
  max-width: 100%;
  object-fit: cover
}

a {
  color: inherit;
  text-decoration: none
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit
}

ul {
  list-style: none
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
}

/* ========== UTILITIES ========== */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px
}

.section {
  padding: 96px 0
}

.section-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--label-color);
  margin-bottom: 16px
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--title-color)
}

.section-title em {
  font-style: italic;
  font-weight: 300
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: var(--transition)
}

.btn-accent {
  background: var(--accent);
  color: var(--label-color)
}

.btn-accent:hover {
  background: var(--accent-h);
  transform: translateY(-2px)
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, .4);
  color: #ffffff
}

.btn-outline:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, .1)
}

/* btn-outline dark variant for light sections */
.section .btn-outline,
footer .btn-outline {
  border-color: rgba(0, 0, 0, .25);
  color: #1a1a1a
}

.section .btn-outline:hover,
footer .btn-outline:hover {
  border-color: #0f0f0f;
  background: rgba(0, 0, 0, .05)
}

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .7s ease, transform .7s ease
}

.reveal.visible {
  opacity: 1;
  transform: none
}

.reveal-left {
  opacity: 0;
  transform: translateX(64px);
  transition: opacity .7s ease, transform .7s ease
}

.reveal-left.visible {
  opacity: 1;
  transform: none
}

.reveal-right {
  opacity: 0;
  transform: translateX(-64px);
  transition: opacity .7s ease, transform .7s ease
}

.reveal-right.visible {
  opacity: 1;
  transform: none
}

/* ========== NAV ========== */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 0;
  transition: background var(--transition), padding var(--transition), box-shadow var(--transition)
}

/* Hero video + controls */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}

.hero-video-controls {
  position: absolute;
  top: 90px;
  right: 24px;
  z-index: 10;
  display: flex;
  flex-direction: row;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s;
}

#hero.video-playing .hero-video-controls {
  opacity: 1;
  visibility: visible;
}

.hero-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 15, 15, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.hero-control-btn:hover {
  background: rgba(15, 15, 15, 0.7);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.hero-control-btn:active {
  transform: translateY(0);
}

/* Transición para ocultar/mostrar textos y estadísticas */
.hero-content,
.hero-stats {
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 1s;
}

#hero.video-playing .hero-content {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  visibility: hidden;
}

#hero.video-playing .hero-stats {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#hero.video-finished .hero-video {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s;
}

#hero.video-finished .hero-video-controls {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#hero.video-playing .hero-overlay {
  opacity: 0.15;
}

@media(max-width: 768px) {
  .hero-video-controls {
    flex-direction: column;
    top: 80px;
    right: 16px;
  }
}

#nav.scrolled {
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  padding: 16px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .08)
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: .04em;
  color: #ffffff
}

.nav-logo span {
  color: var(--accent)
}

.nav-links {
  display: flex;
  gap: 36px
}

.nav-links a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .8);
  transition: color var(--transition)
}

.nav-links a:hover {
  color: #ffffff
}

/* Nav dark when scrolled (over light sections) */
#nav.scrolled .nav-logo {
  color: #0f0f0f
}

#nav.scrolled .nav-links a {
  color: rgba(0, 0, 0, .55)
}

#nav.scrolled .nav-links a:hover {
  color: #0f0f0f
}

#nav.scrolled .nav-hamburger span {
  background: #0f0f0f
}

.nav-cta {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 10px 22px;
  border-radius: var(--radius);
  transition: var(--transition)
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--label-color)
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px
}

.nav-hamburger span {
  display: block;
  height: 1.5px;
  background: #ffffff;
  transition: var(--transition)
}

/* ========== HERO ========== */
#hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-image: url('../assets/images/hero_bg.jpg');
  background-size: cover;
  background-position: center top;
}

@media(max-width: 768px) {
  #hero {
    background-image: url('../assets/images/hero_bg2.jpg');
    background-position: center top;
    height: 100vh;
    height: 100dvh;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 15, 15, .35) 0%, rgba(15, 15, 15, .6) 60%, rgba(15, 15, 15, .95) 100%);
  transition: opacity 1s ease;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-bottom: 220px
}

.hero-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(246, 148, 3, .5);
  padding: 6px 14px;
  border-radius: 6px;
  margin-bottom: 28px
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6.5vw, 6rem);
  font-weight: 600;
  line-height: 0.88;
  color: #ffffff;
  max-width: 800px
}

.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: rgba(255, 255, 255, .85)
}

.hero-sub {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 300;
  color: rgba(255, 255, 255, .7);
  max-width: 480px;
  line-height: 1.7
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap
}

/* Certificaciones link inline with buttons */
.hero-cert-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .65);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.hero-cert-link:hover {
  color: #ffffff;
}

.hero-cert-link:hover .hero-cert-thumb {
  border-color: rgba(255, 255, 255, .6);
}

.hero-cert-label {
  display: none;
}

.hero-cert-thumbs {
  display: flex;
  gap: 6px;
}

.hero-cert-thumb {
  height: 45px;
  width: auto;
  aspect-ratio: 11 / 8.5;
  background: rgba(255, 255, 255, .92);
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, .3);
  transition: border-color var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .hero-cert-label {
    display: none;
  }
}

.hero-stats {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: rgba(12, 75, 115, 0.85);
  backdrop-filter: blur(10px)
}

.hero-stat {
  padding: 22px 32px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, .1)
}

.hero-stat:last-child {
  border-right: none
}

.hero-stat-num {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 300;
  color: #ffffff;
  display: block;
  line-height: 1;
}

.hero-stat-lbl {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .55);
  text-transform: uppercase;
  margin-top: 4px;
  padding-bottom: 6px;
  line-height: 1.1;
}

/* ========== PATIENTS ========== */
#pacientes {
  background: var(--dark)
}

.patients-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 56px;
  flex-wrap: wrap;
  gap: 24px
}

.patients-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px
}

.patient-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 3/4;
  cursor: pointer
}

.patient-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease
}

.patient-card:hover img {
  transform: scale(1.05)
}

.patient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  padding-right: 84px; /* Espacio para el botón de play a la derecha */
  opacity: .9;
  transition: opacity var(--transition)
}

.patient-card:hover .patient-overlay {
  opacity: 1
}

.patient-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: #ffffff
}

.patient-info {
  font-size: 12px;
  color: rgba(255, 255, 255, .65);
  margin-top: 4px;
  letter-spacing: .05em
}

.patient-play {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  z-index: 3;
}

/* En escritorio: aparece al hacer hover en la esquina inferior derecha */
@media (hover: hover) and (min-width: 769px) {
  .patient-play {
    transform: scale(0);
  }
  .patient-card:hover .patient-play {
    transform: scale(1);
  }
}

/* En dispositivos móviles/táctiles: visible siempre abajo a la derecha junto al texto */
@media (hover: none), (max-width: 768px) {
  .patient-play {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    transform: scale(1);
  }
}

.patient-play svg {
  margin-left: 3px;
}

/* ========== PROCEDURES ========== */
#tratamientos {
  background: var(--dark-2)
}

.procs-header {
  margin-bottom: 56px
}

.procs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px
}

.proc-card {
  display: block;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  cursor: pointer
}

/* First card (Ortognática) is the featured one — full width */
.proc-card:first-child {
  grid-column: span 3;
  aspect-ratio: 21/7
}

.proc-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease, filter .6s ease
}

.proc-card:hover img {
  transform: scale(1.04);
  filter: brightness(1.1)
}

.proc-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 32px;
  background: linear-gradient(to top, rgba(0, 0, 0, .85), transparent);
  display: flex;
  justify-content: space-between;
  align-items: flex-end
}

.proc-name {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 300;
  color: #ffffff;
  line-height: 1.2;
}

.proc-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition)
}

.proc-card:hover .proc-arrow {
  background: var(--accent);
  border-color: var(--accent)
}

/* ========== DOCTOR ========== */
#doctor {
  background: var(--dark)
}

.doctor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 640px;
  border-radius: var(--radius);
  overflow: hidden
}

.doctor-portrait {
  position: relative;
  overflow: hidden
}

.doctor-portrait>img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 560px
}

.doctor-portrait-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 60%, #ffffff)
}

.doctor-stats {
  position: absolute;
  bottom: 32px;
  left: 32px;
  display: flex;
  gap: 24px
}

.doctor-stat-box {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, .1);
  padding: 16px 20px;
  border-radius: var(--radius)
}

.doctor-stat-n {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--title-color);
  display: block
}

.doctor-stat-l {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #555
}

.logo-tooltip {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.logo-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #0f0f0f;
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: normal;
  width: max-content;
  max-width: 180px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  pointer-events: none;
  z-index: 10;
  margin-bottom: 10px;
}

.logo-tooltip:first-child::after {
  left: -10px;
  text-align: left;
  transform: translateY(8px);
}

.logo-tooltip:nth-child(2)::after {
  left: 50%;
  transform: translateX(-50%) translateY(8px);
}

.logo-tooltip:last-child::after {
  right: -10px;
  text-align: right;
  transform: translateY(8px);
}

.logo-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  border: 5px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 11;
  margin-bottom: 0px;
}

.logo-tooltip:first-child:hover::after,
.logo-tooltip:first-child:active::after,
.logo-tooltip:last-child:hover::after,
.logo-tooltip:last-child:active::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.logo-tooltip:nth-child(2):hover::after,
.logo-tooltip:nth-child(2):active::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.logo-tooltip:hover::before,
.logo-tooltip:active::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.doctor-content {
  padding: 80px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}

.tabs-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.doctor-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid rgba(12, 75, 115, 0.1);
  margin-top: 15px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
}

.tab-btn {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 12px 24px;
  color: rgba(12, 75, 115, 0.6);
  background: rgba(12, 75, 115, 0.03);
  border: none;
  border-radius: 12px 12px 0 0;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--accent);
}

.tab-btn.active {
  color: #ffffff;
  background: var(--accent);
  font-weight: 600;
}

.tab-panel {
  font-size: 14px;
  font-weight: 300;
  color: rgba(0, 0, 0, .65);
  line-height: 1.9;
  display: none;
}

.tab-panel.active {
  display: block;
}

.doctor-tabs-container {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.doctor-tabs-container>.tab-panel {
  grid-column: 1;
  grid-row: 1;
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.doctor-tabs-container>.tab-panel.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ========== TEAM ========== */
#equipo {
  background: var(--dark-2)
}

.team-header {
  text-align: center;
  margin-bottom: 56px
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px
}

.team-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 3/4
}

.team-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  filter: grayscale(20%);
  transition: transform .6s ease, filter .6s ease
}

.team-card:hover img {
  transform: scale(1.04);
  filter: grayscale(0)
}

.team-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 24px 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
}

.team-name {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 4px;
}

.team-role {
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.team-desc {
  font-size: 11px;
  color: #ffffff;
  margin-top: 6px;
  line-height: 1.4;
}

/* ========== INSIGHTS ========== */
#insights {
  background: var(--dark)
}

.insights-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 56px;
  flex-wrap: wrap;
  gap: 24px
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px
}

.insight-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition)
}

.insight-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 0, 0, .16);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .08)
}

.insight-img {
  aspect-ratio: 16/9;
  overflow: hidden
}

.insight-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease
}

.insight-card:hover .insight-img img {
  transform: scale(1.06)
}

.insight-body {
  padding: 28px
}

.insight-cat {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--label-color);
  margin-bottom: 12px
}

.insight-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--title-color);
  line-height: 1.3;
  margin-bottom: 12px
}

.insight-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 20px
}

.insight-link {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition)
}

.insight-card:hover .insight-link {
  gap: 12px
}

/* ========== FAQ ========== */
#faq {
  background: var(--dark-2)
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0
}

.faq-item {
  border-bottom: 1px solid rgba(0, 0, 0, .1)
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 15px;
  font-weight: 400;
  color: #2a2a2a;
  transition: color var(--transition)
}

.faq-question:hover {
  color: #0f0f0f
}

.faq-question.active {
  color: var(--accent)
}

.faq-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition)
}

.faq-question.active .faq-icon {
  background: var(--accent);
  border-color: var(--accent)
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .4s ease
}

.faq-answer.open {
  max-height: 300px;
  padding-bottom: 22px
}

.faq-answer p {
  font-size: 14px;
  color: #666;
  line-height: 1.9
}

.faq-aside {
  position: sticky;
  top: 120px
}

.faq-aside-title {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--title-color);
  margin-bottom: 20px
}

.faq-aside-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 32px
}

/* ========== CONTACT ========== */
#contacto {
  background: var(--dark);
  position: relative;
  overflow: hidden
}

#contacto::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(246, 148, 3, .06), transparent 60%)
}

.contact-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center
}

.contact-inner .section-title {
  margin-bottom: 12px
}

.contact-sub {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 56px;
  line-height: 1.7
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: left
}

.form-field {
  position: relative
}

.form-field.full {
  grid-column: span 2
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  font-family: var(--sans);
  color: #0f0f0f;
  transition: border-color var(--transition)
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent)
}

.form-select {
  appearance: none;
  cursor: pointer
}

.form-select option {
  background: #ffffff;
  color: #0f0f0f
}

.form-textarea {
  min-height: 120px;
  resize: vertical
}

.form-submit {
  width: 100%;
  margin-top: 8px;
  padding: 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--label-color);
  border-radius: var(--radius);
  justify-content: center;
  transition: var(--transition)
}

.form-submit:hover {
  background: var(--accent-h);
  transform: translateY(-2px)
}

.form-privacy {
  font-size: 11px;
  color: var(--muted);
  margin-top: 16px;
  text-align: center;
  line-height: 1.6
}

/* ========== FOOTER ========== */
footer {
  background: #fbedd6;
  border-top: 1px solid rgba(0, 0, 0, .08);
  padding: 64px 0 32px
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px
}

.footer-brand .nav-logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
  display: block
}

.footer-brand p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 260px
}

.footer-col h4 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--title-color);
  margin-bottom: 20px
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.footer-col ul li a {
  font-size: 13px;
  color: #888;
  transition: color var(--transition)
}

.footer-col ul li a:hover {
  color: #0f0f0f
}

.footer-bottom {
  border-top: 1px solid rgba(0, 0, 0, .08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px
}

.footer-copy {
  font-size: 12px;
  color: #888
}

.footer-legal {
  display: flex;
  gap: 24px
}

.footer-legal a {
  font-size: 12px;
  color: #888;
  transition: color var(--transition)
}

.footer-legal a:hover {
  color: #0f0f0f
}

/* ========== FLOATING BUTTONS ========== */
#wa-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  transition: transform var(--transition), box-shadow var(--transition)
}

#wa-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .32)
}

#wa-btn svg {
  width: 26px;
  height: 26px
}

#scroll-top {
  position: fixed;
  bottom: 96px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition)
}

#scroll-top.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0)
}

#scroll-top:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  transform: translateY(-2px)
}

#scroll-top svg {
  width: 20px;
  height: 20px;
  color: #1a1a1a
}

/* ========== VIDEO MODAL ========== */
#modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition)
}

#modal.open {
  opacity: 1;
  pointer-events: all
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(6px)
}

.modal-box {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  transform: scale(.95);
  transition: transform var(--transition)
}

#modal.open .modal-box {
  transform: scale(1)
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  transition: background var(--transition)
}

.modal-close:hover {
  background: rgba(255, 255, 255, .3)
}

.modal-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #1a1a1a;
  color: #888;
  font-size: 14px
}

.modal-placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--accent)
}

/* ========== CERTIFICACIONES ========== */
.cert-section {
  padding-bottom: 60px;
}

.cert-category-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 1.8rem;
  color: #0f0f0f;
  margin-bottom: 8px;
}

.cert-category-desc {
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.6);
  margin-bottom: 32px;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.cert-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cert-img-wrap {
  background: #f9f9f9;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.cert-img-wrap img {
  width: 100%;
  height: 200px;
  object-fit: contain;
}

.cert-info {
  padding: 20px;
}

.cert-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--title-color);
  margin-bottom: 6px;
}

.cert-desc {
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.4;
}

/* ========== RESPONSIVE ========== */
@media(max-width:1024px) {
  .doctor-grid {
    grid-template-columns: 1fr
  }

  .doctor-portrait {
    min-height: 420px
  }

  .doctor-portrait>img {
    min-height: 420px
  }

  .doctor-portrait-overlay {
    background: linear-gradient(to bottom, transparent 40%, #ffffff)
  }

  .doctor-content {
    padding: 48px 32px;
    min-width: 0;
    max-width: 100%;
  }

  .faq-grid {
    grid-template-columns: 1fr;
    gap: 40px
  }

  .faq-aside {
    position: static
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .patients-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px
  }

  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:768px) {
  .section {
    padding: 64px 0
  }

  .nav-cta {
    display: none
  }

  .nav-hamburger {
    display: flex
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(12, 75, 115, .97);
    padding: 24px;
    gap: 20px;
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, .08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
  }

  #nav.menu-open {
    background: rgba(12, 75, 115, .97);
    backdrop-filter: blur(12px);
  }

  #nav.menu-open .nav-links {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  #nav.menu-open .nav-logo {
    color: #ffffff;
  }

  #nav.menu-open .nav-hamburger span {
    background: #ffffff;
  }

  #hero {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column
  }

  .hero-content {
    flex: 1;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end
  }

  .hero-title {
    padding-top: 20px;
  }

  .hero-stats {
    position: static;
    /* saca del absolute para que no se encime */
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid rgba(255, 255, 255, .12)
  }

  .hero-stat {
    padding: 16px 12px;
    border-right: 1px solid rgba(255, 255, 255, .1)
  }

  .hero-stat:last-child {
    border-right: none
  }

  .hero-stat-num {
    font-size: 1.4rem
  }

  .hero-stat-lbl {
    line-height: 1.1;
  }

  /* Hero centering on mobile */
  .hero-title,
  .hero-sub {
    text-align: center;
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
  }

  /* Buttons on row 1, cert thumbs on row 2 */
  .hero-actions .btn {
    padding: 12px 18px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .hero-cert-link {
    flex-basis: 100%;
    justify-content: center;
  }

  .patients-grid {
    grid-template-columns: 1fr
  }

  .procs-grid {
    grid-template-columns: 1fr
  }

  .proc-card:first-child {
    grid-column: span 1;
    aspect-ratio: 4/3;
  }

  .insights-grid {
    grid-template-columns: 1fr
  }

  .cert-grid {
    grid-template-columns: 1fr
  }

  .form-grid {
    grid-template-columns: 1fr
  }

  .form-field.full {
    grid-column: span 1
  }

  .patients-header,
  .insights-header {
    flex-direction: column;
    align-items: flex-start
  }
}

@media(max-width:480px) {
  .footer-grid {
    grid-template-columns: 1fr
  }

  .team-grid {
    grid-template-columns: 1fr
  }

  .doctor-stats {
    flex-direction: column;
    gap: 12px
  }
}

/* ========== PROCEDURE DETAIL PAGES ========== */
body.page-proc #nav {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.page-proc #nav .nav-logo {
  color: #0f0f0f;
}

body.page-proc #nav .nav-links a {
  color: rgba(0, 0, 0, 0.55);
}

body.page-proc #nav .nav-links a:hover {
  color: #0f0f0f;
}

body.page-proc #nav .nav-hamburger span {
  background: #0f0f0f;
}

.proc-detail-hero {
  padding: 180px 0 80px;
  background: var(--dark-2);
  text-align: center;
}

.proc-detail-title {
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 600;
  color: var(--title-color);
  line-height: 1.1;
  margin-bottom: 24px;
}

.proc-detail-title em {
  font-style: italic;
  font-weight: 300;
}

.proc-detail-subtitle {
  max-width: 900px;
  margin: 0 auto;
  color: #555;
  font-size: 1.1rem;
  line-height: 1.6;
}

.proc-detail-content {
  padding: 80px 0 48px;
  background: #ffffff;
}

.proc-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: stretch;
  margin-bottom: 80px;
}

.proc-detail-text h2,
.proc-section-title {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--title-color);
  margin-bottom: 24px;
}

.proc-detail-text p {
  margin-bottom: 18px;
  color: #444;
  font-size: 1.05rem;
}

.proc-detail-list {
  list-style: none;
  margin-top: 32px;
}

.proc-detail-list li {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 1.05rem;
  color: #444;
}

.proc-detail-list li svg {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 4px;
}

.proc-detail-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.proc-detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Quick Facts */
.quick-facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.quick-fact-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  transition: box-shadow var(--transition);
}

.quick-fact-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.quick-fact-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.quick-fact-val {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 1.1rem;
}

.quick-facts-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Recovery Timeline */
.recovery-process {
  margin-bottom: 80px;
}

.recovery-step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.recovery-num {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: #1a1a1a;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.recovery-text {
  color: #444;
  font-size: 1rem;
  line-height: 1.6;
}

.recovery-text strong {
  color: #1a1a1a;
  font-weight: 600;
}

/* FAQs on Procedure */
.proc-faqs {
  margin-bottom: 80px;
}

.proc-faqs .faq-question {
  background: #fff;
}

/* Other Procedures */
.proc-others {
  padding: 80px 0;
  background: #ffffff;
}

.proc-others .section-title {
  color: var(--title-color);
}

.proc-cta-section {
  text-align: center;
  padding: 80px 0;
  background: var(--dark-2);
}

.proc-cta-section h2 {
  color: var(--title-color);
}

.proc-cta-section p {
  color: #555;
}

/* 2-column layout for Recovery and FAQ */
.proc-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: flex-start;
}

/* Ensure 'Other Procedures' cards are all equal size (no spanning) */
.proc-others .proc-card:first-child {
  grid-column: span 1;
  aspect-ratio: 4/3;
}

@media(max-width: 992px) {
  .proc-bottom-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media(max-width: 768px) {
  .proc-detail-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .quick-facts-grid {
    grid-template-columns: 1fr;
  }

  .recovery-step {
    flex-direction: column;
    gap: 12px;
  }

  .proc-others .proc-card:first-child {
    grid-column: span 1;
    aspect-ratio: 16/9;
  }

  .doctor-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    padding-bottom: 4px;
    /* Optional: tiny padding so active bottom borders don't get clipped */
  }

  .doctor-tabs::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
  }

  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .doctor-tabs .tab-btn:last-child {
    margin-right: 40px;
  }

  .tabs-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 90%);
    pointer-events: none;
  }

  .modal-box {
    aspect-ratio: 9 / 16;
    max-width: 360px;
    max-height: 85vh;
  }

  .lang-switch {
    margin-right: 8px;
    padding: 3px;
  }

  .lang-btn {
    padding: 4px 8px;
    font-size: 10px;
  }
}

/* ========== LANGUAGE SWITCHER ========== */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
  margin-right: 16px;
}

#nav.scrolled .lang-switch,
body.page-proc #nav .lang-switch {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.lang-btn {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.lang-btn:hover {
  color: #ffffff;
}

#nav.scrolled .lang-btn,
body.page-proc #nav .lang-btn {
  color: rgba(0, 0, 0, 0.5);
}

#nav.scrolled .lang-btn:hover,
body.page-proc #nav .lang-btn:hover {
  color: #0f0f0f;
}

.lang-btn.active {
  background: var(--accent);
  color: var(--label-color) !important;
}

.lang-separator {
  color: rgba(255, 255, 255, 0.25);
  font-size: 11px;
  user-select: none;
}

#nav.scrolled .lang-separator,
body.page-proc #nav .lang-separator {
  color: rgba(0, 0, 0, 0.15);
}

/* ========== INLINE SVG LOGO RULES ========== */
.nav-logo svg {
  height: 38px;
  width: auto;
  display: block;
  transition: transform var(--transition);
}

.nav-logo svg path {
  fill: currentColor;
  transition: fill var(--transition);
}

/* Navbar Scrolled state logo color override */
#nav.scrolled .nav-logo {
  color: var(--accent) !important;
}

body.page-proc #nav .nav-logo {
  color: var(--accent) !important;
}

.footer-brand .nav-logo {
  display: block;
  margin-bottom: 20px;
}

.footer-brand .nav-logo svg {
  height: 48px;
  width: auto;
  display: block;
}

.footer-brand .nav-logo svg path {
  fill: var(--label-color) !important;
}

@media (max-width: 768px) {
  .nav-logo svg {
    height: 32px;
  }
}

/* ========== COOKIES BANNER ========== */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 18px 22px;
  z-index: 10000;
  transform: translateY(150%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s;
}

.cookie-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.cookie-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cookie-text {
  font-size: 13px;
  line-height: 1.5;
  color: #333333;
  font-weight: 400;
}

.cookie-link {
  color: #EE6C23;
  text-decoration: underline;
  font-weight: 500;
}

.cookie-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-sm {
  padding: 8px 16px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
}

@media(max-width: 768px) {
  .cookie-banner {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: calc(100% - 32px);
  }
}

/* ========== FACILITIES SLIDER ========== */
#instalaciones {
  background: var(--dark);
}

.facilities-header {
  text-align: center;
  margin-bottom: 40px;
}

.slider-wrapper {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.slider-container {
  position: relative;
  width: 100%;
  height: 540px;
  background: #0f0f0f;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s;
  z-index: 1;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(15, 15, 15, 0.85) 0%, rgba(15, 15, 15, 0) 100%);
  color: #ffffff;
  padding: 40px 30px 24px;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  z-index: 3;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  color: #ffffff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}

.slider-arrow:hover {
  background: var(--accent);
  transform: translateY(-50%) scale(1.08);
}

.slider-arrow.prev {
  left: 20px;
}

.slider-arrow.next {
  right: 20px;
}

.slider-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

@media(max-width: 768px) {
  .slider-container {
    height: auto;
    aspect-ratio: 9 / 16;
  }

  .slide {
    position: absolute;
    width: 100%;
    height: 100%;
  }

  .slide img,
  .slide picture {
    width: 100%;
    height: 100%;
    display: block;
  }

  .slider-arrow {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .slider-arrow.prev {
    left: 12px;
  }

  .slider-arrow.next {
    right: 12px;
  }

  .slide-caption {
    font-size: 0.95rem;
    padding: 30px 20px 20px;
  }
}

/* ========== CERTIFICATE LIGHTBOX MODAL ========== */
.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.cert-modal.open {
  opacity: 1;
  pointer-events: all;
}

.cert-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(8px);
}

.cert-modal-box {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 800px;
  background: #ffffff;
  border-radius: var(--radius);
  overflow: hidden;
  transform: scale(.95);
  transition: transform var(--transition);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .3);
}

.cert-modal.open .cert-modal-box {
  transform: scale(1);
}

.cert-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--transition);
}

.cert-modal-close:hover {
  background: rgba(0, 0, 0, .8);
}

.cert-modal-content {
  display: flex;
  flex-direction: column;
}

.cert-modal-content img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #f9f9f9;
  display: block;
}

.cert-modal-info {
  padding: 24px;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.cert-modal-info h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--title-color);
  margin-bottom: 8px;
}

.cert-modal-info p {
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.5;
}

.cert-card {
  cursor: pointer;
}

/* ========== JOINT REPLACEMENT & OTHER GALLERIES ========== */
.proc-gallery-grid {
  margin-top: 40px;
  margin-bottom: 0px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.proc-gallery-grid.two-cols {
  grid-template-columns: repeat(2, 1fr);
}

.proc-gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
  transition: transform var(--transition), box-shadow var(--transition);
}

.proc-gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.proc-gallery-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform var(--transition);
}

.proc-gallery-grid.two-cols .proc-gallery-item img {
  height: 380px;
}

.proc-gallery-item:hover img {
  transform: scale(1.03);
}

/* Remove extra margin bottom inside the grids to fix empty space above gallery */
.proc-bottom-grid .recovery-process,
.proc-bottom-grid .proc-faqs {
  margin-bottom: 0;
}

@media (max-width: 992px) {

  .proc-gallery-grid,
  .proc-gallery-grid.two-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .proc-gallery-grid,
  .proc-gallery-grid.two-cols {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .proc-gallery-item img,
  .proc-gallery-grid.two-cols .proc-gallery-item img {
    height: 240px;
  }
}