/* RESET BÁSICO Y NAVEGACIÓN */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0f172a;
    color: #ffffff;
    line-height: 1.5;
    width: 100%;
    overflow-x: hidden;
}

header {
    background-color: #0f172a;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 40px;
}

.colegiado-header {
    color: #94a3b8;
    font-size: 0.85rem;
}

nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
}

.btn-cita {
    background-color: #22c55e;
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
}

/* SECCIÓN HERO (PORTADA) */
.hero {
    padding: 3rem 1rem;
    text-align: center;
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.85)), url('portal.png');
    background-size: cover;
    background-position: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.hero h2 {
    font-size: 2.2rem;
    color: #ffffff;
}

.hero p, .hero a {
    color: #ffffff !important;
}

.hero .zona {
    color: #cbd5e1 !important;
    font-size: 1.05rem;
}

.hero .servicio-domicilio {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
}

.btn-hero {
    background-color: #22c55e;
    color: #ffffff !important;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 10px;
}

/* SECCIÓN SOBRE MÍ */
.sobre-mi {
    background-color: #1e293b !important;
    padding: 3rem 1rem !important;
    text-align: center !important;
    width: 100% !important;
}

.sobre-mi h2 {
    color: #38bdf8 !important;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.sobre-mi p {
    color: #ffffff !important;
    max-width: 800px;
    margin: 0.5rem auto;
}

/* SECCIÓN SERVICIOS */
.servicios {
    padding: 3rem 1rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.servicios h2 {
    color: #ffffff;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.grid-servicios {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.card {
    background-color: #ffffff !important;
    border-radius: 12px;
    padding: 24px;
    flex: 1 1 280px;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.card h3 {
    color: #0f172a !important;
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.card p {
    color: #334155 !important;
    font-size: 0.95rem;
}

/* FOOTER Y REDES SOCIALES */
footer {
    background-color: #090d16;
    padding: 2.5rem 1rem;
    text-align: center;
    border-top: 1px solid #1e293b;
}

footer p {
    color: #94a3b8;
    margin-bottom: 8px;
}

.legales-footer a {
    color: #38bdf8 !important;
    text-decoration: underline;
    margin: 0 5px;
}

.redes-sociales {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.redes-sociales a {
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

.btn-instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.btn-tiktok {
    background-color: #000000;
    border: 1px solid #25f4ee;
}

.btn-threads {
    background-color: #101010;
    border: 1px solid #444444;
}

/* REGLAS MÓVIL (PANTALLAS PEQUEÑAS) */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }

    .hero h2 {
        font-size: 1.6rem;
    }

    .grid-servicios {
        flex-direction: column;
        align-items: center;
    }

    .card {
        width: 100%;
        max-width: 100%;
    }

    .redes-sociales {
        flex-direction: column;
        align-items: center;
    }
}

/* EFECTOS DE COLOR Y ANIMACIONES */

/* Bordes superiores de colores para cada tarjeta de servicio */
.grid-servicios .card:nth-child(1) { border-top: 4px solid #38bdf8; } /* Azul */
.grid-servicios .card:nth-child(2) { border-top: 4px solid #22c55e; } /* Verde */
.grid-servicios .card:nth-child(3) { border-top: 4px solid #a855f7; } /* Morado */
.grid-servicios .card:nth-child(4) { border-top: 4px solid #f97316; } /* Naranja */
.grid-servicios .card:nth-child(5) { border-top: 4px solid #ec4899; } /* Rosa */

/* Animación al pasar el ratón por encima de los servicios */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* Animaciones para los botones de las redes sociales */
.redes-sociales a {
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.redes-sociales a:hover {
    transform: scale(1.08) translateY(-2px);
    filter: brightness(1.15);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* Animación ligera para el botón de WhatsApp del Hero */
.btn-hero {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-hero:hover {
    transform: scale(1.05);
    background-color: #16a34a !important;
}

/* ARREGLO IMAGEN DE FONDO HERO */
.hero {
    padding: 3rem 1rem !important;
    text-align: center !important;
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(15, 23, 42, 0.95)), url('portal.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* RETOQUES FINALES DE DISEÑO MÓVIL Y TARJETAS */

/* 1. Ajustar el tamaño real de las tarjetas de servicios (quitar espacio blanco sobra) */
.grid-servicios .card, 
.grid-servicios div {
    height: auto !important; /* Que la tarjeta mida solo lo que ocupe su texto */
    min-height: initial !important;
    padding: 24px 18px !important;
    margin: 12px auto !important;
    border-radius: 12px !important;
}

/* 2. Arreglar la tarjeta de 'Sobre mí' */
.sobre-mi {
    position: relative;
    padding: 30px 20px !important;
    margin: 20px 15px !important;
    border-radius: 12px;
}

/* Si hay un botón dentro de sobre-mi, que se centre de forma limpia */
.sobre-mi .btn-cita, 
.sobre-mi a[href*="wa.me"] {
    position: static !important;
    display: inline-block !important;
    margin-top: 15px !important;
}

/* 3. Margen lateral para que las tarjetas respire en el móvil */
@media screen and (max-width: 768px) {
    .grid-servicios {
        width: 100% !important;
        padding: 0 16px !important;
        box-sizing: border-box !important;
    }
    
    .grid-servicios .card, 
    .grid-servicios div {
        width: 100% !important;
    }
}

/* Cambiar fondo del menú superior (header) a negro */
header, 
nav, 
.logo-container {
    background-color: #000000 !important; /* Fondo negro puro */
}

/* Forzar que el texto del colegiado sea blanco visible */
header .colegiado-header, 
header span, 
header div {
    color: #ffffff !important;
}

/* FORZAR CENTRADO ABSOLUTO EN MÓVIL */
@media screen and (max-width: 768px) {
    /* Centrar tarjeta sobre-mi */
    .sobre-mi, #sobre-mi {
        margin: 15px auto !important;
        width: 92% !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    /* Eliminar cualquier altura fija que deje espacio blanco en servicios */
    .grid-servicios .card, 
    .grid-servicios div {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        padding: 20px 15px !important;
        margin: 10px auto !important;
        width: 92% !important;
    }

    /* Evitar que el fondo se estire a lo loco */
    body {
        background-attachment: scroll !important;
        background-size: cover !important;
    }
}

/* CORRECCIÓN RADICAL DE FONDO Y TARJETAS EN MÓVIL */
@media screen and (max-width: 768px) {
    /* Forzar que el cuerpo y la página midan solo lo que ocupan sus elementos */
    html, body {
        height: auto !important;
        min-height: 100% !important;
        background-color: #000000 !important; /* Fondo negro de respaldo para que no se vea blanco */
        background-image: none !important; /* Quitamos la imagen si da guerra en móvil, o la dejamos estática */
    }

    /* Si quieres mantener la imagen de fondo sin que se estire como un chicle */
    .hero {
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center center !important;
        height: auto !important;
        min-height: 70vh !important;
        padding-bottom: 40px !important;
    }

    /* Matar cualquier espacio blanco fantasma en las tarjetas de servicios */
    .grid-servicios {
        background-color: transparent !important;
        height: auto !important;
        min-height: initial !important;
        padding: 10px !important;
    }

    .grid-servicios .card, 
    .grid-servicios div {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        flex: none !important;
        margin-bottom: 15px !important;
    }
}

/* Sección Sobre Mí con Flexbox */
.sobre-mi-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
}

.sobre-mi-texto {
  flex: 1;
  text-align: left;
}

.sobre-mi-texto h2 {
  margin-bottom: 0.8rem;
}

.sobre-mi-texto p {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.sobre-mi-foto {
  flex: 0 0 280px; /* Tamaño de la foto en PC */
}

.sobre-mi-foto img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  display: block;
}

/* Adaptación automática para MÓVIL */
@media (max-width: 768px) {
  .sobre-mi-container {
    flex-direction: column-reverse; /* En móvil pone la foto arriba y el texto abajo */
    text-align: center;
    gap: 20px;
    padding: 2rem 1rem;
  }

  .sobre-mi-texto {
    text-align: center;
  }

  .sobre-mi-foto {
    flex: initial;
    width: 220px; /* Ancho ajustado para la pantalla del móvil */
    margin: 0 auto;
  }
}