@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800&display=swap');

:root {
    --color-cian: #31C4CF;
    --color-text: #d2d2d2;
    --color-orange: #CF7132;
    --color-inactive: #555;
    --color-line: #333;
    --color-back: #222;
    --radius: 5px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    color: var(--color-text);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #000;
    font-size: 14px;
}

body.no-scroll {
  overflow: hidden;
}

.tapa {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 2s ease-in-out;
}

.tapa.loaded {
    opacity: 0;
}

.loader {
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

header{
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    padding: 60px 100px 0 100px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;

    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

header.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10%);
}

header.active {
    transform: translateX(-300px);
}

header .logo {
    width: 50px;
    height: auto;
    cursor: pointer;
}

.toggle {
  position: relative;
  width: 60px;
  height: 60px;
  background: url(./img/menu.svg);
  background-repeat: no-repeat;
  background-size: 30px;
  background-position: center;
  cursor: pointer;
}

.toggle.active {
    background: url(./img/close.svg);
    background-repeat: no-repeat;
    background-size: 30px;
    background-position: center;
}

.page {
    position: relative;
    right: 0;
    z-index: 2;
    width: 100%;
    transition: 0.5s;
}

.page.active {
    right: 300px;
}

p {
    line-height: 1.6;
}

.showcase {
    position: relative;
    right: 0;
    width: 100%;
    min-height: 100dvh;
    padding: 0 0 60px 100px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    transition: 0.5s;
    overflow: hidden;
}

.showcase video {
    position: absolute;
    top: 0;
    left: 0;
    width: 105%;
    height: 105%;
    object-fit: cover;
}

.text {
    position: relative;
    z-index: 10;
    pointer-events: none;
}

.text h1 {
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
    transition: opacity 0.7s ease-in-out 0.1s;
    opacity: 0;
}

.text h2 {
    font-weight: 300;
    transition: opacity 0.7s ease-in-out 0.3s;
    opacity: 0;
}

.text p {
    margin: 20px 0 30px 0;
    font-weight: 300;
    max-width: 400px;
    transition: opacity 0.7s ease-in-out 0.5s;
    opacity: 0;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* separación icono-texto */

    text-transform: uppercase;
    font-size: 0.8em;
    font-weight: 500;
    background-color: var(--color-text);

    color: #000;
    padding: 12px 32px;
    border-radius: 999px;
    white-space: nowrap;
    border: none;
    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
    pointer-events: auto;
    transition: opacity 0.7s ease-in-out 0.7s, background-color  0.7s ease;
    opacity: 0;
}

.page .showcase .text .btn-pill { 
    transform: translateX(-3px); /* ajuste óptico */
}

.text.visible h1,
.text.visible h2,
.text.visible p,
.text.visible .btn-pill {
    opacity: 1;
}

/* WHATSAPP FLOTANTE */
.btn-wp {
    position: fixed;
    z-index: 999;
    right: 100px;
    bottom: 40px;

    /* reseteos de tu btn-pill */
    margin-top: 0;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    background-color: var(--color-cian);

    transition:
        opacity 0.7s ease-in-out,
        transform 0.7s ease-in-out,
        background-color 0.7s ease;
}

/* Icono */
.icon {
  width: 16px;
  height: 16px;
}

.btn-wp.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}


/* OVERLAY */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
}

.video-completo {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;

    z-index: 300;

    display: grid;
    place-items: center;

    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.5s ease, opacity 0.5s ease;
}

.video-completo.active {
    opacity: 1;
    visibility: visible;
    background-color: rgb(0, 0, 0, 0.8);
}

.reproductor{
    position: absolute;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    cursor: url("./img/close.png") 18 18, pointer;
}

.video-completo video {
    position: relative;
    max-width: 80%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    cursor: default;
}

.menu {
    position: fixed;
    z-index: 1;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu ul {
    position: relative;
    font-size: 1.2em;
    color: #FFF;
    line-height: 3;
}

.menu ul li {
    list-style: none;
}

.menu ul li a {
    display: inline-block;
    font-weight: 300;
    text-decoration: none;
    transform-origin: left center;
    transition: transform 0.3s ease, color 0.3s ease;
}

/* SECCIONES */
.seccion {
    padding: 60px 100px;
    background-color: #111;
    font-weight: 200;
}

.seccion .wrapper {
    max-width: 1080px;
    margin: 0 auto;
}

.seccion .container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
}

#sociedades img {
    height: 30px;
    width: auto;
    display: block;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

#sociedades .container {
    align-items: center;
    gap: 10px;
}

#sociedades .container > a:last-child img {
  /* estilos de la img AMA solamente */
    height: 38px;
}

#sociedades a {
    display: block;
}

#sociedades a:hover img {
    opacity: 1;
}

.seccion.izquierda .wrapper{
  margin-left: 0;
  margin-right: auto;
}

.seccion.derecha .wrapper{
  margin-left: auto;
  margin-right: 0;
}

.seccion h2 {
    padding-bottom: 20px;
    line-height: 1;
    --optical-y: -0.10em;
    transform: translateY(var(--optical-y));
    font-weight: 300;
    letter-spacing: 0.15em;
    color: var(--color-cian);
    text-transform: uppercase;
}

#faqs h2 {
  text-transform: none;
}

.txt-base {
    margin-bottom: 30px;
}

#sobre-mi img {
    width: 33%;
    height: auto;
}

#sobre-mi .mostrar,
.mostrar.txt-base {
    display: block;
}

#sobre-mi details {
    display: none;
}

.box {
  width: 33%;
  height: auto;
}

.box2 {
  width: 50%;
  height: auto;
}

.box p + p, .box2  p + p {
    margin-top: 20px;
}

#sobre-mi .btn-pill,
#medios .btn-pill {
  opacity: 1;
}

#cirugia-mamas, #resultados, #testimonios, #faqs {
    background-color: var(--color-back);
}

#resultados img {
    width: 100%;
    height: auto;
    border: 1px solid var(--color-line);
    margin-bottom: 20px;
}

#medios .box2,
#resultados .box2 {
  border: 1px solid var(--color-line);
  padding: 30px;
  transition: border-color 0.7s ease;
}

#medios h3 {
    margin: 0;
    text-transform: uppercase;
    padding-bottom: 16px;
    font-weight: 400;
    color: #777;
}

#medios .box2 {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-line{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* separación icono-texto */

    text-transform: uppercase;
    font-size: 0.8em;
    font-weight: 500;

    border: 1px solid;
    border-color: var(--color-line);
    background-color: transparent;
    color: #666;

    padding: 12px 32px;
    border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
    pointer-events: auto;
    transition: border-color 0.7s ease, color  0.2s ease;
}

#testimonios {
    padding-bottom: 36px; /* ajuste óptico por botones nav carousel */
}

#testimonios h2{
    color: var(--color-orange)
}

/* ============================================
           ESTRUCTURA BASE DEL ACORDEÓN
============================================ */

/* Contenedor de cada item del acordeón */
.acordeon .item {
    position: relative;
    border-top: 1px solid var(--color-line);
    /* Código original disperso en múltiples reglas */
    /* MEJOR: Todas las propiedades del item en un solo lugar */
    overflow: hidden;
    transition: background-color 0.6s ease;
}

.acordeon .item:last-of-type {
    border-bottom: 1px solid var(--color-line);
}
.acordeon .item.active:last-of-type {
    padding-bottom: 20px;
}

/* Espaciado cuando está abierto */
.acordeon .item.active {
    margin-bottom: 20px;
}

/* ============================================
    TÍTULOS Y TIPOGRAFÍA
============================================ */

.acordeon h3 {
    margin: 0;
    padding: 16px 0;
    font-weight: 400;
    color: #666;
    cursor: pointer;
    transition: color 0.6s ease, padding-left 0.25s ease;
}

/* Padding left solo cuando está cerrado */
.acordeon .item:not(.active) h3 {
    /* Código original: padding-left: 20px */
    /* MEJOR: Solo se aplica cuando está cerrado, más claro */
    padding-left: 20px;
}

.acordeon h4 {
    font-weight: 300;
    color: #888;
    margin-bottom: 20px;
}
/* ============================================
    CONTENEDOR DE CONTENIDO (CAJAS)
============================================ */

.acordeon .item .container {
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: height 0.4s ease, opacity 0.4s ease;
}

.acordeon .item.active .container {
    height: auto;
    opacity: 1;
    overflow: auto;
}

.container .box:last-child {
    margin-bottom: 0;
}

/* ============================================
    DETAILS (LEER MÁS)
============================================ */

.acordeon .leer-mas {
    margin: 0;
    transition: opacity 0.25s ease, max-height 0.4s ease;
}

/* Estado cerrado del acordeón: ocultar details */
.acordeon .item:not(.active) .leer-mas {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Estado abierto del acordeón: mostrar details */
.acordeon .item.active .leer-mas {
    max-height: auto;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    margin-top: 20px;
}

/* Summary (el disparador del details) */
.leer-mas summary {
    margin: 0;
    padding: 0;
    list-style: none;
    cursor: pointer;
    color: var(--color-cian);
    transition: color 0.3s ease;
}

/* Ocultar marcador nativo del details */
.leer-mas summary::-webkit-details-marker {
    display: none;
}

/* Cuando el details está abierto */
.leer-mas[open] summary {
    margin-bottom: 20px;
}

/* Textos del toggle */
.toggle-text .label::before {
    content: "+ Leer más";
    color: var(--color-cian);
}

.toggle-text[open] .label::before {
    content: "- Leer menos";
    color: var(--color-orange);
}

/* Contenido dentro del details (después del summary) */
.leer-mas > :not(summary) {
    margin-top: 20px;
}

/* Párrafos consecutivos dentro del details */
.acordeon .item details p + p {
    /* Código original: margin-top: 20px */
    /* MEJOR: Mantener espaciado entre párrafos */
    margin-top: 20px;
}

/* ============================================
    LISTAS
============================================ */

.acordeon ul {
    list-style: none;
    padding-left: 0;
}

.acordeon details li {
    margin-bottom: auto;
}

.acordeon li {
    margin-bottom: 14px;
}

.acordeon li::before {
    content: '—';
    margin-right: 10px;
}

/* ============================================
    BOTÓN DE VIDEO (opcional)
============================================ */

.acordeon .item.active .btn-pill {
    height: auto;
    opacity: 1;
    overflow: auto;
}

/* ============================================
   CAROUSEL LIMPIO - GRID + SCROLL-SNAP
============================================ */

.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.carousel, .carousel * { user-select: none; -webkit-user-select: none; }
.carousel img:not(.icon), .carousel .icon { -webkit-user-drag: none; }

/* TRACK - Grid responsivo */
.track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc(33.333% - 16px);
    gap: 24px;
    
    /* Permite scroll horizontal */
    overflow-x: auto;
    overflow-y: hidden;
    
    /* Comportamiento suave */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    
    /* Oculta scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
    
    scroll-snap-type: x proximity;

    /* Fuerza el ancho correcto */
    width: 100%;
}

.track::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* CARDS */
.card {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    scroll-snap-align: start;
    border: 1px solid var(--color-line);
    transition: border-color 0.7s ease;
}

/* Evita drag de imágenes */
.carousel img:not(.icon) {
    -webkit-user-drag: none;
    pointer-events: none;
}

.card img:not(.icon) {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* llena, recorta si hace falta */
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Botón flotante centrado */
.card .js-open-video {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: auto;
    line-height: 1.5;
}

.card .btn-pill {
    opacity: 1;
}

.icon-card {
    width: 16px;
    height: 16px;
}

.icon-card path {
    fill: #000;
}


/* Nav Carousel */
#nav-carousel {
    display: flex;
    justify-content: space-between;
}

#nav-carousel button {
    border: none;
    cursor: pointer;
    background-color: transparent; /* 👈 Cambié "none" por "transparent" */
    appearance: none;
    -webkit-appearance: none;

    /* Centrado del SVG */
    display: flex; /* 👈 Activa flexbox */
    align-items: center; /* 👈 Centra verticalmente */
    justify-content: center; /* 👈 Centra horizontalmente */
    
    /* Opcional: área clickeable más grande */
    padding: 20px 20px 10px 20px;
}

#nav-carousel .icon-carousel {
    width: 24px;
    height: 24px;
    display: block; /* 👈 Evita espacios extra */

    pointer-events: none;
}


.icon-carousel path {
    fill: var(--color-orange);
    transition: fill 200ms ease;
}

.inactive {
    pointer-events: none;
}

.inactive .icon-carousel path {
    fill: var(--color-inactive);
}


/* Bajada del carousel */
#bajada-carousel {
    margin-top: 20px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-orange);
    text-align: center;
    display: none;
}

#bajada-carousel .icon-carousel {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    transform: translateY(3px); /* alineamiento óptico */
}

/* ============================================
   CONTACTO
============================================ */
#contacto {
    background-color: var(--color-cian);
}

#contacto .container{
    display: flex;
    align-items: flex-start;
}

#contacto h2 {
    display: none;
}

#contacto .box2.redes{
    margin-left: auto; /* <- la manda a la derecha */
}

#contacto .box2 li, 
#contacto .box2 a,
#contacto .box2 span {
    color: #000;
    font-weight: 400;
    list-style: none;
}

#contacto .box2.txt a {
  display: inline-block;
  transition: transform 300ms ease;
}

#contacto .box2.redes ul{
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

#contacto .box2.redes li {
    display: block;
    margin-left: 0;
    transition: transform 300ms ease;
}

#contacto .box2.redes a {
    padding: 0 0 10px 20px;
}


/* ============================================
    HOVERS solo en DESK
============================================ */

@media (hover: hover) and (pointer: fine) {
    .btn-pill:hover {
        background-color: var(--color-cian);
        color: #000;
    }
    .btn-wp:hover {
        background-color: var(--color-text);
    }
    .menu ul li a:hover {
        transform: scale(1.3);
        color: var(--color-cian);
    }
    /* efecto de dock macOS */
    .menu ul li:hover + li > a {
        transform: scale(1.1) translateY(6px);
    }
    .menu ul li:has(+ li:hover) > a {
        transform: scale(1.1) translateY(-6px);
    }
    .acordeon .item:not(.active):hover {
        background-color: #444;
    }
    .acordeon .item:not(.active) h3:hover {
        color: #999;
    }
    .card:hover {
        border-color: var(--color-orange);
    }
    .card .btn-pill:hover{
        background-color: var(--color-orange);
        color: var(--color-text);
    }
    .card .btn-pill:hover .icon-card path{
        fill: var(--color-text);
    }
    .nav-left:hover .icon-carousel path {
        fill: var(--color-text);
    }
    .nav-right:hover .icon-carousel path {
        fill: var(--color-text);
    }
    .btn-line:hover {
        border-color: var(--color-cian);
        color: var(--color-cian);
    }
    #medios .box2:hover,
    #resultados .box2:hover {
        border-color: var(--color-cian);
    }
    #contacto .box2.txt a:hover {
        transform: translateX(5px);
    }
    #contacto .box2.redes li:hover{
        transform: translateY(-5px);
    }
}


/* ============================================
    RESPONSIVE
============================================ */

@media(max-width: 880px) {
    .showcase,
    .showcase header,
    .seccion {
        padding: 40px;
    }
    .seccion .container {
        flex-direction: column;
    }
    #sociedades .container,
    #contacto .container {
        flex-direction: row;
    }
    .box, .box2 {
        width: 100%;
        height: auto;
    }
    #sobre-mi img {
        width: 100%;
        height: auto;
    }

    #sobre-mi .mostrar,
    .mostrar.txt-base {
        display: none;
    }

    #sobre-mi details {
        display: block;
        margin-bottom: 30px;
    }

    /* ACORDEON ============================================ */
    .acordeon .item.active .container {
        height: auto;
        overflow: visible;
        gap: 20px;
    }
    .btn-wp{
        right: auto;
        left: 50%;
        bottom: 20px;

        transform: translateX(-50%) translateY(10%);
    }
    .btn-wp.is-visible{
        transform: translateX(-50%) translateY(0);
    }
    /* #top > section:last-of-type {
        padding-bottom: 80px;
    } */

}

@media(max-width: 620px) {
    /* CAROUSEL ============================================ */
    .carousel {
        cursor: grab;
        touch-action: pan-y;
    }
    .carousel:active {
        cursor: grabbing;
    }
    
    .track {
        /* Móvil: 1 card por vez que ocupa todo el ancho */
        scroll-snap-type: x mandatory;
        grid-auto-columns: 100%;
        gap: 0;
        scroll-padding: 0; /* Importante para móvil */
    }
    
    .card {
        /* En móvil, snap al centro de la card */
        width: 100%;
        scroll-snap-align: center;
    }
    
    #nav-carousel {
        display: none;
    }
    
    #bajada-carousel {
        display: block;
    }
}

@media(max-height: 400px) {
    .showcase,
    .showcase header,
    .seccion {
        padding: 40px;
    }
    .text h1 {
        font-size: 1em;
    }
    .text h2 {
        font-size: 0.8em;
    }
    .text p {
        font-size: 0.8em;
    }
    .video-completo video {
        width: 60%;
    }
}