/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --primary: #0f172a;
    /* Deep Navy */
    --primary-light: #1e293b;
    --accent: #d97706;
    /* Amber/Gold */
    --accent-light: #f59e0b;
    --text-dark: #1e293b;
    --text-gray: #475569;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    line-height: 1.2;
}

/* Header & Nav (Preserving existing logic but improved) */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Hero Section */
.hero {
    position: relative;
    height: 60vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: white;
    text-align: center;
    background-color: var(--primary);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.8));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 0 20px;
    max-width: 900px;
    margin-top: 180px; /* Pushes content down to reveal faces */
    animation: fadeUp 1s ease-out;
}

.hero-icon {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 3rem;
    color: var(--accent);
    backdrop-filter: blur(5px);
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero h1 span {
    color: var(--accent);
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Stats Section (used in some pages) */
.stats-section {
    position: relative;
    z-index: 10;
    margin-top: 20px;
    /* Slight positive margin to clear hero */
    padding: 40px 20px 0;
    /* Increased top padding */
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.stat-box {
    background: white;
    padding: 35px 25px;
    border-radius: 24px;
    /* More rounded corners */
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.4s ease;
    border-top: 4px solid var(--accent);
    /* Premium accent border */
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-box:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.stat-box:hover::before {
    opacity: 1;
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    /* Larger count */
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 5px;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    z-index: 1;
}

/* Main Content */
.content {
    max-width: 1200px;
    margin: 100px auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 80px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.section-title p {
    color: var(--text-gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Image Text Section */
.image-text-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    margin-bottom: 100px;
}

.image-box {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 4/3;
    transition: transform 0.7s;
}

.image-box:hover img {
    transform: scale(1.05);
}

.text-box h3 {
    font-size: 2rem;
    margin-bottom: 25px;
}

.text-box p {
    color: var(--text-gray);
    margin-bottom: 20px;
    font-size: 1.05rem;
}

/* Standard Features Grid (3 Columns - for Derecho, etc.) */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 100px;
}

/* 2x2 Grid Layout (Asesoria) */
.features-grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
}

@media (max-width: 768px) {
    .features-grid-2x2 {
        grid-template-columns: 1fr;
    }
}

/* Modifier Class for Pyramid Layout (for Especialistas Values) */
.features-grid-pyramid {
    grid-template-columns: repeat(6, 1fr);
}

/* First row - 3 items */
.features-grid-pyramid .feature-card:nth-child(1) {
    grid-column: 1 / 3;
}

.features-grid-pyramid .feature-card:nth-child(2) {
    grid-column: 3 / 5;
}

.features-grid-pyramid .feature-card:nth-child(3) {
    grid-column: 5 / 7;
}

/* Second row - 2 items centered */
.features-grid-pyramid .feature-card:nth-child(4) {
    grid-column: 2 / 4;
}

.features-grid-pyramid .feature-card:nth-child(5) {
    grid-column: 4 / 6;
}

/* Response for mobile/tablet */
@media (max-width: 992px) {

    .features-grid,
    .features-grid-pyramid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid-pyramid .feature-card:nth-child(n) {
        grid-column: auto;
        /* Reset */
    }

    /* Center the last item if odd count (for both layouts if needed) */
    .features-grid-pyramid .feature-card:nth-child(5) {
        grid-column: 1 / -1;
        max-width: 500px;
        margin: 0 auto;
        width: 100%;
    }
}

@media (max-width: 576px) {

    .features-grid,
    .features-grid-pyramid {
        grid-template-columns: 1fr;
    }

    .features-grid-pyramid .feature-card:nth-child(5) {
        grid-column: auto;
        max-width: none;
    }
}

.feature-card {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 4px solid transparent;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-top-color: var(--accent);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 25px;
}

.feature-card h4 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.feature-card p {
    color: var(--text-gray);
    font-size: 1rem;
    line-height: 1.7;
}

/* List Style Features (used in Construcciones) */
.features-list-clean {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature-box-clean {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: 0.3s;
}

.feature-box-clean:hover {
    box-shadow: var(--shadow);
}

.feature-box-clean i {
    font-size: 2rem;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 5px;
}

.feature-box-clean div h4 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.feature-box-clean div p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* Benefits Grid (used in Derecho) */
.benefits-section {
    background-color: white;
    padding: 80px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 100px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.benefit-item {
    display: flex;
    gap: 20px;
}

.benefit-icon {
    width: 50px;
    height: 50px;
    background-color: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.benefit-text h4 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.benefit-text p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 100%);
    border-radius: 24px;
    /* Softened corners */
    padding: 80px 40px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 60px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Subtle highlighting border */
}

/* Decorative background element */
.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    transform: rotate(30deg);
    pointer-events: none;
}

.cta-section h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 2.5rem;
    font-family: 'Playfair Display', serif;
}

.cta-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 40px;
    font-weight: 300;
}

.btn {
    display: inline-block;
    padding: 16px 40px;
    background-color: var(--accent);
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    /* Fully rounded borders as requested */
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border: 2px solid var(--accent);
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
    /* Glow effect */
}

.btn:hover {
    background-color: white;
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(217, 119, 6, 0.4);
}

/* Footer */
footer {
    background: var(--primary);
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Media Queries */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-content {
        margin-top: 100px;
    }

    .image-text-section {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    /* Just hiding for simplicity or could add toggle */
    .cta-section {
        padding: 60px 20px;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}