:root {
    --primary: #01427f;
    --primary-light: rgba(1, 66, 127, 0.1);
    --secondary: #6c757d;
    --light-gray: #f8f9fa;
    --white: #ffffff;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --accent: #0984e3;
    --border-radius-custom: 15px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--primary);
}

.bg-primary-custom {
    background-color: var(--primary);
}

.text-primary-custom {
    color: var(--primary);
}

.btn-primary-custom {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    padding: 12px 30px;
    border-radius: var(--border-radius-custom);
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

.btn-primary-custom:hover {
    background-color: #002e5a;
    border-color: #002e5a;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.main-header {
    z-index: 1050;
    /* Higher than Bootstrap's default sticky-top (1020) */
    background-color: var(--white);
}

/* Custom Header Styles */
.top-bar {
    background-color: var(--primary);
    color: white;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.top-bar a:hover {
    opacity: 0.8;
}

.logo-bar {
    background-color: white;
    padding: 25px 0;
}

.logo-bar .navbar-brand img {
    max-height: 85px;
}

.social-icons-header {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.social-icons-header a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.social-icons-header a:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.social-icons-header a i,
.social-icons-header a svg {
    width: 24px !important;
    height: 24px !important;
    font-size: 20px;
    margin: 0;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.si-facebook {
    background-color: #3b5998;
}

.si-instagram {
    background-color: #e1306c;
}

.si-tiktok {
    background-color: #000;
}

.si-google {
    background-color: #dd4b39;
}

.si-whatsapp {
    background-color: #25d366;
}

.si-linkedin {
    background-color: #0077b5;
}

.navbar-main {
    background-color: #01427f;
    /* Matching primary color */
    padding: 0;
}

.navbar-main .nav-link {
    color: white !important;
    font-weight: 500;
    padding: 15px 20px !important;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
    position: relative;
}

.navbar-main .nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 20px;
    right: 20px;
    height: 2px;
    background-color: white;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.navbar-main .nav-link:hover::after,
.navbar-main .nav-link.active::after {
    transform: scaleX(1);
}

/* Mobile Header Styles */
@media (max-width: 991px) {
    .navbar-main {
        background-color: var(--white) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .navbar-main .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(1, 66, 127, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }

    .navbar-main .nav-link {
        color: var(--primary) !important;
        border-bottom: 1px solid #eee;
    }

    .navbar-main .nav-link::after {
        display: none;
    }

    .navbar-main .navbar-brand img {
        filter: none;
        /* In case any filter was applied */
    }

    .navbar-main .btn-outline-light {
        color: var(--primary) !important;
        border-color: var(--primary) !important;
        margin-top: 10px;
        margin-bottom: 20px;
        width: 100%;
    }

    .navbar-main .btn-outline-light:hover {
        background-color: var(--primary) !important;
        color: var(--white) !important;
    }

    .navbar-main .dropdown-menu {
        background-color: #f8f9fa;
        border: none;
        padding-left: 15px;
    }

    .navbar-main .dropdown-item {
        color: var(--primary) !important;
        font-size: 13px;
    }
}

/* Mega Menu / Floating Navbar */
.navbar-custom {
    background-color: var(--primary) !important;
    padding: 15px 0;
    transition: all 0.3s ease;
}

.navbar-custom .nav-link {
    color: var(--white);
    font-weight: 500;
    padding: 10px 15px;
    transition: color 0.3s ease;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: #ffd700;
    /* Subtle accent for active state */
}

/* For multi-level dropdowns in Bootstrap 5 */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 10px;
}

/* Navbar Dropdown on Hover */
@media (min-width: 992px) {
    .navbar-main .dropdown:hover>.dropdown-menu {
        display: block;
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .navbar-main .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
    }
}

.mega-menu-narrow {
    left: 50% !important;
    transform: translateX(-50%) !important;
    min-width: 900px !important;
    max-width: 1000px !important;
    border-radius: 15px !important;
    border-top: 4px solid var(--primary) !important;
}

@media (max-width: 991px) {
    .mega-menu-narrow {
        left: 0 !important;
        transform: none !important;
        min-width: auto !important;
        max-width: none !important;
    }
}

.dropdown-item {
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Nested Dropdowns Support */
@media (min-width: 992px) {
    .dropdown .dropdown-menu {
        display: none;
    }

    .dropdown:hover>.dropdown-menu {
        display: block;
    }

    .dropdown-submenu {
        position: relative;
    }

    .dropdown-submenu>.dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -10px;
    }

    .dropdown-submenu:hover>.dropdown-menu {
        display: block;
    }
}

/* Sections */
.section-padding {
    padding: 100px 0;
}

.bg-gray {
    background-color: var(--light-gray);
}

/* Cards */
.card-custom {
    border: none;
    border-radius: var(--border-radius-custom);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed) ease;
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 80vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    background-position: center;
    background-size: cover;
    color: var(--white);
}

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


.mega-menu-column a {
    display: block;
    padding: 6px 0;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.mega-menu-column a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.mega-menu-column h6 {
    font-size: 1.1rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

.border-end {
    border-right: 1px solid #eee !important;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(1, 66, 127, 0.75) 0%, rgba(1, 66, 127, 0.35) 100%);
    z-index: 1;
}

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

/* Footer */
.footer-custom {
    background-color: var(--primary);
    color: var(--white);
    padding: 80px 0 20px;
}

.footer-custom a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-social-links a {
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white !important;
    font-size: 20px;
    transition: all 0.3s ease;
}

.footer-social-links a:hover {
    background: var(--white);
    color: var(--primary) !important;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px border rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    margin-top: 50px;
}

/* Animations */
[data-aos] {
    transition-duration: 800ms !important;
}

/* Image Grid for Traumatologia Pages */
.injury-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* Specialty Cards Row */
.specialty-cards-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.specialty-cards-row::-webkit-scrollbar {
    display: none;
}

.specialty-cards-row .col {
    min-width: 180px;
}

/* Specialty Graphic Cards */
.specialty-graphic-card {
    display: block;
    text-decoration: none;
    position: relative;
    aspect-ratio: 9 / 16;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.specialty-graphic-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.specialty-graphic-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(1, 66, 127, 0.92) 0%, rgba(1, 66, 127, 0.3) 45%, transparent 75%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    transition: background 0.4s ease;
}

.specialty-graphic-card h4 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
    transition: transform 0.35s ease;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.25s ease;
    letter-spacing: 0.3px;
}

.card-btn i {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.specialty-graphic-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(1, 66, 127, 0.25);
}

.specialty-graphic-card:hover img {
    transform: scale(1.08);
}

.specialty-graphic-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(1, 66, 127, 0.97) 0%, rgba(1, 66, 127, 0.45) 55%, transparent 80%);
}

.specialty-graphic-card:hover h4 {
    transform: translateY(-4px);
}

.specialty-graphic-card:hover .card-btn {
    opacity: 1;
    transform: translateY(0);
}

.card-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    color: white;
}

.card-btn:hover i {
    transform: translateX(3px);
}

/* Testimonials Section */
.testimonials-section {
    background-color: #f0f7ff;
    position: relative;
}

.testimonial-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    height: 100%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    position: relative;
    border: 1px solid rgba(1, 66, 127, 0.05);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(1, 66, 127, 0.1);
}

.quote-icon {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 50px;
    color: rgba(1, 66, 127, 0.1);
    font-family: serif;
    line-height: 1;
}

.testimonial-content {
    margin-bottom: 25px;
    font-style: italic;
    color: var(--text-muted);
}

.star-rating {
    color: #ffc107;
    margin-bottom: 20px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
}

.author-info h6 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary);
}

.author-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}