/* ==========================================================================
   AMERICAN LEGAL - HOJA DE ESTILOS PRINCIPAL (CONSOLIDADA & OPTIMIZADA)
   ========================================================================== */

:root {
    --light-bg: #EBEEF2;
    --dark-blue: #022340;
    --medium-blue: #234459;
    --dark-gray: #253540;
    --light-gray: #79858C;
    --gold-accent: #3562E1; /* Azul Brillante */
    --gold-hover: #252E7A;  /* Azul Indigo Oscuro */
    --white: #ffffff;
    --danger: #cf222e;
    --success: #198754;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.18);
    --transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    --font-heading: 'Century Schoolbook', 'Times New Roman', Times, serif;
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --------------------------------------------------------------------------
   1. RESET Y ESTILOS BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--light-bg);
    color: var(--dark-blue);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

button {
    font-family: inherit;
}

/* --------------------------------------------------------------------------
   2. HEADER Y NAVEGACIÓN
   -------------------------------------------------------------------------- */
.header {
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition);
}

.header.scrolled {
    padding: 0.6rem 5%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.logo {
    display: flex;
    flex-direction: column;
}

.custom-logo-icon {
    height: 65px;
    width: auto;
    margin-right: 12px;
    vertical-align: middle;
    transition: var(--transition);
}

.header.scrolled .custom-logo-icon {
    height: 50px;
}

.logo-main {
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    font-weight: 700;
    color: var(--dark-blue);
    text-decoration: none;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    font-family: var(--font-heading);
}

.logo-sub {
    font-size: 0.85rem;
    color: #333;
    font-weight: 400;
    letter-spacing: 0.8px;
    margin-top: 3px;
    transition: var(--transition);
}

.header.scrolled .logo-sub {
    font-size: 0.72rem;
    margin-top: 1px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--dark-blue);
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 8px 14px;
    border-radius: 4px;
    position: relative;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gold-accent);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--medium-blue);
}

.nav-links a.active {
    color: var(--dark-blue);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   3. HERO SECTION (HOME)
   -------------------------------------------------------------------------- */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1.5rem;
    padding-top: 100px;
    position: relative;
    overflow: hidden;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.video-background video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    filter: brightness(38%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 950px;
    padding: 20px;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    animation: fadeInUp 0.9s ease-out;
}

.hero h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-heading);
    color: var(--white);
}

.hero p {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    max-width: 750px;
    margin: 0 auto 2.5rem;
    color: #e2e8f0;
    line-height: 1.6;
}

.contact-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold-accent), #d4b18c);
    color: var(--dark-blue);
    padding: 1.1rem 3.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    margin-top: 1.5rem;
    transition: var(--transition);
    box-shadow: 0 5px 20px rgba(197, 164, 126, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
    cursor: pointer;
}

.contact-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(197, 164, 126, 0.6);
    background: linear-gradient(135deg, #d4b18c, var(--gold-accent));
}

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

/* --------------------------------------------------------------------------
   4. SECCIONES Y TÍTULOS GLOBALES
   -------------------------------------------------------------------------- */
.section-title {
    text-align: center;
    font-size: clamp(2rem, 3.5vw, 2.7rem);
    margin-bottom: 3rem;
    color: var(--dark-blue);
    position: relative;
    font-weight: 700;
    font-family: var(--font-heading);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gold-accent);
    border-radius: 4px;
}

.intro-text {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 3.5rem;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--dark-gray);
}

/* --------------------------------------------------------------------------
   5. TARJETAS DE SERVICIOS
   -------------------------------------------------------------------------- */
.services-section {
    padding: 7rem 5% 5rem;
    background: var(--light-bg);
    position: relative;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.service-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gold-accent);
}

.service-header {
    position: relative;
    overflow: hidden;
    height: 190px;
    background: var(--dark-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-header h3 {
    position: relative;
    z-index: 2;
    color: var(--white) !important;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    font-family: var(--font-heading);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    margin: 0;
    padding: 0 15px;
    line-height: 1.3;
}

.hover-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    transition: transform 0.6s ease, opacity 0.4s ease;
    z-index: 1;
}

.service-card:hover .hover-video {
    opacity: 0.8;
    transform: scale(1.08);
}

.service-content {
    padding: 2.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.service-content p {
    color: var(--dark-gray);
    line-height: 1.7;
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.service-link {
    display: inline-block;
    padding: 12px 30px;
    background: var(--light-bg);
    color: var(--dark-blue);
    border: 2px solid var(--dark-blue);
    border-radius: 30px;
    font-weight: 700;
    transition: var(--transition);
    margin-top: auto;
    font-size: 0.95rem;
}

.service-card:hover .service-link {
    background: var(--dark-blue);
    color: var(--gold-accent);
    border-color: var(--dark-blue);
    box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   6. EQUIPO
   -------------------------------------------------------------------------- */
.team-section {
    padding: 7rem 5% 5rem;
    background: var(--light-bg);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
    max-width: 1050px;
    margin: 0 auto;
}

.team-member {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.team-member:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.member-photo {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: rgba(2, 35, 64, 0.1);
}

.member-photo img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.member-photo:hover img {
    filter: brightness(0.75);
    transform: scale(1.04);
}

.member-info {
    position: absolute;
    bottom: -100%;
    left: 0;
    right: 0;
    background: rgba(2, 35, 64, 0.92);
    color: var(--white);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: bottom 0.4s ease;
    backdrop-filter: blur(4px);
}

.member-photo:hover .member-info {
    bottom: 0;
}

.member-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 4px;
}

.member-info p {
    font-size: 0.9rem;
    color: var(--gold-accent);
}

/* --------------------------------------------------------------------------
   7. PÁGINAS DE DETALLE DE SERVICIOS Y ESPECIALISTAS
   -------------------------------------------------------------------------- */
.service-detail {
    padding: 8.5rem 5% 5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--medium-blue);
    color: var(--white);
    text-decoration: none;
    border-radius: 30px;
    margin-bottom: 2.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--dark-blue);
    transform: translateX(-4px);
}

.service-hero {
    height: 45vh;
    min-height: 280px;
    display: flex;
    align-items: center;
    padding: 0 5%;
    position: relative;
    margin-bottom: 3.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--dark-blue) 0%, #0c365c 100%);
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

.service-hero-content {
    max-width: 800px;
    color: var(--white);
    position: relative;
    z-index: 2;
}

.service-hero-content h2 {
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    margin-bottom: 1rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.service-hero-content p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.split-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 3rem;
    align-items: start;
}

.specialist-sidebar {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-top: 4px solid var(--gold-accent);
}

.specialist-sidebar img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    border: 3px solid var(--gold-accent);
    box-shadow: var(--shadow-sm);
}

.specialist-info h3 {
    font-size: 1.3rem;
    color: var(--dark-blue);
    font-family: var(--font-heading);
    margin-bottom: 5px;
}

.civil-content-area, .penal-content-area, .fedatario-content-area, .admin-content-area {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.civil-category {
    margin-bottom: 2rem;
    border-left: 3px solid var(--gold-accent);
    padding-left: 1.5rem;
}

.civil-category h3 {
    font-size: 1.35rem;
    color: var(--dark-blue);
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.civil-list {
    list-style: none;
}

.civil-list li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    color: var(--dark-gray);
    position: relative;
    padding-left: 20px;
}

.civil-list li::before {
    content: '▪';
    color: var(--gold-accent);
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

.civil-list li strong {
    display: block;
    color: var(--dark-blue);
}

.reserva-container {
    text-align: center;
    margin-top: 3rem;
}

.reserva-btn {
    display: inline-block;
    background: var(--dark-blue);
    color: var(--white);
    padding: 1.1rem 3.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 30px;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--dark-blue);
    cursor: pointer;
}

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

/* Cuadrículas para sub-materias */
.services-grid-squares {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.8rem;
    margin: 3rem 0;
}

.service-square {
    background: var(--white);
    padding: 2.2rem 1.2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 170px;
}

.service-square:hover {
    transform: translateY(-6px);
    border-color: var(--gold-accent);
    box-shadow: var(--shadow-md);
}

.sq-icon {
    font-size: 2.4rem;
    color: var(--dark-blue);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.service-square:hover .sq-icon {
    color: var(--gold-accent);
    transform: scale(1.1);
}

.service-square h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
}

.service-desc {
    font-size: 0.88rem;
    color: var(--light-gray);
    line-height: 1.5;
    margin-top: 8px;
}

/* --------------------------------------------------------------------------
   8. FOOTER INSTITUCIONAL
   -------------------------------------------------------------------------- */
.footer {
    background: linear-gradient(to bottom, var(--dark-gray), #142029);
    padding: 4.5rem 5% 2rem;
    color: var(--light-bg);
    position: relative;
    margin-top: auto;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--gold-accent), var(--medium-blue));
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-column h3 {
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
    color: var(--gold-accent);
    font-weight: 600;
    font-family: var(--font-heading);
    letter-spacing: 0.8px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--light-gray);
    border-radius: 2px;
}

.footer-logo-column h3 {
    display: none;
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: #b0bcc5;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.footer-links a i {
    margin-right: 10px;
    color: var(--gold-accent);
    transition: var(--transition);
    font-size: 0.8rem;
}

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

.footer-links a:hover i {
    color: var(--white);
}

.contact-info p {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    font-size: 0.95rem;
    color: #b0bcc5;
}

.contact-info i {
    margin-right: 12px;
    width: 20px;
    color: var(--gold-accent);
    margin-top: 4px;
}

.copyright-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(235, 238, 242, 0.12);
    color: #8f9da7;
    font-size: 0.9rem;
    gap: 1rem;
}

.copyright-socials {
    display: flex;
    gap: 1.2rem;
}

.copyright-socials a {
    color: #8f9da7;
    font-size: 1.2rem;
    transition: var(--transition);
}

.copyright-socials a:hover {
    color: var(--gold-accent);
    transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   9. MODAL DE CONTACTO
   -------------------------------------------------------------------------- */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 15px;
}

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

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: var(--transition);
}

.contact-modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    background: linear-gradient(135deg, var(--dark-blue), var(--medium-blue));
    padding: 1.4rem 1.8rem;
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 1.3rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-gray);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 11px 15px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: #fcfcfc;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-accent);
    box-shadow: 0 0 0 3px rgba(197, 164, 126, 0.2);
    background: var(--white);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--dark-blue);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: var(--gold-accent);
    color: var(--dark-blue);
}

/* --------------------------------------------------------------------------
   10. BOTÓN FLOTANTE (WHATSAPP / MEET)
   -------------------------------------------------------------------------- */
.floating-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sub-options {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.sub-options.show {
    display: flex;
    animation: fadeInSlide 0.35s ease forwards;
}

.main-float-btn {
    width: 60px;
    height: 60px;
    background: var(--dark-blue);
    color: var(--gold-accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border: 2px solid var(--gold-accent);
    transition: transform 0.3s ease;
}

.main-float-btn:hover {
    transform: scale(1.06);
}

.sub-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white) !important;
    font-size: 20px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease;
}

.sub-btn:hover {
    transform: scale(1.1);
}

.btn-phone { background: #25D366 !important; }
.btn-meet { background: #1a73e8 !important; }

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

/* --------------------------------------------------------------------------
   11. MEDIA QUERIES (RESPONSIVE)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
    .copyright-bar {
        flex-direction: row;
    }
}

@media (max-width: 992px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .specialist-sidebar {
        max-width: 450px;
        margin: 0 auto;
        width: 100%;
    }
    
    .hero {
        padding-top: 140px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 0.6rem;
        padding: 0.7rem 1rem;
    }

    .custom-logo-icon {
        height: 50px;
    }

    .logo-main {
        font-size: 1.3rem;
    }

    .logo-sub {
        font-size: 0.72rem;
    }
    
    .nav-links {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links a {
        padding: 6px 10px;
        font-size: 0.82rem;
    }
    
    .hero {
        padding-top: 170px;
    }

    .service-detail {
        padding-top: 12.5rem !important;
        padding-bottom: 3rem;
    }

    .page-container {
        padding-top: 12.5rem !important;
        padding-bottom: 3rem;
    }
    
    .service-hero {
        height: auto;
        padding: 2.5rem 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }

    .civil-content-area, .penal-content-area, .fedatario-content-area, .admin-content-area {
        padding: 1.8rem 1.2rem;
    }
}

@media (max-width: 576px) {
    .services-grid-squares {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
        gap: 1rem;
    }

    .service-square {
        padding: 1.4rem 0.8rem;
        min-height: 135px;
    }

    .sq-icon {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .service-square h4 {
        font-size: 0.88rem;
    }
}

/* Utilidades de página y botones de retroceso */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8.5rem 5% 4rem;
}

.section-subtitle {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
    color: var(--dark-gray);
    font-size: 1.1rem;
    line-height: 1.6;
}

.back-container {
    margin-top: 3rem;
    text-align: center;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: var(--dark-blue);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

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

/* --------------------------------------------------------------------------
   13. SECCIÓN DE ARBITRAJE Y FEDATARIO (LAYOUTS ESPECÍFICOS)
   -------------------------------------------------------------------------- */
.arbitraje-layout {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto 4rem auto;
    padding: 3rem;
    align-items: start;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
    position: relative;
    top: -60px;
    z-index: 10;
}

.profiles-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef2f6;
    border-bottom: 4px solid var(--gold-accent);
}

.profile-img {
    width: 100%;
    height: 330px;
    object-fit: cover;
    object-position: top;
    display: block;
}

.profile-info {
    padding: 1.5rem;
    text-align: center;
}

.profile-info h3 {
    font-size: 1.15rem;
    color: var(--dark-blue);
    margin-bottom: 5px;
    font-weight: 700;
    font-family: var(--font-heading);
}

.profile-role {
    color: var(--gold-accent);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.profile-desc {
    font-size: 0.9rem;
    color: var(--light-gray);
    line-height: 1.5;
}

.materias-summary-card, .services-summary-card {
    position: relative;
    width: 100%;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    background: #000;
}

.card-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 35, 64, 0.55);
    z-index: 1;
    transition: background 0.4s ease;
}

.materias-summary-card:hover .card-overlay,
.services-summary-card:hover .card-overlay {
    background: rgba(2, 35, 64, 0.35);
}

.card-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.8rem;
    padding: 20px;
    text-align: center;
}

.card-content h3 {
    color: var(--white) !important;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.9);
    text-transform: uppercase;
    font-family: var(--font-heading);
}

.btn-ver-materias, .btn-ver-servicios {
    display: inline-block;
    padding: 12px 40px;
    background: var(--gold-accent);
    color: var(--white);
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(197, 164, 126, 0.4);
}

.btn-ver-materias:hover, .btn-ver-servicios:hover {
    background: var(--dark-blue);
    transform: translateY(-3px);
}

.bottom-actions-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eef2f6;
}

.action-card {
    background: var(--white);
    border: 1px solid #eef2f6;
    border-top: 4px solid var(--gold-accent);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    text-align: center;
}

.action-card h4 {
    margin-bottom: 1rem;
    color: var(--dark-blue);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8f9fa;
    color: var(--dark-gray);
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: var(--transition);
    border: 1px solid #d0d7de;
    width: 100%;
    cursor: pointer;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.btn-action:hover {
    background: var(--dark-blue);
    color: var(--white);
    border-color: var(--dark-blue);
}

.norm-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 0;
}

.actions-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 100px;
}

.btn-solicitar {
    background: var(--dark-blue);
    color: var(--white);
    padding: 1.8rem 1rem;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(2, 35, 64, 0.3);
    transition: var(--transition);
    border: 2px solid var(--dark-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
}

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

@media (max-width: 1100px) {
    .arbitraje-layout {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
        top: 0;
    }
    .actions-column {
        position: static;
    }
    .bottom-actions-container {
        grid-template-columns: 1fr;
    }
}

/* Cuadrícula de tarjetas temáticas con video (PAD / PAS) */
.civil-content-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.civil-box {
    background: var(--dark-blue);
    color: var(--light-bg);
    padding: 2.2rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.civil-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.civil-video-container {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: #000;
}

.civil-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.civil-box:hover .civil-video {
    opacity: 0.9;
}

.civil-box h3 {
    color: var(--white);
    font-size: 1.35rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.civil-box p {
    color: #b0bcc5;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.civil-link {
    color: var(--gold-accent);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.civil-link:hover {
    color: var(--white);
    transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   8. ÁREA DE INVESTIGACIÓN, EDITORIAL Y REVISTA DIGITAL
   -------------------------------------------------------------------------- */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(2, 35, 64, 0.5), rgba(2, 35, 64, 0.8)); 
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.research-section {
    padding: 6rem 5%;
    background: var(--light-bg);
    min-height: 80vh;
}

.research-layout {
    display: grid;
    grid-template-columns: 1fr 2.5fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.director-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    position: sticky;
    top: 120px;
    text-align: center;
    border-top: 4px solid var(--gold-accent);
}

.director-photo {
    width: 100%;
    height: 350px;
    overflow: hidden;
    position: relative;
}

.director-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.director-card:hover .director-photo img {
    transform: scale(1.05);
}

.director-info {
    padding: 2rem 1.5rem;
}

.director-tag {
    background: var(--light-bg);
    color: var(--medium-blue);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 1rem;
}

.director-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
}

.director-role {
    color: var(--gold-accent);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.director-bio {
    font-size: 0.95rem;
    color: var(--dark-gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.repositories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-content: start;
}

.repo-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 7px 25px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    height: 100%;
}

.repo-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.repo-header {
    height: 200px;
    background-color: var(--dark-blue);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.repo-card.revista .repo-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../../imagenes/revista-digital.jpeg') center/cover;
    opacity: 0.4;
    transition: 0.5s;
}

.repo-card.libros .repo-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../../imagenes/editorial.jpeg') center/cover;
    opacity: 0.4;
    transition: 0.5s;
}

.repo-card:hover .repo-header::before {
    opacity: 0.7;
    transform: scale(1.1);
}

.repo-header h3 {
    position: relative;
    z-index: 2;
    color: var(--white);
    font-size: 1.8rem;
    text-align: center;
    font-family: var(--font-heading);
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    padding: 0 1rem;
}

.repo-content {
    padding: 2.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.repo-content p {
    color: var(--dark-gray);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.repo-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--light-bg);
    color: var(--dark-blue);
    border: 2px solid var(--dark-blue);
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.repo-card:hover .repo-btn {
    background: var(--dark-blue);
    color: var(--gold-accent);
}

/* Repositorios Hero (Editorial y Revista) */
.repo-hero {
    background: linear-gradient(135deg, var(--dark-blue), var(--medium-blue));
    padding: 7rem 5% 4rem;
    text-align: center;
    color: var(--white);
    margin-bottom: 3rem;
}

.repo-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    margin-bottom: 1rem;
}

.repo-hero p {
    color: #e2e8f0;
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

.repo-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4% 5rem;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 3rem;
    align-items: start;
}

.filters {
    background: var(--white);
    padding: 1.8rem;
    border-radius: 8px;
    height: fit-content;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--gold-accent);
}

.filters h3 {
    font-size: 1.2rem;
    color: var(--dark-blue);
    margin-bottom: 1.2rem;
    font-family: var(--font-heading);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-link {
    color: var(--dark-gray);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
}

.filter-link:hover, .filter-link.active {
    background: var(--light-bg);
    color: var(--dark-blue);
    font-weight: 600;
}

.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Panel Administrativo Común */
.admin-panel {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--gold-accent);
}

.admin-panel h3 {
    color: var(--dark-blue);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.btn-submit {
    padding: 14px 28px;
    background: var(--dark-blue);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 15px;
    font-weight: 700;
    width: 100%;
    transition: var(--transition);
}

.btn-submit:hover {
    background: var(--gold-accent);
    color: var(--dark-blue);
}

/* Tarjetas Editorial */
.editorial-card {
    display: flex;
    background: transparent;
    gap: 2rem;
    align-items: flex-start;
}

.editorial-cover {
    flex: 0 0 220px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
    background: var(--white);
}

.editorial-cover img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 2/3;
}

.cover-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, var(--dark-blue), var(--medium-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-accent);
    font-size: 4rem;
}

.editorial-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editorial-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--dark-blue);
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.editorial-box {
    background: var(--white);
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
    position: relative;
}

.editorial-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--light-gray);
    border-radius: 8px 8px 0 0;
    opacity: 0.3;
}

.meta-row {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-bottom: 1rem;
    border-bottom: 1px dashed #e0e4e8;
    padding-bottom: 10px;
}

.meta-row strong {
    color: var(--dark-blue);
}

.meta-row a {
    color: var(--medium-blue);
    text-decoration: none;
}

.editorial-logo-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.editorial-abstract {
    font-size: 0.95rem;
    color: var(--dark-gray);
    line-height: 1.7;
    text-align: justify;
    margin-bottom: 1.5rem;
}

.meta-footer {
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.editorial-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding-left: 5px;
    flex-wrap: wrap;
}

.action-link {
    color: var(--medium-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.action-link i {
    color: var(--dark-blue);
    font-size: 1.1rem;
}

.action-link:hover {
    color: var(--gold-accent);
    transform: translateX(3px);
}

.action-delete {
    color: #dc3545;
}

.action-delete i {
    color: #dc3545;
}

.action-delete:hover {
    color: #a71d2a;
}

/* Tarjetas Revista */
.article-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
    border-left: 5px solid transparent;
    display: flex;
    flex-direction: column;
    position: relative;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-left-color: var(--gold-accent);
}

.article-meta {
    font-size: 0.85rem;
    color: var(--light-gray);
    margin-bottom: 0.8rem;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.article-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--dark-blue);
    margin-bottom: 1rem;
}

.article-abstract {
    font-size: 0.95rem;
    color: var(--dark-gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.article-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-download {
    padding: 8px 20px;
    background: var(--light-bg);
    color: var(--dark-blue);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #dce4e8;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-download:hover {
    background: var(--dark-blue);
    color: var(--white);
}

.btn-delete {
    padding: 8px 15px;
    background: #dc3545;
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-delete:hover {
    background: #c82333;
}

@media (max-width: 900px) {
    .research-layout {
        grid-template-columns: 1fr;
    }
    .director-card {
        position: relative;
        top: 0;
        max-width: 500px;
        margin: 0 auto;
    }
    .repo-container {
        grid-template-columns: 1fr;
    }
    .filters {
        margin-bottom: 1.5rem;
    }
    .editorial-card {
        flex-direction: column;
        align-items: center;
    }
    .editorial-cover {
        width: 200px;
    }
    .editorial-title {
        text-align: center;
    }
}

@media (max-width: 600px) {
    .repositories-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   14. SECCIÓN MATERIA PENAL & MODAL DE DELITOS
   -------------------------------------------------------------------------- */
.penal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.penal-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.penal-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold-accent);
    box-shadow: var(--shadow-md);
}

.penal-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.penal-card:hover img {
    transform: scale(1.04);
}

.penal-card h3 {
    font-size: 1.25rem;
    color: var(--dark-blue);
    padding: 1.3rem 1.3rem 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
}

.penal-card p {
    font-size: 0.95rem;
    color: var(--dark-gray);
    line-height: 1.6;
    padding: 0 1.3rem 1.5rem;
    flex-grow: 1;
    margin: 0;
}

/* Modal Detalle de Delitos */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 35, 64, 0.82);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

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

.detail-content {
    background: var(--white);
    width: 100%;
    max-width: 950px;
    max-height: 90vh;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.detail-modal.active .detail-content {
    transform: translateY(0);
}

.detail-header {
    background: linear-gradient(135deg, var(--dark-blue), var(--medium-blue));
    padding: 1.3rem 1.8rem;
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--gold-accent);
}

.detail-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin: 0;
    color: var(--white);
}

.detail-header .close-modal {
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.detail-header .close-modal:hover {
    background: rgba(255, 255, 255, 0.18);
    color: var(--gold-accent);
    transform: rotate(90deg);
}

.detail-body {
    padding: 2rem;
    overflow-y: auto;
}

/* Grilla interna del modal */
.sketch-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 2rem;
    align-items: start;
}

.crime-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.crime-item {
    display: flex;
    gap: 1.2rem;
    padding: 1.2rem;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid var(--gold-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
    align-items: flex-start;
}

.crime-item:hover {
    background: #edf2f7;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.crime-thumb {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.crime-info span {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold-accent);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.crime-info h4 {
    font-size: 1.05rem;
    color: var(--dark-blue);
    margin-bottom: 6px;
    font-family: var(--font-heading);
    font-weight: 700;
}

.crime-info p {
    font-size: 0.88rem;
    color: var(--dark-gray);
    line-height: 1.5;
    margin: 0;
}

.specialist-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.8rem 1.5rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
}

.specialist-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.2rem;
    border: 3px solid var(--gold-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.specialist-name {
    font-size: 1.25rem;
    color: var(--dark-blue);
    margin-bottom: 4px;
    font-family: var(--font-heading);
    font-weight: 700;
}

.specialist-role {
    font-size: 0.85rem;
    color: var(--gold-accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
}

.specialist-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    background: #25D366;
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.specialist-btn:hover {
    background: #1eb956;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
    color: var(--white);
}

/* Pseudo-overlay para mejorar legibilidad sobre videos en service-hero */
.service-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(2, 35, 64, 0.85) 0%, rgba(2, 35, 64, 0.5) 100%);
    z-index: 1;
    pointer-events: none;
}

@media (max-width: 850px) {
    .sketch-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .specialist-card {
        position: static;
    }
}

@media (max-width: 576px) {
    .detail-modal {
        padding: 10px;
    }

    .detail-content {
        max-height: 94vh;
        border-radius: 10px;
    }

    .detail-header {
        padding: 1rem 1.2rem;
    }

    .detail-header h2 {
        font-size: 1.1rem;
    }

    .detail-body {
        padding: 1.2rem 1rem;
    }

    .crime-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .crime-thumb {
        width: 100%;
        height: 150px;
    }
}



/* --- BARRA DE CONFIANZA (Logos) --- */
.trust-bar {
    background-color: var(--light-bg); /* Un gris azulado claro corporativo */
    padding: 2.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.trust-title {
    font-size: 1rem;
    color: var(--medium-blue); /* Color institucional */
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.logos-grid {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
    align-items: center;
}

.trust-logo {
    height: 95px; 
    filter: grayscale(100%) opacity(0.5); /* Efecto desaturado sutil */
    transition: var(--transition); /* Transición global suave */
}

.trust-logo:hover {
    filter: grayscale(0%) opacity(1); /* Color vibrante al interactuar */
    transform: translateY(-3px) scale(1.02); /* Suave elevación 3D */
}

/* --- NUEVA SECCIÓN: GRID DE INSTALACIONES / GALERÍA (MASONRY & FLOATING) --- */
.facilities-section {
    background-color: var(--white);
    padding-top: 2rem;
}

.facilities-grid {
    column-count: 3;
    column-gap: 20px;
    padding: 10px 0;
}

.facility-card {
    position: relative;
    display: inline-block; /* Esencial para evitar cortes en masonry */
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    break-inside: avoid; /* Evita que la tarjeta se parta entre columnas */
    
    /* Movimiento pasivo ligero */
    animation: floatGallery 6s ease-in-out infinite;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

/* Efecto asíncrono para dar aleatoriedad al flotar */
.facility-card:nth-child(2n) { animation-delay: -2s; animation-duration: 7s; }
.facility-card:nth-child(3n) { animation-delay: -4s; animation-duration: 8s; }
.facility-card:nth-child(4n) { animation-delay: -1s; animation-duration: 5.5s; }

.facility-card:hover {
    animation-play-state: paused;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    z-index: 10;
}

.facility-card img {
    width: 100%;
    height: auto; /* Respeta el ratio natural (vertical, horizontal, cuadrado) */
    display: block;
    transition: transform 0.5s ease;
}

.facility-card:hover img {
    transform: scale(1.04);
}

.facility-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 25px 15px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(15px);
    transition: 0.3s ease;
    pointer-events: none;
}

.facility-card:hover .facility-caption {
    opacity: 1;
    transform: translateY(0);
}

@keyframes floatGallery {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); } /* Movimiento más ligero y sutil */
    100% { transform: translateY(0px); }
}

@media (max-width: 992px) {
    .facilities-grid { column-count: 2; }
}

@media (max-width: 576px) {
    .facilities-grid { column-count: 1; }
}

/* --- TEAM COLLAGE (HOME) --- */
.team-collage-section {
    padding: 6.5rem 0;
    background-color: #f9fafb;
    overflow: hidden;
}

.collage-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.collage-text {
    flex: 1;
    min-width: 320px;
    max-width: 500px;
}

.collage-visuals {
    flex: 1.2;
    min-width: 320px;
    max-width: 550px;
    position: relative;
    height: 520px;
    margin: 0 auto;
}

.collage-item {
    position: absolute;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.5s;
    animation: floatPassive 6s ease-in-out infinite;
    cursor: pointer;
    background: #fff;
}

.collage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.collage-item:hover {
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    z-index: 10 !important;
    animation-play-state: paused;
}

.collage-item:hover img {
    transform: scale(1.12);
}

.c-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(2,35,64,0.95), transparent);
    color: white;
    padding: 25px 15px 15px;
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(15px);
    transition: 0.4s ease;
    font-family: var(--font-heading);
}

.collage-item:hover .c-info {
    opacity: 1;
    transform: translateY(0);
}

/* Posiciones asimétricas y retrasos de animación para 5 integrantes */
.c-item-1 {
    width: 190px;
    height: 240px;
    top: 20px;
    left: 10px;
    z-index: 2;
    animation-delay: 0s;
}

.c-item-2 {
    width: 230px;
    height: 320px;
    top: 100px;
    left: 150px;
    z-index: 5; /* Centro, más grande */
    animation-delay: -1.5s;
}

.c-item-3 {
    width: 180px;
    height: 220px;
    bottom: 40px;
    left: 30px;
    z-index: 4;
    animation-delay: -3s;
}

.c-item-4 {
    width: 180px;
    height: 230px;
    top: 10px;
    right: 10px;
    z-index: 1;
    animation-delay: -4.5s;
}

.c-item-5 {
    width: 190px;
    height: 250px;
    bottom: 30px;
    right: 20px;
    z-index: 3;
    animation-delay: -2.5s;
}

@keyframes floatPassive {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@media (max-width: 992px) {
    .collage-layout {
        flex-direction: column;
    }
    .collage-text {
        text-align: center;
        margin-bottom: 2rem;
        max-width: 100%;
    }
    .collage-text .section-title {
        text-align: center !important;
    }
    .collage-visuals {
        width: 100%;
        height: 480px;
    }
    /* Reajuste para 5 items en móvil/tablet */
    .c-item-1 { width: 150px; height: 190px; left: 5%; top: 10px;}
    .c-item-2 { width: 190px; height: 260px; left: 30%; top: 100px; }
    .c-item-3 { width: 140px; height: 180px; left: 10%; bottom: 40px; }
    .c-item-4 { width: 140px; height: 180px; right: 5%; top: 20px; }
    .c-item-5 { width: 150px; height: 200px; right: 5%; bottom: 30px; }
}

@media (max-width: 576px) {
    .collage-visuals { height: 400px; }
    .c-item-1 { width: 120px; height: 160px; left: 2%; top: 0;}
    .c-item-2 { width: 150px; height: 210px; left: 28%; top: 80px; }
    .c-item-3 { width: 110px; height: 140px; left: 5%; bottom: 40px; }
    .c-item-4 { width: 110px; height: 140px; right: 2%; top: 10px; }
    .c-item-5 { width: 120px; height: 160px; right: 2%; bottom: 30px; }
}
