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

html {
    overflow-y: scroll; /* Fuerza scrollbar siempre visible */
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.65;
    color: #1a1a1a;
    background-color: #f5f5f5;
}

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

/* Top Bar */
.top-bar {
    background: #002952;
    padding: 8px 0;
    font-size: 0.85rem;
}

.top-bar .container {
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
}

.top-bar a {
    color: #e8e8e8;
    text-decoration: none;
}

.top-bar a:hover {
    text-decoration: underline;
}

/* Header */
header {
    background: #003d7a;
    color: white;
    border-bottom: 4px solid #002952;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    min-height: 60px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 25px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Mobile menu toggle - hidden on desktop */
.mobile-menu-toggle {
    display: none;
}

/* Search Icon in header */
.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    height: 100%;
}

.search-icon:hover {
    opacity: 0.8;
    text-decoration: none;
}

.search-icon svg {
    display: block;
    vertical-align: middle;
}

/* Search Modal */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-modal.active {
    display: flex;
}

.search-modal-content {
    background: white;
    padding: 3rem 2rem;
    max-width: 700px;
    width: 90%;
    position: relative;
    border-radius: 4px;
    animation: slideDown 0.3s ease;
}

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

.close-search {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-search:hover {
    color: #fff;
}

.search-modal-content h2 {
    color: #003d7a;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.search-modal-content form {
    display: flex;
    gap: 0;
    border: 2px solid #003d7a;
    margin-bottom: 1rem;
}

.search-modal-content input {
    flex: 1;
    border: none;
    padding: 16px 20px;
    font-size: 1.1rem;
    outline: none;
    color: #333;
}

.search-modal-content input::placeholder {
    color: #999;
}

.search-modal-content button {
    background: #003d7a;
    color: white;
    border: none;
    padding: 16px 35px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-modal-content button:hover {
    background: #005099;
}

.search-hint {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* Breadcrumb */
.breadcrumb {
    background: #f9f9f9;
    padding: 0.75rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #d3d3d3;
}

.breadcrumb a {
    color: #003d7a;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Hero */
.hero {
    background: white;
    padding: 1.5rem 0 1.5rem;
    border-bottom: 1px solid #ddd;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #003d7a;
}

.hero p {
    font-size: 1.05rem;
    margin-bottom: 2rem;
    color: #4a4a4a;
}

.search-box {
    max-width: 700px;
    background: white;
    border: 2px solid #003d7a;
    display: flex;
    align-items: stretch;
    margin-bottom: 2rem;
}

.search-box form {
    display: flex;
    width: 100%;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 14px 20px;
    font-size: 1rem;
    outline: none;
    color: #333;
}

.search-box input::placeholder {
    color: #999;
}

.search-box button {
    background: #003d7a;
    color: white;
    border: none;
    padding: 14px 35px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.search-box button:hover {
    background: #005099;
}

/* Services Grid */
.services {
    padding: 1rem 0 3rem;
    background: white;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #003d7a;
    font-weight: 600;
}

.section-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1px;
    background: #ddd;
    border: 1px solid #ddd;
}

/* Wrapper clickeable para cards */
.service-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.service-card {
    background: white;
    padding: 1.8rem;
    transition: background 0.2s;
    cursor: pointer;
    border-left: 4px solid transparent;
    height: 100%;
}

.service-card-link:hover .service-card,
.service-card:hover {
    background: #f8f9fa;
    border-left-color: #003d7a;
}

.service-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
    color: #003d7a;
    font-weight: 600;
}

.service-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #003d7a;
    font-weight: 600;
}

.service-card p {
    color: #555;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.service-link {
    color: #003d7a;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-block;
    border-bottom: 1px solid transparent;
}

.service-card-link:hover .service-link,
.service-link:hover {
    border-bottom-color: #003d7a;
}

.service-link:after {
    content: " →";
}

/* Post Content Formatting */
.post-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.post-article {
    flex: 1;
    max-width: 100%;
}

.post-article h1 {
    line-height: 1.4;
    margin-bottom: 30px;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.post-content h2 {
    font-size: 1.6rem;
    color: #003d7a;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.post-content h3 {
    font-size: 1.3rem;
    color: #003d7a;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.post-content h4 {
    font-size: 1.1rem;
    color: #003d7a;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.post-content p {
    margin-bottom: 1.2rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.6rem;
}

.post-content strong {
    font-weight: 600;
    color: #1a1a1a;
}

.post-content a {
    color: #003d7a;
    text-decoration: underline;
}

.post-content a:hover {
    color: #005099;
}

.post-content .info-box {
    background: #e7f3ff;
    border-left: 4px solid #003d7a;
    padding: 1.5rem;
    margin: 2rem 0;
}

.post-content .info-box h3 {
    margin-top: 0;
}

/* Author Box */
.author-box {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-left: 4px solid #003d7a;
    padding: 2rem 1.5rem;
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.author-avatar,
.author-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: block;
}

.author-avatar-placeholder {
    background: #003d7a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
}

.author-name {
    font-size: 1.2rem;
    color: #003d7a;
    margin-bottom: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.author-bio {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 1rem;
    text-align: center;
}

.author-date {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-bottom: 0.5rem;
}

.author-link {
    display: block;
    text-align: center;
    color: #003d7a;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

.author-link:hover {
    text-decoration: underline;
}

/* Responsive - Mobile */
@media (max-width: 992px) {
    .post-layout {
        flex-direction: column;
    }

    .author-box {
        width: 100%;
        position: static;
        order: 2;
        margin-top: 2rem;
    }

    .post-article {
        order: 1;
    }
}

/* Info Box */
.info-box {
    background: #e7f3ff;
    border-left: 4px solid #003d7a;
    padding: 1.5rem;
    margin: 2.5rem 0;
}

.info-box h3 {
    color: #003d7a;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    margin-top: 10px;
}

.info-box p {
    color: #333;
    font-size: 0.95rem;
}

/* Stats Section */
.stats {
    background: #f8f9fa;
    padding: 2.5rem 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat {
    padding: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 600;
    color: #003d7a;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #555;
    font-size: 1rem;
}

/* Footer */
footer {
    background: #f8f9fa;
    color: #333;
    padding: 2.5rem 0 1.5rem;
    border-top: 3px solid #003d7a;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #003d7a;
    font-weight: 600;
}

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

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

.footer-section a {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: #003d7a;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 0.9rem;
}

/* Office Details */
.row-white-management {
    background-color: #fff;
    padding: 40px 0px 35px 0px;
    line-height: 24px;
    color: #1a1a1a;
    font-weight: 400;
    width: 100%;
    overflow: auto;
}

.office-info {
    background: #f8f9fa;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.office-info p {
    margin-bottom: 0.8rem;
}

.col-lg-4,
.col-lg-6,
.col-lg-8,
.col-lg-12 {
    display: inline-block;
    vertical-align: top;
    padding: 10px;
}

.col-lg-12 {
    width: 100%;
}
.col-lg-8 {
    width: 66.66%;
}
.col-lg-6 {
    width: 50%;
}
.col-lg-4 {
    width: 33.33%;
}

/* Clearfix */
.row-white-management:after {
    content: "";
    display: table;
    clear: both;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

table td,
table th {
    padding: 12px;
    border: 1px solid #ddd;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #003d7a;
}

.bggris {
    background: #f7f7f7;
}

.boton-accion {
    display: inline-block;
    background-color: #003d7a;
    color: #fff;
    padding: 11px 20px;
    font-weight: 700;
    text-transform: uppercase;
    border: 0;
    text-decoration: none;
    margin-top: 10px;
}

.boton-accion:hover {
    background-color: #005099;
}

/* Responsive */
@media (max-width: 768px) {
    /* Hide top bar on mobile */
    .top-bar {
        display: none;
    }

    /* Hide desktop menu, show mobile menu */
    .nav-links {
        display: none;
    }

    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #003d7a;
        padding: 1rem;
        gap: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .nav-links.active li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links.active li:last-child {
        border-bottom: none;
    }

    .nav-links.active a {
        display: block;
        padding: 1rem;
    }

    nav {
        position: relative;
    }

    /* Footer - 2 columns on mobile */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Search box button fix */
    .search-box {
        max-width: 100%;
    }

    .search-box form {
        flex-wrap: nowrap;
    }

    .search-box button {
        padding: 14px 16px;
        font-size: 0.85rem;
        min-width: 90px;
    }

    /* Modal search button fix for mobile */
    .search-modal-content {
        padding: 2rem 1rem;
        width: 95%;
    }

    .search-modal-content h2 {
        font-size: 1.4rem;
    }

    .search-modal-content form {
        flex-direction: column;
        border: none;
    }

    .search-modal-content input {
        border: 2px solid #003d7a;
        border-bottom: none;
        padding: 14px 16px;
        font-size: 1rem;
    }

    .search-modal-content button[type="submit"] {
        width: 100%;
        padding: 14px;
        border: 2px solid #003d7a;
        border-top: none;
    }

    /* H1 line-height fix on mobile */
    h1 {
        line-height: 1.4;
    }

    .post-article h1,
    article h1 {
        font-size: 1.6rem;
        line-height: 1.4;
    }

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

    .col-lg-4,
    .col-lg-6,
    .col-lg-8 {
        width: 100%;
    }

    .hero h1 {
        font-size: 1.8rem;
    }
}
