/* ========================================
   Variables de Color y Configuración
   ======================================== */
:root {
    /* Colores Corporativos - Basados en Logotipo */
    --primary-blue: #2a3a58;
    --dark-blue: #16202f;
    --light-blue: #3d5070;
    --gold: #c5a572;
    --light-gold: #ddc391;
    --dark-gold: #a8874f;
    --silver: #b8b8b8;
    --platinum: #eceae5;

    /* Escala de Grises */
    --black: #000000;
    --dark-gray: #2a2a2a;
    --medium-gray: #5a6172;
    --light-gray: #f4f5f7;
    --white: #ffffff;

    /* Tipografía */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Roboto', sans-serif;

    /* Espaciado */
    --section-padding: 80px 0;
    --container-padding: 0 24px;

    /* Bordes y Sombras Refinadas */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 8px rgba(22, 32, 47, 0.06);
    --shadow-md: 0 8px 24px rgba(22, 32, 47, 0.08);
    --shadow-lg: 0 16px 48px rgba(22, 32, 47, 0.12);

    /* Transiciones */
    --transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ========================================
   Reset y Estilos Base
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--dark-gray);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

/* ========================================
   Navegación
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to bottom, rgba(22, 32, 47, 0.55), rgba(22, 32, 47, 0));
    padding: 22px 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 14px 0;
    background: rgba(22, 32, 47, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

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

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: var(--transition);
    max-width: 250px;
}

.logo:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.logo-image {
    height: 45px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.navbar.scrolled .logo-image {
    height: 40px;
}

/* Texto justificado: separación silábica para evitar huecos amplios.
   Requiere lang="es" en <html>, ya declarado. */
.about-text,
.team-bio,
.service-description,
.value-card p,
.faq-answer p,
.mv-content p,
.specialty-card p,
.service-modal-desc,
.team-modal-bio p {
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    overflow-wrap: break-word;
}

/* Salto de línea que solo actúa en móvil */
.br-mobile {
    display: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 26px;
    align-items: center;
    margin-left: 40px;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--gold);
}

.nav-link:hover::after {
    width: 100%;
}

.btn-agendar {
    padding: 10px 25px;
    background: linear-gradient(135deg, var(--gold), var(--light-gold));
    color: var(--dark-blue);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(197, 165, 114, 0.3);
}

.btn-agendar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 165, 114, 0.45);
}

/* Menu Toggle para móvil */
.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--gold);
    transition: var(--transition);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    height: 100vh;
    height: 100dvh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Hero Slider */
.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(22, 32, 47, 0.82) 0%,
        rgba(22, 32, 47, 0.7) 45%,
        rgba(22, 32, 47, 0.9) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 60px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
    color: var(--white);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.hero-subtitle {
    font-size: 19px;
    line-height: 1.7;
    margin-bottom: 42px;
    color: var(--platinum);
    font-weight: 300;
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 16px 38px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--light-gold));
    color: var(--dark-blue);
    box-shadow: 0 4px 18px rgba(197, 165, 114, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(197, 165, 114, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--gold);
}

.btn-secondary:hover {
    background: var(--gold);
    color: var(--dark-blue);
    transform: translateY(-3px);
}

/* Hero Indicators */
.hero-indicators {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 12px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid var(--gold);
    cursor: pointer;
    transition: var(--transition);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.indicator.active {
    background: var(--gold);
    transform: scale(1.3);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-indicator span {
    display: block;
    width: 20px;
    height: 30px;
    border: 2px solid var(--gold);
    border-radius: 15px;
    position: relative;
}

.scroll-indicator span::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--gold);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0%, 100% { opacity: 0; top: 5px; }
    50% { opacity: 1; top: 15px; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Section Headers
   ======================================== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-tag {
    display: inline-block;
    color: var(--gold);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 42px;
    line-height: 1.15;
    letter-spacing: -0.5px;
    color: var(--dark-blue);
    margin-bottom: 18px;
    font-weight: 700;
}

.title-underline {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--light-gold));
    margin: 0 auto 20px;
    border-radius: 2px;
}

.section-description {
    font-size: 17px;
    line-height: 1.7;
    color: var(--medium-gray);
    max-width: 640px;
    margin: 0 auto;
}

/* ========================================
   About Section
   ======================================== */
.about-section {
    padding: var(--section-padding);
    background: var(--white);
}

.about-intro {
    max-width: 850px;
    margin: 0 auto 50px;
    text-align: center;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
    align-items: stretch;
    margin-bottom: 50px;
}

.about-subtitle {
    font-family: var(--font-heading);
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.3px;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

.about-text {
    color: var(--medium-gray);
    margin-bottom: 0;
    line-height: 1.85;
    font-size: 17px;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

.about-content {
    display: flex;
}

.mission-vision {
    display: grid;
    gap: 20px;
    width: 100%;
    align-content: stretch;
}

.mv-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 15px;
    row-gap: 6px;
    padding: 24px 26px;
    background: var(--white);
    border: 1px solid rgba(22, 32, 47, 0.07);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--gold);
    box-shadow: var(--shadow-sm);
}

.mv-icon {
    font-size: 28px;
    color: var(--gold);
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
}

.mv-content {
    display: contents;
}

.mv-content h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--primary-blue);
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin-bottom: 0;
}

.mv-content p {
    grid-column: 1 / -1;
    grid-row: 2;
}

.mv-content p {
    color: var(--medium-gray);
    line-height: 1.6;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    font-size: 15px;
}

.values h4 {
    font-family: var(--font-heading);
    font-size: 28px;
    color: var(--primary-blue);
    margin-bottom: 35px;
    text-align: center;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.value-card {
    background: var(--white);
    border: 1px solid rgba(22, 32, 47, 0.07);
    border-radius: var(--radius-md);
    padding: 22px 22px;
    border-left: 3px solid var(--gold);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 8px;
    align-items: center;
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(197, 165, 114, 0.3);
}

.value-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--primary-blue);
    color: var(--gold);
    font-size: 16px;
    grid-column: 1;
    grid-row: 1;
}

.value-card h5 {
    font-family: var(--font-heading);
    font-size: 17px;
    color: var(--primary-blue);
    margin-bottom: 0;
    grid-column: 2;
    grid-row: 1;
}

.value-card p {
    color: var(--medium-gray);
    line-height: 1.55;
    font-size: 14.5px;
    text-align: justify;
    text-justify: inter-word;
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
}

.about-image {
    display: flex;
    align-items: stretch;
    justify-content: center;
}

/* Team Photo Grid */
.team-photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    height: 100%;
}

.team-photo-main,
.team-photo-secondary {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    height: 100%;
}

.team-photo-main:hover,
.team-photo-secondary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.team-photo-main {
    grid-column: 1;
    grid-row: 1;
}

.team-photo-secondary {
    grid-column: 2;
    grid-row: 1;
}

.team-photo-main img,
.team-photo-secondary img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.team-photo-main img {
    object-position: center 30%;
}

.team-photo-secondary img {
    object-position: 78% 30%;
}

.team-photo-main:hover img,
.team-photo-secondary:hover img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(22, 32, 47, 0.75) 0%, transparent 60%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.team-photo-main:hover .photo-overlay,
.team-photo-secondary:hover .photo-overlay {
    opacity: 1;
}

/* Fallback para placeholder si se necesita */
.image-placeholder {
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, var(--light-gray), var(--platinum));
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 2px dashed var(--silver);
}

.image-placeholder i {
    font-size: 64px;
    color: var(--silver);
}

.image-placeholder p {
    color: var(--medium-gray);
    text-align: center;
}

/* Team Section */
.team-section {
    margin-top: 50px;
}

.team-title {
    font-family: var(--font-heading);
    font-size: 32px;
    color: var(--dark-blue);
    text-align: center;
    margin-bottom: 40px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    justify-content: center;
}

/* Centra las tarjetas de la última fila cuando no completan la cuadrícula */
@media (min-width: 1024px) {
    .team-grid {
        grid-template-columns: repeat(3, minmax(280px, 360px));
    }

    /* Una sola tarjeta suelta en la última fila: se centra bajo la columna media */
    .team-grid .team-card:nth-child(3n + 1):last-child {
        grid-column: 2 / 3;
    }

    /* Dos tarjetas sueltas: la cuadrícula pasa a 6 medias columnas para centrarlas */
    .team-grid:has(.team-card:nth-child(3n + 1):nth-last-child(2)) {
        grid-template-columns: repeat(6, minmax(140px, 180px));
    }

    .team-grid:has(.team-card:nth-child(3n + 1):nth-last-child(2)) .team-card {
        grid-column: span 2;
    }

    .team-grid:has(.team-card:nth-child(3n + 1):nth-last-child(2)) .team-card:nth-child(3n + 1):nth-last-child(2) {
        grid-column: 2 / span 2;
    }
}

.team-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(22, 32, 47, 0.06);
    padding: 34px 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-top: 3px solid var(--gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.team-card .team-bio {
    flex-grow: 1;
}

.team-card .team-link {
    margin-top: 18px;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.team-image-placeholder {
    width: 130px;
    height: 130px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    border-radius: 50%;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(197, 165, 114, 0.25);
}

.team-image-placeholder i {
    font-size: 64px;
    color: var(--gold);
}

.team-name {
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--dark-blue);
    margin-bottom: 8px;
}

.team-position {
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

.team-bio {
    color: var(--medium-gray);
    line-height: 1.7;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

.team-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    margin: 0 auto 22px;
    overflow: hidden;
    border: 3px solid rgba(197, 165, 114, 0.35);
    box-shadow: var(--shadow-sm);
}

/* Placeholder con iniciales mientras se recibe la fotografía */
.team-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(197, 165, 114, 0.18), rgba(22, 32, 47, 0.08));
}

.team-photo-placeholder span {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--gold);
}

.team-photo-placeholder i {
    font-size: 46px;
    color: var(--gold);
}

.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}

/* Acercar la figura del primer abogado (Benjamín Ortiz) */
.team-grid .team-card:first-child .team-photo img {
    object-position: 52% 12%;
    transform: scale(2.1);
    transform-origin: 52% 15%;
}

/* Encuadre del segundo abogado (Benjamín Ortiz - Socio) */
.team-grid .team-card:nth-child(2) .team-photo img {
    object-position: 62% 6%;
    transform: scale(1.4);
    transform-origin: 62% 6%;
}

/* Encuadre del abogado junior (foto de cuerpo medio) */
.team-grid .team-card:nth-child(5) .team-photo img {
    object-position: 52% 18%;
    transform: scale(1.7);
    transform-origin: 52% 18%;
}

.team-link {
    margin-top: 18px;
    background: none;
    border: none;
    color: var(--gold);
    font-weight: 600;
    font-size: 14px;
    font-family: var(--font-body);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.team-link:hover {
    gap: 12px;
    color: var(--dark-gold);
}

/* ========================================
   Services Section
   ======================================== */
.services-section {
    padding: var(--section-padding);
    background: var(--light-gray);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--white);
    padding: 32px 26px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(22, 32, 47, 0.06);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.service-card:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--light-gold));
    transform: scaleX(0);
    transition: var(--transition);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(197, 165, 114, 0.3);
}

.service-icon {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: linear-gradient(135deg, var(--gold), var(--light-gold));
}

.service-icon i {
    font-size: 28px;
    color: var(--white);
}

.service-card:hover .service-icon i {
    color: var(--dark-blue);
}

.service-title {
    font-family: var(--font-heading);
    font-size: 21px;
    line-height: 1.25;
    color: var(--dark-blue);
    margin-bottom: 14px;
}

.service-description {
    color: var(--medium-gray);
    line-height: 1.7;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    font-size: 15px;
    margin-bottom: 18px;
}

.service-link {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    margin-top: auto;
    align-self: flex-start;
}

.service-link:hover {
    gap: 12px;
    color: var(--light-gold);
}

/* ========================================
   Specialties Section
   ======================================== */
.specialties-section {
    padding: var(--section-padding);
    background: var(--white);
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.specialty-card {
    background: linear-gradient(135deg, var(--dark-blue), var(--primary-blue));
    padding: 38px 32px;
    border-radius: var(--radius-lg);
    color: var(--white);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
}

.specialty-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(197, 165, 114, 0.12) 0%, transparent 70%);
    transition: var(--transition);
}

.specialty-card:hover::before {
    top: -25%;
    right: -25%;
}

.specialty-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.specialty-number {
    font-family: var(--font-heading);
    font-size: 64px;
    font-weight: 700;
    color: var(--gold);
    opacity: 0.3;
    margin-bottom: 10px;
}

.specialty-card h3 {
    font-family: var(--font-heading);
    font-size: 24px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.specialty-card p {
    line-height: 1.8;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    position: relative;
    z-index: 1;
    color: var(--platinum);
}

/* ========================================
   Clientes Section
   ======================================== */
.clients-section {
    padding: var(--section-padding);
    background: var(--light-gray);
}

.clients-intro {
    max-width: 640px;
    margin: 18px auto 0;
    text-align: center;
    text-wrap: balance;
    color: var(--medium-gray);
    font-size: 16px;
    line-height: 1.7;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 28px;
    max-width: 1000px;
    margin: 0 auto;
}

.client-logo {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(22, 32, 47, 0.06);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.client-logo:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: rgba(197, 165, 114, 0.4);
}

.client-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Animación al cambiar de página de clientes.
   El desplazamiento indica la dirección: adelante entra por la derecha. */
@keyframes clientIn {
    from {
        opacity: 0;
        transform: translateX(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes clientInBack {
    from {
        opacity: 0;
        transform: translateX(-24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.clients-grid .client-logo.entering {
    animation: clientIn 0.42s cubic-bezier(0.25, 0.8, 0.25, 1) backwards;
}

.clients-grid .client-logo.entering-back {
    animation: clientInBack 0.42s cubic-bezier(0.25, 0.8, 0.25, 1) backwards;
}

/* Respeta la preferencia del sistema de reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    .clients-grid .client-logo.entering,
    .clients-grid .client-logo.entering-back {
        animation: none;
    }
}

/* Paginación de clientes */
.clients-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 34px;
}

.clients-nav {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(197, 165, 114, 0.5);
    background: var(--white);
    color: var(--gold);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.clients-nav:hover:not(:disabled) {
    background: var(--gold);
    color: var(--white);
    border-color: var(--gold);
}

.clients-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.clients-dots {
    display: flex;
    gap: 9px;
    align-items: center;
}

.clients-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: rgba(22, 32, 47, 0.18);
    cursor: pointer;
    transition: var(--transition);
}

.clients-dot:hover {
    background: rgba(197, 165, 114, 0.6);
}

.clients-dot.active {
    background: var(--gold);
    transform: scale(1.3);
}

@media (max-width: 768px) {
    .clients-pagination {
        gap: 14px;
        margin-top: 24px;
    }

    .clients-nav {
        width: 38px;
        height: 38px;
    }
}

/* Centra la tarjeta suelta de la última fila (cuadrícula de 3 columnas) */
@media (min-width: 1024px) {
    .clients-grid {
        grid-template-columns: repeat(3, minmax(230px, 320px));
        justify-content: center;
    }

    /* Una sola tarjeta suelta: se centra bajo la columna media */
    .clients-grid .client-logo:nth-child(3n + 1):last-child {
        grid-column: 2 / 3;
    }

    /* Dos tarjetas sueltas: la cuadrícula pasa a 6 medias columnas para centrarlas */
    .clients-grid:has(.client-logo:nth-child(3n + 1):nth-last-child(2)) {
        grid-template-columns: repeat(6, minmax(115px, 160px));
    }

    .clients-grid:has(.client-logo:nth-child(3n + 1):nth-last-child(2)) .client-logo {
        grid-column: span 2;
    }

    /* La penúltima abre en la 2ª media columna: desplaza la fila media columna */
    .clients-grid:has(.client-logo:nth-child(3n + 1):nth-last-child(2)) .client-logo:nth-child(3n + 1):nth-last-child(2) {
        grid-column: 2 / span 2;
    }
}

@media (max-width: 768px) {
    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .client-logo {
        height: 150px;
        padding: 14px;
    }
}

/* ========================================
   FAQ Section
   ======================================== */
.faq-section {
    padding: var(--section-padding);
    background: var(--light-gray);
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(22, 32, 47, 0.06);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    padding: 25px 30px;
    background: none;
    border: none;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-blue);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--gold);
}

.faq-question i {
    font-size: 14px;
    color: var(--gold);
    transition: var(--transition);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    padding: 0 30px 25px;
    color: var(--medium-gray);
    line-height: 1.8;
}

/* ========================================
   Contact Section
   ======================================== */
.contact-section {
    padding: var(--section-padding);
    background: var(--white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    margin-bottom: 45px;
}

.contact-info h3 {
    font-family: var(--font-heading);
    font-size: 28px;
    color: var(--dark-blue);
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--gold), var(--light-gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon i {
    font-size: 20px;
    color: var(--dark-blue);
}

.contact-details h4 {
    font-size: 18px;
    color: var(--dark-blue);
    margin-bottom: 8px;
    font-weight: 600;
}

.contact-details p {
    color: var(--medium-gray);
    line-height: 1.7;
}

.phone-link {
    color: var(--medium-gray);
    text-decoration: none;
    transition: var(--transition);
}

.phone-link:hover {
    color: var(--gold);
}

.social-links {
    margin-top: 40px;
}

.social-links h4 {
    font-size: 18px;
    color: var(--dark-blue);
    margin-bottom: 15px;
    font-weight: 600;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 45px;
    height: 45px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--gold);
    color: var(--dark-blue);
    transform: translateY(-3px);
}

/* Contact Form */
.contact-form-container {
    background: var(--light-gray);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(22, 32, 47, 0.06);
}

/* Mensaje de éxito tras enviar el formulario */
.form-success {
    text-align: center;
    padding: 24px 8px;
    animation: fadeInUp 0.5s ease;
}

/* El botón de éxito vive sobre fondo claro: btn-secondary usa texto blanco
   (pensado para el hero oscuro), así que aquí se le da color propio. */
.form-success .btn-secondary {
    background: var(--gold);
    color: var(--dark-blue);
    border-color: var(--gold);
    font-weight: 600;
    margin-top: 8px;
}

.form-success .btn-secondary:hover {
    background: var(--dark-gold);
    border-color: var(--dark-gold);
    color: var(--white);
}

.form-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 8px 24px rgba(197, 165, 114, 0.4);
}

.form-success h3 {
    font-family: var(--font-heading);
    color: var(--primary-blue);
    font-size: 26px;
    margin-bottom: 12px;
}

.form-success p {
    color: var(--medium-gray);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 28px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Aviso de error en línea dentro del formulario */
.form-alert {
    background: #fdecec;
    border: 1px solid #f5c2c2;
    color: #a12626;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 15px;
    margin-bottom: 24px;
}

.form-group {
    position: relative;
    margin-bottom: 30px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 16px;
    border: 1.5px solid rgba(22, 32, 47, 0.12);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font-body);
    transition: var(--transition);
}

.form-group select:invalid {
    color: var(--medium-gray);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.form-group label {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--medium-gray);
    pointer-events: none;
    transition: var(--transition);
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -10px;
    left: 10px;
    font-size: 12px;
    background: var(--light-gray);
    padding: 0 5px;
    color: var(--gold);
}


.form-group textarea {
    resize: vertical;
}

.btn-submit {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Map */
.map-container h3 {
    font-family: var(--font-heading);
    font-size: 28px;
    color: var(--dark-blue);
    margin-bottom: 20px;
    text-align: center;
}

.map-wrapper {
    width: 100%;
    height: 450px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.map-wrapper iframe {
    display: block;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--dark-blue);
    color: var(--white);
    padding: 60px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    margin-bottom: 20px;
    max-width: 280px;
}

.footer-logo-image {
    height: 50px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    opacity: 0.95;
}

.footer-description {
    color: var(--platinum);
    line-height: 1.7;
}

.footer-section h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--gold);
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--platinum);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--gold);
    transform: translateX(5px);
}

.footer-contact {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-contact li {
    color: var(--platinum);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-contact i {
    color: var(--gold);
    margin-top: 3px;
}

.footer-phone-link {
    color: var(--platinum);
    text-decoration: none;
    transition: var(--transition);
}

.footer-phone-link:hover {
    color: var(--gold);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    color: var(--platinum);
}

.footer-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.footer-credit {
    color: rgba(236, 234, 229, 0.6);
    font-size: 13px;
    letter-spacing: 0.3px;
    text-align: left;
}

.footer-credit a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.footer-credit a:hover {
    color: var(--light-gold);
}

.footer-legal {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-legal a {
    color: var(--platinum);
    text-decoration: none;
    transition: var(--transition);
}

.footer-legal a:hover {
    color: var(--gold);
}

.footer-legal span {
    color: var(--platinum);
}

/* ========================================
   Animaciones de Scroll
   ======================================== */
.fade-in-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Asegurar que el contenido de texto siempre sea visible */
.about-content,
.about-text,
.about-subtitle,
.section-header,
.section-title,
.section-description,
.mission-vision,
.values,
.contact-info,
.contact-form-container,
.faq-container {
    opacity: 1 !important;
    transform: none !important;
}

/* ========================================
   WhatsApp Float Button
   ======================================== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 32px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

/* ========================================
   Responsive Design
   ======================================== */
/* Entre 993px y 1200px el menú de 8 opciones necesita más compresión */
@media (min-width: 993px) and (max-width: 1200px) {
    .nav-menu {
        gap: 16px;
        margin-left: 20px;
    }

    .nav-link {
        font-size: 13.5px;
    }

    .logo-image {
        height: 38px;
    }

    .logo {
        max-width: 200px;
    }

    /* "Preguntas Frecuentes" -> "FAQ" para que la barra quepa en una línea */
    .nav-link[href="#faq"] {
        font-size: 0;
    }

    .nav-link[href="#faq"]::before {
        content: 'FAQ';
        font-size: 13.5px;
    }
}

@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }

    .navbar {
        background: var(--dark-blue);
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
        z-index: 1001;
    }

    .logo,
    .menu-toggle {
        position: relative;
        z-index: 2;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        margin-left: 0;
        height: 100vh;
        height: 100dvh;
        background: var(--dark-blue);
        flex-direction: column;
        justify-content: center;
        padding: 90px 0 40px;
        transition: left 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
        gap: 24px;
        z-index: 1;
    }

    .nav-menu.active {
        left: 0;
    }

    .logo {
        max-width: 220px;
    }

    .logo-image {
        height: 40px;
    }

    .navbar.scrolled .logo-image {
        height: 35px;
    }

    .hero-title {
        font-size: 42px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .section-title {
        font-size: 36px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-content {
        display: block;
    }

    .team-photo-grid {
        max-width: 600px;
        margin: 0 auto;
    }

    .team-photo-main,
    .team-photo-secondary {
        aspect-ratio: 2 / 3;
        height: auto;
    }

    .team-photo-grid {
        height: auto;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .logo {
        max-width: 180px;
    }

    .logo-image {
        height: 35px;
    }

    .navbar.scrolled .logo-image {
        height: 32px;
    }

    .footer-logo {
        max-width: 220px;
    }

    .about-intro {
        text-align: left;
    }

    .about-subtitle {
        font-size: 24px;
    }

    .footer-logo-image {
        height: 40px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-indicators {
        bottom: 70px;
    }

    .indicator {
        width: 10px;
        height: 10px;
    }

    .section-title {
        font-size: 32px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .team-photo-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 380px;
    }

    .team-photo-main {
        grid-column: 1;
        grid-row: 1;
    }

    .team-photo-secondary {
        grid-column: 1;
        grid-row: 2;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .values h4 {
        font-size: 24px;
        margin-bottom: 22px;
    }

    .values-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .value-card {
        padding: 16px 18px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .specialties-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-contact {
        text-align: left;
        max-width: 280px;
        margin: 0 auto;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    :root {
        --section-padding: 50px 0;
    }

    .logo {
        max-width: 150px;
    }

    .logo-image {
        height: 30px;
    }

    .navbar.scrolled .logo-image {
        height: 28px;
    }

    .footer-logo {
        max-width: 180px;
    }

    .footer-logo-image {
        height: 35px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .hero-indicators {
        bottom: 60px;
        gap: 8px;
    }

    .indicator {
        width: 8px;
        height: 8px;
    }

    .section-title {
        font-size: 28px;
    }

}

/* ========================================
   Modal de Servicios
   ======================================== */
.service-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.service-modal.active {
    opacity: 1;
    visibility: visible;
}

.service-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(22, 32, 47, 0.72);
    backdrop-filter: blur(4px);
}

.service-modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 42px;
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
    border-top: 4px solid var(--gold);
}

.service-modal.active .service-modal-content {
    transform: translateY(0) scale(1);
}

.service-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: none;
    background: var(--light-gray);
    color: var(--primary-blue);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.service-modal-close:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: rotate(90deg);
}

.service-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 22px;
}

.service-modal-title {
    font-family: var(--font-heading);
    font-size: 26px;
    color: var(--primary-blue);
    margin-bottom: 14px;
}

.service-modal-desc {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    color: var(--medium-gray);
    line-height: 1.7;
    margin-bottom: 24px;
}

.service-modal-subtitle {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--primary-blue);
    margin-bottom: 14px;
}

.service-modal-list {
    list-style: none;
    display: grid;
    gap: 10px;
    margin-bottom: 30px;
}

.service-modal-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--medium-gray);
    line-height: 1.5;
}

.service-modal-list li > span {
    flex: 1;
    text-align: justify;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.service-modal-list i {
    color: var(--gold);
    font-size: 14px;
    margin-top: 4px;
    flex-shrink: 0;
}

.service-modal-cta {
    display: inline-block;
    width: 100%;
    text-align: center;
}

@media (max-width: 768px) {
    .service-modal {
        padding: 20px 18px;
    }

    .service-modal-content {
        padding: 30px 22px;
        max-height: 85vh;
        max-height: 85dvh;
    }

    .service-modal-title {
        font-size: 22px;
    }
}

/* ========================================
   Modal de Equipo
   ======================================== */
.team-modal .service-modal-content {
    max-width: 620px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.team-modal-header {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 26px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(22, 32, 47, 0.1);
    flex-shrink: 0;
}

.team-modal .service-modal-cta {
    flex-shrink: 0;
}

.team-modal-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 4px solid rgba(197, 165, 114, 0.4);
    box-shadow: var(--shadow-md);
}

.team-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}

.team-modal-heading .service-modal-title {
    margin-bottom: 4px;
}

.team-modal-position {
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}

.team-modal-bio {
    margin-bottom: 30px;
    overflow-y: scroll;
    flex: 1 1 auto;
    min-height: 0;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) rgba(22, 32, 47, 0.1);
}

.team-modal-bio::-webkit-scrollbar {
    width: 7px;
    -webkit-appearance: none;
}

.team-modal-bio::-webkit-scrollbar-track {
    background: rgba(22, 32, 47, 0.08);
    border-radius: 4px;
}

.team-modal-bio::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.team-modal-bio p {
    color: var(--medium-gray);
    line-height: 1.75;
    font-size: 15px;
    margin-bottom: 14px;
    text-align: justify;
}

.team-modal-bio p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .team-modal-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

/* ========================================
   Optimización de altura en móvil
   El contenido no se elimina: sigue en el HTML (visible para buscadores)
   y accesible con un toque en los modales existentes.
   ======================================== */
@media (max-width: 768px) {
    /* --- 1. Tarjetas compactas: el detalle vive en el modal --- */
    .team-card .team-bio,
    .service-card .service-description {
        display: none;
    }

    .team-card {
        padding: 22px 18px;
    }

    .team-photo {
        width: 96px;
        height: 96px;
        margin-bottom: 14px;
    }

    .team-name {
        font-size: 15px;
        line-height: 1.3;
    }

    .team-position {
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    /* "Ver perfil completo" -> "Ver perfil" para que quepa en una línea */
    .team-link,
    .service-link {
        margin-top: 12px;
        font-size: 12px;
        gap: 6px;
    }

    /* Acorta "Ver perfil completo" -> "Ver perfil" sin perder el texto real */
    .hide-mobile {
        display: none;
    }

    .team-card .team-link i {
        font-size: 11px;
    }

    /* Servicios en formato listado: ícono a la izquierda, título a la derecha */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .service-card {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 14px 16px;
        text-align: left;
    }

    .service-icon {
        margin-bottom: 0;
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }

    .service-card .service-title {
        font-size: 15px;
        margin-bottom: 0;
        flex: 1;
        text-align: left;
    }

    /* La flecha se va al extremo derecho como indicador de "abrir" */
    .service-card .service-link {
        margin-top: 0;
        margin-left: auto;
        font-size: 0;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        align-self: center;
    }

    .service-card .service-link i {
        font-size: 13px;
    }

    /* El equipo se queda en dos columnas */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    /* Anula el centrado de escritorio de la última fila */
    .team-grid .team-card,
    .team-grid .team-card:nth-child(3n + 1):last-child,
    .team-grid .team-card:nth-child(3n + 1):nth-last-child(2) {
        grid-column: auto;
    }

    /* Fotos de los socios: lado a lado en vez de apiladas (eran 1160px) */
    .team-photo-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        max-width: 100% !important;
        height: 260px;
    }

    .team-photo-main,
    .team-photo-secondary {
        grid-column: auto !important;
        grid-row: auto !important;
        height: 100%;
    }

    .team-photo-grid img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* --- 2. Misión/Visión y Especialidades: texto recortado + "Leer más" --- */
    /* El recorte solo se aplica si el JS insertó el botón: sin él, texto completo.
       .mv-item es grid y .mv-content usa display:contents, así que el <p> es un
       grid item: se recorta con -webkit-line-clamp, no con max-height. */
    .mv-content:has(.mv-toggle) p {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mv-item.expanded .mv-content:has(.mv-toggle) p {
        -webkit-line-clamp: unset;
        overflow: visible;
    }



    /* Especialidades: 2 columnas y padding reducido (eran 4 x 349px) */
    .specialties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .specialty-card {
        padding: 20px 16px;
    }

    .specialty-card h3 {
        font-size: 15px;
        line-height: 1.3;
    }

    .specialty-card p {
        font-size: 13px;
    }

    .specialty-card:has(.specialty-toggle) p {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .specialty-card.expanded:has(.specialty-toggle) p {
        -webkit-line-clamp: unset;
        overflow: visible;
    }

    .mv-toggle,
    .specialty-toggle {
        background: none;
        border: none;
        color: var(--gold);
        font-family: var(--font-body);
        font-weight: 600;
        font-size: 12px;
        padding: 6px 0 0;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .mv-toggle i,
    .specialty-toggle i {
        font-size: 10px;
        transition: transform 0.3s ease;
    }

    .expanded .mv-toggle i,
    .expanded .specialty-toggle i {
        transform: rotate(180deg);
    }
}

@media (max-width: 768px) {
    /* Contacto: alineado a la izquierda y más compacto */
    .contact-info h3 {
        font-size: 20px;
        margin-bottom: 18px;
        text-align: left;
    }

    .contact-info,
    .contact-item,
    .contact-details {
        text-align: left;
    }

    .contact-item {
        gap: 14px;
        margin-bottom: 18px;
        align-items: flex-start;
    }

    .contact-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        font-size: 15px;
    }

    .contact-details h4 {
        font-size: 15px;
        margin-bottom: 2px;
    }

    .contact-details p {
        font-size: 14px;
        line-height: 1.5;
    }

    /* "Desarrollado por SIOSTOS" al final del footer */
    .footer-bottom {
        display: flex;
        flex-direction: column;
    }

    .footer-copy {
        display: contents;
    }

    /* Legales primero; copyright y crédito se agrupan al final */
    .footer-legal {
        order: 1;
    }

    .br-mobile {
        display: inline;
    }

    .footer-copy > p:first-child {
        order: 2;
        margin-top: 26px;
        padding-top: 22px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        width: 100%;
        text-align: center;
        font-size: 12px;
        line-height: 1.6;
    }

    .footer-credit {
        order: 3;
        margin-top: 4px;
        width: 100%;
        text-align: center;
        font-size: 12px;
    }

    /* Enlaces legales en una sola línea */
    .footer-legal {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        font-size: 12px;
        margin-top: 10px;
    }

    .footer-legal a {
        white-space: nowrap;
    }

    /* Enlaces Rápidos y Servicios ya están en el menú: se ocultan aquí */
    .footer-section[data-dup-mobile] {
        display: none;
    }

    /* Logo y frase de marca como cierre, debajo de Contacto */
    .footer-content {
        display: flex;
        flex-direction: column;
    }

    .footer-section:has(.footer-logo) {
        padding-bottom: 4px;
    }

    .footer-logo {
        max-width: 260px;
        margin: 0 auto 14px;
        justify-content: center;
    }

    .footer-logo-image {
        height: 68px;
    }

    .footer-description {
        text-align: center;
        max-width: 320px;
        margin: 0 auto;
    }

    /* --- 4. Footer condensado: los grupos de enlaces se pliegan --- */
    .footer-section.collapsible h4 {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .footer-section.collapsible h4::after {
        content: '\f078';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 11px;
        transition: transform 0.3s ease;
    }

    .footer-section.collapsible.open h4::after {
        transform: rotate(180deg);
    }

    .footer-section.collapsible .footer-links {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    .footer-section.collapsible.open .footer-links {
        max-height: 400px;
        padding-top: 10px;
    }
}

/* Los botones "Leer más" solo existen en móvil */
@media (min-width: 769px) {
    .mv-toggle,
    .specialty-toggle {
        display: none;
    }
}
