/* =============================================
   COSMEDICA SPA — Design System
   ============================================= */

:root {
    --navy: #00273a;
    --brand-dark: #00273a;
    --blue: #8bbfe6; /* Adjusted to match the light blue of the logo */
    --bg: #F8F9FA;
    --white: #FFFFFF;
    --muted: #888888;
    --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --max-w: 1300px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--navy);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    line-height: 1.15;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ── Layout ── */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 4rem;
}

/* =============================================
   HEADER
   ============================================= */
.main-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1.2rem 0;
    background: rgba(0, 39, 58, 0.3); /* Transparencia Glassmorphism (navy) */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Borde sutil inferior */
    transition: background 0.6s ease,
                padding    0.6s ease,
                box-shadow 0.6s ease;
}

.main-header.header-scrolled {
    padding: 0.6rem 0;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
    background: rgba(0, 39, 58, 0.5); /* Ligeramente más opaco al bajar */
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-left, .nav-right {
    flex: 1; /* Pushes the logo to the center */
}

.nav-right {
    display: flex;
    justify-content: flex-end;
}

/* ── Logo: contenedor con altura fija ── */
.logo {
    display: block;
    position: relative;
    width: 320px; /* Mas grande en desktop */
    height: 160px;
    flex-shrink: 0;
    transition: height 0.6s ease, width 0.6s ease, transform 0.6s ease;
}

.main-header.header-scrolled .logo {
    height: 100px; 
    width: 200px;
}

/* Ambos logos superpuestos */
.logo img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.5s ease;
}

/* Mantenemos solo el logotipo oscuro (versión negativa/blanca) siempre visible */
.logo-obscuro { opacity: 1; }
.logo-claro   { display: none; }

/* ── Nav links ── */
.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    padding-bottom: 4px;
    transition: color 0.5s ease;
}

.main-header.header-scrolled .nav-links a {
    color: rgba(255, 255, 255, 0.9);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 1px;
    background: var(--blue);
    transition: var(--transition);
}

.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: var(--blue) !important; }


/* =============================================
   HERO
   ============================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--navy);
    padding-top: 150px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 6rem;
    align-items: center;
}

.reverse-grid { direction: rtl; }
.reverse-grid > * { direction: ltr; }

.hero-tag {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--blue);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    color: var(--white);
    margin-bottom: 1.8rem;
}

.hero-title em {
    font-style: italic;
    font-weight: 400;
    color: var(--blue);
}

.hero-description {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.75);
    max-width: 440px;
    margin-bottom: 3rem;
    line-height: 1.8;
}

.hero-description strong { color: var(--white); font-weight: 600; }

.btn-book {
    display: inline-block;
    background: var(--blue);
    color: var(--navy);
    padding: 1rem 2.8rem;
    font-size: 0.75rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 700;
    border: 2px solid var(--blue);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-book:hover {
    background: var(--blue);
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(74,144,226,0.25);
}

.hero-image-wrapper {
    position: relative;
    height: 78vh;
    border-radius: 2px;
    overflow: hidden;
    background-color: var(--blue); /* Base azul claro del isotipo para el monocromo */
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: luminosity; /* Convierte a escala de grises y lo tiñe del background */
    opacity: 0.85; /* Ajuste para perfeccionar el azul claro */
}

/* =============================================
   NAV DROPDOWN
   ============================================= */
.has-dropdown {
    position: relative;
}

.nav-arrow {
    font-size: 0.6rem;
    margin-left: 3px;
    opacity: 0.7;
    transition: transform 0.3s ease;
    display: inline-block;
}

.has-dropdown:hover .nav-arrow {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 39, 58, 0.85); /* Glassmorphism background más opaco */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.14);
    min-width: 220px;
    padding: 0.5rem 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 100;
    visibility: hidden;
}

/* Puente invisible para mantener el hover aunque el cursor pase por el gap amarillo */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    width: 100%;
    height: 20px;
}

.has-dropdown:hover .nav-dropdown {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown li a {
    display: block;
    padding: 0.65rem 1.4rem;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--white) !important;
    transition: background 0.2s ease, color 0.2s ease !important;
    white-space: nowrap;
}

.nav-dropdown li a:hover {
    background: rgba(255, 255, 255, 0.08); /* Suave iluminación the glass */
    color: var(--blue) !important;
}

/* =============================================
   SERVICES / MENU
   ============================================= */
.services {
    padding: 120px 0 80px;
    background: var(--bg);
}

.section-label {
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--blue);
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.section-title {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--navy);
    margin-bottom: 3rem;
}

/* ── Category Columns Menu (Home) ── */
.diagnostico-banner {
    display: block;
    position: relative;
    width: 100%;
    height: 300px; /* Portada horizontal */
    margin-bottom: 5px;
    overflow: hidden;
    text-decoration: none;
    z-index: 5;
    background: var(--navy);
}

.diagnostico-banner .col-content {
    justify-content: center;
    padding: 0;
}

.diagnostico-banner h3 {
    font-size: 1.8rem !important;
    letter-spacing: 4px !important;
    font-weight: 500;
}

.diagnostico-banner:hover .col-bg {
    transform: scale(1.02);
}

.diagnostico-banner:hover .col-bg::after { opacity: 0; }
.diagnostico-banner:hover .col-bg::before { opacity: 0.1; }

.col-menu-container {
    display: flex;
    flex-direction: row;
    height: 500px; /* Reducimos altura para las columnas de 5 */
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0,39,58,0.1);
    overflow: hidden;
    gap: 5px; /* Separación sutil entre columnas si se desea, o 0 para pegado */
}

.category-col {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
    transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    border-right: 1px solid rgba(255,255,255,0.1);
}

.category-col:last-child {
    border-right: none;
}

.col-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

/* Layer 1: Colorización monotono en azul */
.col-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--navy);
    mix-blend-mode: color;
    opacity: 1;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Layer 2: Multiplicador oscuro para legibilidad del texto */
.col-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--navy);
    mix-blend-mode: multiply;
    opacity: 0.7;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-col:hover {
    flex: 2; /* Expande la columna */
}

.category-col:hover .col-bg {
    transform: scale(1.05); /* Ligero zoom fluido */
}

.category-col:hover .col-bg::after {
    opacity: 0; /* Devuelve los colores originales sin el barrido verde */
}

.category-col:hover .col-bg::before {
    opacity: 0.1; /* Deja la imagen original muy luminosa y limpia */
}

.col-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding: 2rem;
    height: 100%;
    justify-content: flex-end;
}

.col-content h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    opacity: 0.8;
    transition: transform 0.4s ease, opacity 0.4s ease;
    transform: translateY(10px);
}

.category-col:hover .col-content h3 {
    opacity: 1;
    transform: translateY(0);
    margin-bottom: 0.5rem;
}

.cat-tab {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--navy);
    border: 1.5px solid rgba(29,43,63,0.18);
    border-radius: 40px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cat-tab:hover,
.cat-tab.active {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: white;
}

/* ── Category Section ── */
.cat-section {
    margin-bottom: 5rem;
}

.cat-heading {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--navy);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(29,43,63,0.1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.cat-icon {
    font-size: 1.3rem;
}

/* ── Menu Grid ── */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ── Menu Card ── */
.menu-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    border: 1px solid rgba(29,43,63,0.06);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.menu-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,39,58,0.10);
}

.menu-card-body {
    padding: 1.6rem 1.6rem 1rem;
    flex: 1;
}

.menu-card-body h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--navy);
    margin-bottom: 0.6rem;
    line-height: 1.3;
}

.menu-card-body p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.7;
}

.menu-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.6rem;
    border-top: 1px solid rgba(29,43,63,0.07);
    background: rgba(248,249,250,0.6);
}

.badge-dur {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
}

.badge-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--brand-dark);
    font-weight: 500;
}

/* =============================================
   ABOUT / EXPERIENCIA
   ============================================= */
.about-section {
    padding: 120px 0;
    background: var(--white);
}

.about-section .hero-grid {
    gap: 7rem;
}

.about-section .hero-description {
    opacity: 1;
    transform: none;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: var(--navy);
    color: white;
    padding: 80px 0 0;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4rem;
    padding-bottom: 60px;
}

.footer-logo img {
    height: 110px;
    width: auto;
    margin-bottom: 1.5rem;
    /* show logo as-is on dark bg - it has transparent bg with dark text */
    filter: brightness(0) invert(1);
}

.footer-left p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.7;
    max-width: 260px;
}

.footer-links-col h4,
.footer-contact-col h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 400;
    color: white;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

.footer-links-col ul li {
    margin-bottom: 0.8rem;
}

.footer-links-col a {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.footer-links-col a:hover { color: white; }

.footer-contact-col p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.55);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

.social-icon:hover {
    background: var(--blue);
    border-color: var(--blue);
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.5rem 4rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
}

/* =============================================
   ANIMATIONS (Scroll-triggered)
   ============================================= */
.anim {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.anim.visible {
    opacity: 1;
    transform: translateY(0);
}

.anim-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 1s ease, transform 1s ease;
}

.anim-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.delay-1 { transition-delay: 0.15s !important; }
.delay-2 { transition-delay: 0.3s !important; }
.delay-3 { transition-delay: 0.45s !important; }
.delay-4 { transition-delay: 0.6s !important; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
    .container { padding: 0 2.5rem; }
    .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
    .hero-image-wrapper { height: 55vh; order: -1; }
    .hero-description { max-width: 100%; }
    .services-grid { grid-template-columns: 1fr 1fr; }
    .footer-container { grid-template-columns: 1fr 1fr; row-gap: 3rem; }
    .footer-bottom { padding: 1.5rem 2.5rem; }
}

@media (max-width: 768px) {
    .container { padding: 0 1.5rem; }
    .nav-left, .nav-right { display: none; }
    
    .logo { height: 85px; width: 150px; }
    .main-header.header-scrolled .logo { height: 65px; width: 125px; }

    .hero { padding-top: 90px; }
    .hero-title { font-size: 2.8rem; }
    .services-grid, .menu-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 2.2rem; }

    /* Rediseño móvil de tratamientos */
    .diagnostico-banner { height: 180px; }
    .col-menu-container { flex-direction: column; height: auto; gap: 5px; }
    .category-col { height: 110px; border-right: none; }

    .footer-container { flex-direction: column; gap: 3rem; }
    .footer-bottom { padding: 1.5rem; }
}

/* =============================================
   FORM SWITCHER
   ============================================= */
.treatment-switcher {
  position: relative;
  display: flex;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  padding: 0.25rem;
}

.treatment-switcher input[type="radio"] {
  display: none;
}

.treatment-switcher label {
  flex: 1;
  text-align: center;
  padding: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  z-index: 2;
  transition: color 0.4s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.treatment-switcher input[type="radio"]:checked + label {
  color: var(--white);
}

.switcher-glider {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  height: calc(100% - 0.5rem);
  width: calc(50% - 0.25rem);
  background: var(--navy);
  border-radius: 6px;
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

#st_corporal:checked ~ .switcher-glider {
  transform: translateX(100%);
}

/* =============================================
   FLOATING GLASS BUTTON
   ============================================= */
.btn-floating-glass {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 9999;
    
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.8rem;
    border-radius: 50px;
    
    background: rgba(0, 39, 58, 0.3); /* Navy background con transparencia */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    
    transition: all 0.9s cubic-bezier(0.25, 1, 0.5, 1); /* Transición más lenta y suave */
    animation: floating-bounce 4s ease-in-out infinite;
}

.btn-floating-glass:hover {
    background: rgba(139, 191, 230, 0.2); /* Light blue brand color en hover */
    border-color: rgba(139, 191, 230, 0.6);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 15px 35px rgba(139, 191, 230, 0.3);
    color: #fff;
    animation-play-state: paused;
}

@keyframes floating-bounce {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

.btn-floating-glass.center-mode {
    right: 50%;
    transform: translateX(50%) !important;
    width: 85%;
    max-width: 400px;
    justify-content: center;
    border-radius: 50px;
    bottom: 50px;
    background: rgba(0, 39, 58, 0.45); /* Mantiene translucidez vidrio */
    border-color: rgba(255, 255, 255, 0.25);
    animation: none;
    box-shadow: 0 15px 40px rgba(0, 39, 58, 0.3);
}

.btn-floating-glass.center-mode:hover {
    background: rgba(139, 191, 230, 0.25);
    transform: translateX(50%) scale(1.02) !important;
    color: var(--white) !important;
}

@media (max-width: 768px) {
    .btn-floating-glass {
        bottom: 20px;
        right: 20px;
        padding: 0.8rem 1.4rem;
        font-size: 0.75rem;
    }
    .btn-floating-glass.center-mode {
        width: 90%;
        bottom: 20px;
    }
}
