/* Reset y Variables CSS */
:root {
    /* Colores del logo */
    --primary-color: #202060; /* Azul oscuro del texto del logo */
    --primary-dark: #209999; /* Teal oscuro de la gota del logo */
    --secondary-color: #80D1D1; /* Teal claro del borde del frasco */
    --accent-color: #209999; /* Teal oscuro como acento */
    --text-dark: #202060; /* Azul oscuro para texto principal */
    --text-light: #5a5a7a; /* Versión más clara del azul oscuro */
    --bg-light: #f5f9f9; /* Fondo muy claro con tinte teal */
    --bg-white: #ffffff;
    --border-color: #d0e8e8; /* Borde suave con tinte teal */
    --shadow: 0 2px 10px rgba(32, 32, 96, 0.1);
    --shadow-hover: 0 5px 20px rgba(32, 32, 96, 0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
    overflow-y: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header y Navegación */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.navbar {
    padding: 1rem 0;
}

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

.nav-brand {
    display: flex;
    flex-direction: column;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    margin: 0;
    line-height: 1.2;
}

.logo-img {
    max-height: 50px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

.tagline {
    font-size: 0.75rem;
    color: var(--text-light);
    margin: 0;
    font-weight: 400;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

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

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

.nav-link.restricted {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 600;
}

.nav-link.restricted::after {
    display: none;
}

.nav-link.restricted:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(32, 32, 96, 0.2);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: var(--transition);
    border-radius: 2px;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 50%, #a0e0e0 100%);
    background-image: url('images/laboratorio.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-dark);
    text-align: center;
    padding: 90px 0 50px;
    overflow: hidden;
    margin-top: 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 1.5rem 2rem;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    color: var(--primary-color);
    text-shadow: 0 2px 8px rgba(255, 255, 255, 1), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    opacity: 0.95;
    font-weight: 400;
    color: var(--text-dark);
    text-shadow: 0 1px 6px rgba(255, 255, 255, 1), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    line-height: 1.7;
    color: var(--text-dark);
    text-shadow: 0 1px 4px rgba(255, 255, 255, 1), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--bg-white);
    color: var(--primary-color);
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
}

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

.scroll-indicator span {
    display: block;
    width: 30px;
    height: 50px;
    border: 2px solid white;
    border-radius: 25px;
    position: relative;
}

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

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

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

/* Section Styles */
section {
    padding: 5rem 0;
    scroll-margin-top: 80px;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.title-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark), var(--secondary-color));
    margin: 0 auto 1rem;
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about {
    background: var(--bg-light);
    padding: 3rem 0;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.feature-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Services Section */
.services {
    background: var(--bg-white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.service-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Insurance Section */
.insurance-section {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 10px;
}

.subsection-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.subsection-description {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.insurance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.insurance-card {
    background: var(--bg-white);
    padding: 1.25rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: var(--text-dark);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.insurance-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.insurance-logo {
    max-width: 100%;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.insurance-logo-atocha {
    max-height: 110px;
}

.insurance-text {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
    display: block;
}

.insurance-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.insurance-card-multiple {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
}

.insurance-card-multiple .insurance-logo {
    max-height: 70px;
}

.insurance-card-multiple .insurance-logo-wrapper {
    min-height: 70px;
}

.insurance-card-multiple .insurance-logo-wrapper:not(:last-child) {
    margin-bottom: 0.5rem;
}

/* Catalog Section */
.catalog-section {
    margin: 4rem 0 1.5rem 0;
    padding: 3rem;
    background: var(--bg-light);
    border-radius: 10px;
}

.catalog-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.catalog-container {
    background: var(--bg-white);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.catalog-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.catalog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.catalog-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--primary-color);
    color: white;
}

.catalog-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    background: var(--primary-color);
    z-index: 11;
    color: white;
}

.catalog-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.catalog-table tbody tr {
    transition: var(--transition);
}

.catalog-table tbody tr:hover {
    background: var(--bg-light);
}

.catalog-table tbody tr:last-child td {
    border-bottom: none;
}

.catalog-info {
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.catalog-info p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

/* Badge styles for tube types */
.tube-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tube-rojo {
    background: #ffebee;
    color: #c62828;
}

.tube-lila {
    background: #f3e5f5;
    color: #7b1fa2;
}

.tube-azul {
    background: #E0F7FA;
    color: var(--primary-dark);
}

.tube-negro {
    background: #eceff1;
    color: #424242;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    background: var(--bg-white);
    color: var(--primary-color);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border-color);
    color: var(--text-light);
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-number {
    min-width: 36px;
    height: 36px;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-number:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-number.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-color);
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Location Section */
.location {
    background: var(--bg-light);
    padding-top: 2rem;
}

.delegations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.delegation-card {
    background: var(--bg-white);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.delegation-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.delegation-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0 0 1.5rem 0;
    font-weight: 600;
}

.delegation-info-compact {
    margin-bottom: 1.5rem;
}

.delegation-info-compact p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.delegation-info-compact p:last-child {
    margin-bottom: 0;
}

.delegation-address,
.delegation-phone {
    font-size: 0.95rem;
}

.delegation-info-compact strong {
    color: var(--primary-color);
    font-weight: 600;
}

.delegation-info-compact a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.delegation-info-compact a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.map-container-compact {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 250px;
    margin-top: 1rem;
}

.map-container-compact iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

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

.contact-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

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

.contact-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-card h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.contact-card a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

.contact-card a:hover {
    color: var(--primary-color);
}

.contact-note {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.5rem;
}

.contact-form {
    background: var(--bg-light);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

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

.form-note {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 1rem;
}

.form-message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    transition: opacity 0.3s ease;
}

.form-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    cursor: pointer;
    flex-shrink: 0;
}

/* Sección de Información sobre Protección de Datos */
.privacy-info-section {
    background: var(--bg-light);
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: 2rem;
    overflow: hidden;
}

.privacy-toggle {
    width: 100%;
    background: var(--bg-light);
    border: none;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: var(--transition);
    text-align: left;
}

.privacy-toggle:hover {
    background: rgba(0, 0, 0, 0.02);
}

.privacy-toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: 1rem;
    flex-shrink: 0;
}

.privacy-toggle[aria-expanded="true"] .privacy-toggle-icon {
    transform: rotate(180deg);
}

.privacy-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.privacy-content.expanded {
    max-height: 1000px;
    padding: 1rem 1.5rem 1.5rem;
}

.privacy-content p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
    font-size: 0.85rem;
}

.privacy-content p:last-child {
    margin-bottom: 0;
}

.privacy-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

.privacy-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.privacy-content a:hover {
    text-decoration: underline;
}

.checkbox-label span {
    color: var(--text-dark);
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: baseline;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.checkbox-label a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.privacy-link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    transition: var(--transition);
}

.privacy-link-btn:hover {
    color: var(--primary-dark);
}

/* Modal de Protección de Datos */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: var(--bg-white);
    margin: auto;
    border-radius: 10px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 1;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
}

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

.modal-close:hover {
    color: var(--text-dark);
    background: var(--bg-light);
}

.modal-body {
    padding: 1.5rem;
    line-height: 1.7;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.modal-body p {
    margin-bottom: 1rem;
}

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

.modal-body strong {
    color: var(--primary-color);
    font-weight: 600;
}

.modal-body a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.modal-body a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: var(--bg-white);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Legal Section */
.legal-section {
    padding: 6rem 0 4rem;
    background: var(--bg-light);
    min-height: calc(100vh - 80px);
}

.legal-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.legal-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
}

.legal-section-content {
    margin-bottom: 2.5rem;
}

.legal-section-content:last-of-type {
    margin-bottom: 0;
}

.legal-section-content h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    margin-top: 2rem;
    font-weight: 600;
}

.legal-section-content h2:first-child {
    margin-top: 0;
}

.legal-section-content p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-dark);
    text-align: justify;
}

.legal-section-content ul,
.legal-section-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
    line-height: 1.8;
}

.legal-section-content li {
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.legal-section-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.legal-section-content a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.legal-version {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 2rem;
    text-align: right;
}

.legal-back {
    margin-top: 3rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.legal-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: var(--bg-white);
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.legal-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.legal-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.legal-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.legal-table tbody tr:last-child td {
    border-bottom: none;
}

.legal-table tbody tr:hover {
    background: var(--bg-light);
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
    line-height: 1.7;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: var(--transition);
}

.footer-section a:hover {
    opacity: 1;
    color: var(--secondary-color);
    transition: var(--transition);
}

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

.footer-bottom p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background: var(--bg-white);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow);
        padding: 2rem 0;
        gap: 0;
    }

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

    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 1rem;
        width: 100%;
    }

    .nav-link.restricted {
        margin: 1rem auto;
        width: auto;
    }

    .hero {
        min-height: 500px;
        padding: 90px 0 50px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .location-content,
    .contact-content {
        gap: 2rem;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    .privacy-toggle {
        padding: 0.875rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .privacy-content {
        padding: 0 1.25rem;
    }
    
    .privacy-content.expanded {
        padding: 0.875rem 1.25rem 1.25rem;
    }
    
    .privacy-content p {
        font-size: 0.8rem;
    }

    .delegations-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .delegation-card {
        padding: 1.5rem;
    }

    .delegation-title {
        font-size: 1.3rem;
    }

    .map-container-compact {
        height: 200px;
    }

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

    .legal-section {
        padding: 5rem 0 3rem;
    }

    .legal-content {
        padding: 2rem 1.5rem;
    }

    .legal-title {
        font-size: 2rem;
    }

    .legal-section-content h2 {
        font-size: 1.3rem;
    }

    .legal-section-content p {
        text-align: left;
    }

    .legal-table {
        font-size: 0.85rem;
    }

    .legal-table th,
    .legal-table td {
        padding: 0.75rem 0.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

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

    .insurance-section,
    .catalog-section {
        padding: 1.5rem;
        margin: 2rem 0;
    }

    .insurance-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .insurance-card {
        min-height: 110px;
        padding: 1rem;
    }

    .insurance-logo {
        max-height: 80px;
    }

    .insurance-card-multiple .insurance-logo {
        max-height: 60px;
    }

    .catalog-controls {
        flex-direction: column;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }

    .catalog-container {
        padding: 1rem;
    }

    .catalog-table {
        font-size: 0.85rem;
    }

    .catalog-table th,
    .catalog-table td {
        padding: 0.5rem;
    }

    .pagination-controls {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .pagination-buttons {
        justify-content: center;
    }

    .pagination-number {
        min-width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-img {
        max-height: 40px;
    }

    .tagline {
        font-size: 0.65rem;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

/* Animaciones adicionales */
.service-card,
.feature-item,
.info-card,
.contact-card {
    animation: fadeInUp 0.6s ease backwards;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

