/* ==========================================
   LAYOUT.CSS - Header y Estructura
   ========================================== */

/* ==========================================
   HEADER
   ========================================== */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--background-light);
    box-shadow: var(--shadow);
}

.header-main-container {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* ==========================================
   LOGO SECTION (15%)
   ========================================== */

.logo-independent {
    width: 15%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--background-light);
    border-right: 2px solid var(--white);
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo img {
    height: 104px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: var(--white);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 200px;
    max-width: 100%;
    white-space: nowrap;
    letter-spacing: 0.5px;
    box-sizing: border-box;
}

.contact-btn:hover {
    background: var(--secondary-1);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   CONTENT SECTION (85%)
   ========================================== */

.content-independent {
    width: 85%;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   STATS BAR
   ========================================== */

.stats-bar {
    background: var(--gray-100);
    color: var(--text-dark);
    border-bottom: 2px solid var(--accent);
    width: 100%;
}

.stats-container {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: stretch;
}

.stats-title {
    background: var(--secondary);
    color: var(--white);
    display: flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    min-height: 24px;
    border-right: 2px solid var(--accent);
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.25rem;
    min-height: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.15rem;
    border-left: 1px solid rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.stat-item:first-child {
    border-left: none;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: clamp(0.85rem, 1.3vw, 1rem);
    font-weight: 800;
    color: var(--secondary);
}

.stat-label {
    font-size: clamp(0.65rem, 0.9vw, 0.75rem);
    color: var(--text-dark);
    text-align: center;
}

.stat-icon {
    font-size: 1rem;
    color: var(--primary);
}

.stats-cta {
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.6rem;
    min-height: 24px;
    border-left: 2px solid var(--accent);
}

.stats-cta a {
    background: var(--accent);
    color: var(--white);
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-cta a:hover {
    background: var(--secondary-1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ==========================================
   LOCATION BAR
   ========================================== */

.location-bar {
    background: var(--secondary);
    color: var(--white);
    padding: 0.2rem 0;
    text-align: center;
    border-bottom: 2px solid var(--accent);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.location-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.location-item a {
    color: var(--white);
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.location-item a:hover {
    color: var(--primary);
}

.location-icon {
    width: 14px;
    height: 10px;
    display: inline-block;
    background-size: cover;
    background-repeat: no-repeat;
}

/* ==========================================
   NAVIGATION
   ========================================== */

.nav-social-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.4rem 0.8rem;
    background: var(--background-light);
}

.navbar-container {
    flex-grow: 1;
    display: flex;
    justify-content: flex-start;
}

nav {
    display: flex;
    justify-content: flex-start;
}

nav ul {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li a {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.2rem 0;
    transition: color 0.3s ease;
    position: relative;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--accent);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

/* ==========================================
   SOCIAL ICONS
   ========================================== */

.header-actions { 
    display: flex; 
    align-items: center; 
    justify-content: flex-end;
    gap: 1.2rem;
    padding: 0.25rem 0;
}

.social-icons { 
    display: flex; 
    gap: 1rem; 
    align-items: center;
}

.social-icons a { 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 1.3rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 50px;
    padding: 0.25rem;
}

.social-icons a:hover { 
    color: var(--accent);
    transform: translateY(-3px);
}

.social-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.25rem;
    color: var(--text-dark);
    line-height: 1.2;
}

.social-text {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-top: 0.1rem;
}

/* ==========================================
   MAIN CONTENT - Compensar header fijo
   ========================================== */

#main-content {
    padding-top: 220px; /* Compensa la altura del header fijo (logo ~188px + stats ~24px + location ~6px + nav ~13px) */
    min-height: calc(100vh - 220px);
}

/* Excepción: cuando hay un hero-static, eliminar el padding-top del main */
#main-content:has(> .hero.hero-static:first-child),
#main-content:has(> .scale-safe > .hero.hero-static:first-child) {
    padding-top: 0;
}

/* Ajuste para pantallas más pequeñas */
@media (max-width: 1024px) {
    #main-content {
        padding-top: 200px;
    }
    
    #main-content:has(> .hero.hero-static:first-child),
    #main-content:has(> .scale-safe > .hero.hero-static:first-child) {
        padding-top: 0;
    }
}

@media (max-width: 768px) {
    #main-content {
        padding-top: 180px;
    }
    
    #main-content:has(> .hero.hero-static:first-child),
    #main-content:has(> .scale-safe > .hero.hero-static:first-child) {
        padding-top: 0;
    }
}