/*
  ═══════════════════════════════════════════════════════════
  VARIABLES CSS (Custom Properties)
  ═══════════════════════════════════════════════════════════
*/
:root {
    --color-bg:        #0a0a0f;
    --color-surface:   #12121a;
    --color-border:    rgba(255,255,255,0.08);
    --color-text:      #f0f0f5;
    --color-text-dim:  #8a8a9a;

    --accent-1:        #6c63ff;
    --accent-2:        #00d4aa;
    --accent-3:        #ff6b6b;
    --gradient-main:   linear-gradient(135deg, var(--accent-1), var(--accent-2));

    --font-heading:    'Outfit', sans-serif;
    --font-body:       'Inter', sans-serif;

    --glass:           rgba(255,255,255,0.03);
    --glass-border:    rgba(255,255,255,0.06);
    --shadow-glow:     0 0 60px rgba(108,99,255,0.15);
    --radius:          16px;
    --transition:      0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ═══ RESET ═══ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 48px;
    transition: all 0.4s ease;
}

.navbar.scrolled {
    padding: 14px 48px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

/* Logo + texto de marca */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.navbar-logo-img {
    height: 56px;
    width: auto;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s ease;
    box-shadow: 0 0 20px rgba(108,99,255,0.2);
}

.navbar-brand:hover .navbar-logo-img {
    transform: scale(1.08);
}

.navbar-logo-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--color-text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--color-text);
}

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

/* ═══════════════════════════════════════════════════════════
   HERO: Los 3 paneles verticales
   ═══════════════════════════════════════════════════════════ */
.hero {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.panel {
    position: relative;
    flex: 1;
    overflow: hidden;
    cursor: pointer;
    transition: flex var(--transition);
}

.panel:not(:last-child) {
    border-right: 1px solid var(--color-border);
}

.panel-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.panel:hover .panel-bg,
.panel.active .panel-bg {
    transform: scale(1.1);
}

.panel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10,10,15,0.4) 0%,
        rgba(10,10,15,0.7) 50%,
        rgba(10,10,15,0.9) 100%
    );
    transition: background 0.6s ease;
}

.panel.active .panel-overlay {
    background: linear-gradient(
        to bottom,
        rgba(10,10,15,0.3) 0%,
        rgba(10,10,15,0.6) 50%,
        rgba(10,10,15,0.85) 100%
    );
}

.panel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 48px 32px;
    z-index: 2;
    transition: all var(--transition);
}

.panel.active .panel-content {
    padding: 60px 48px;
}

.panel-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.4s ease;
    background: var(--glass);
}

.panel-icon svg {
    width: 22px;
    height: 22px;
    color: var(--accent-2);
    transition: color 0.3s;
}

.panel.active .panel-icon {
    width: 56px;
    height: 56px;
    border-color: var(--accent-2);
    box-shadow: 0 0 20px rgba(0,212,170,0.2);
}

.panel.active .panel-icon svg {
    width: 26px;
    height: 26px;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    transition: font-size var(--transition);
    line-height: 1.2;
}

.panel.active .panel-title {
    font-size: 2.8rem;
}

.panel.collapsed .panel-title {
    font-size: 1.2rem;
}

.panel-description {
    font-size: 0.95rem;
    color: var(--color-text-dim);
    line-height: 1.6;
    max-width: 400px;
    transition: all var(--transition);
    opacity: 1;
}

.panel.collapsed .panel-description {
    opacity: 0;
    max-height: 0;
    margin: 0;
    overflow: hidden;
}

.panel-details {
    list-style: none;
    margin-top: 24px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease 0.1s;
}

.panel.active .panel-details {
    opacity: 1;
    max-height: 300px;
}

.panel-details li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: var(--color-text-dim);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border);
}

.panel-details li:last-child {
    border-bottom: none;
}

.panel-details li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-2);
}

/* CTA Button — ahora es un enlace real */
.panel-cta {
    display: inline-block;
    margin-top: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-2);
    text-decoration: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    padding: 10px 24px;
    border: 1px solid rgba(0,212,170,0.3);
    border-radius: 8px;
    background: rgba(0,212,170,0.05);
}

.panel.active .panel-cta {
    opacity: 1;
    transform: translateY(0);
}

.panel-cta:hover {
    background: rgba(0,212,170,0.15);
    border-color: var(--accent-2);
    letter-spacing: 2.5px;
    box-shadow: 0 4px 20px rgba(0,212,170,0.2);
}

.panel-number {
    position: absolute;
    top: 100px;
    right: 24px;
    font-family: var(--font-heading);
    font-size: 8rem;
    font-weight: 800;
    color: rgba(255,255,255,0.03);
    z-index: 1;
    transition: all var(--transition);
    line-height: 1;
}

.panel.active .panel-number {
    font-size: 12rem;
    color: rgba(255,255,255,0.05);
}

.panel.collapsed .panel-number {
    font-size: 4rem;
    opacity: 0.5;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
    z-index: 3;
}

.panel:hover::before,
.panel.active::before {
    transform: scaleX(1);
}

/* ═══════════════════════════════════════════════════════════
   SCROLL INDICATOR
   ═══════════════════════════════════════════════════════════ */
.scroll-indicator {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.scroll-indicator.hidden {
    opacity: 0;
}

.scroll-text {
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-text-dim);
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    animation: bounce 2s infinite;
}

.scroll-arrow svg {
    color: var(--accent-2);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(8px); }
    60% { transform: translateY(4px); }
}

/* ═══════════════════════════════════════════════════════════
   CONTACT SECTION (simplificada — sin formulario)
   ═══════════════════════════════════════════════════════════ */
.contact-section {
    position: relative;
    padding: 120px 48px 80px;
    background: var(--color-bg);
    overflow: hidden;
}

.contact-section::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(108,99,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

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

.contact-header {
    text-align: center;
    margin-bottom: 72px;
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent-2);
    padding: 8px 20px;
    border: 1px solid rgba(0,212,170,0.3);
    border-radius: 100px;
    margin-bottom: 24px;
}

.contact-title {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-dim);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Tarjetas de contacto centradas en fila */
.contact-cards-centered {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px 32px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
    min-width: 280px;
    flex: 0 1 320px;
}

.info-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.info-card:hover {
    border-color: rgba(108,99,255,0.3);
    background: rgba(255,255,255,0.05);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.info-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(108,99,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon svg {
    width: 22px;
    height: 22px;
    color: var(--accent-1);
}

.info-text h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-text p {
    color: var(--color-text-dim);
    font-size: 0.95rem;
}

.info-secondary {
    font-size: 0.8rem !important;
    color: rgba(138,138,154,0.6) !important;
    margin-top: 2px;
}

/* Redes sociales centradas */
.social-links-centered {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 40px;
}

.social-link {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--color-text-dim);
    text-decoration: none;
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.social-link:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(108,99,255,0.2);
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.footer {
    text-align: center;
    padding: 32px;
    color: var(--color-text-dim);
    font-size: 0.85rem;
    border-top: 1px solid var(--color-border);
}

/* ═══════════════════════════════════════════════════════════
   ANIMACIONES DE ENTRADA (paneles)
   ═══════════════════════════════════════════════════════════ */
.panel {
    opacity: 0;
    transform: translateY(30px);
    animation: panelEnter 0.8s ease forwards;
}

.panel:nth-child(1) { animation-delay: 0.1s; }
.panel:nth-child(2) { animation-delay: 0.25s; }
.panel:nth-child(3) { animation-delay: 0.4s; }

@keyframes panelEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════
   PÁGINAS DE DETALLE (peritaje.html, sostenibilidad.html, etc.)
   ═══════════════════════════════════════════════════════════ */

/* Hero de la página de detalle */
.detail-hero {
    position: relative;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.detail-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
}

.detail-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10,10,15,0.3) 0%,
        rgba(10,10,15,0.7) 60%,
        rgba(10,10,15,1) 100%
    );
}

.detail-hero-content {
    position: relative;
    z-index: 2;
    padding: 60px 48px;
    max-width: 800px;
}

.detail-hero-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent-2);
    padding: 8px 20px;
    border: 1px solid rgba(0,212,170,0.3);
    border-radius: 100px;
    margin-bottom: 20px;
}

.detail-hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
}

.detail-hero-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-dim);
    line-height: 1.7;
    max-width: 600px;
}

/* Grid de tarjetas de servicios */
.services-section {
    padding: 80px 48px 100px;
    max-width: 1300px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 28px;
}

/* Tarjeta individual de servicio */
.service-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 36px;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(24px);
    position: relative;
    overflow: hidden;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    border-color: rgba(108,99,255,0.3);
    background: rgba(255,255,255,0.05);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.service-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(108,99,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.service-card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent-1);
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.service-card p {
    color: var(--color-text-dim);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Botón de volver al inicio */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    padding: 10px 0;
}

.back-link svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s;
}

.back-link:hover {
    color: var(--accent-2);
}

.back-link:hover svg {
    transform: translateX(-4px);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .panel-title {
        font-size: 1.4rem;
    }
    .panel.active .panel-title {
        font-size: 2rem;
    }
    .contact-title {
        font-size: 2.4rem;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .detail-hero-title {
        font-size: 2.6rem;
    }
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .panel {
        min-height: 200px;
        flex: 1;
    }

    .panel.active {
        min-height: 60vh;
    }

    .panel.collapsed {
        min-height: 100px;
    }

    .panel:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .panel-content {
        padding: 32px 24px;
    }

    .panel-number {
        font-size: 4rem;
        top: 20px;
        right: 16px;
    }

    .navbar {
        padding: 16px 24px;
    }

    .navbar-logo-text {
        display: none;
    }

    .contact-section {
        padding: 80px 24px 60px;
    }

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

    .contact-cards-centered {
        flex-direction: column;
        align-items: center;
    }

    .info-card {
        width: 100%;
        max-width: 400px;
    }

    .detail-hero {
        height: 40vh;
        min-height: 300px;
    }

    .detail-hero-content {
        padding: 40px 24px;
    }

    .detail-hero-title {
        font-size: 2rem;
    }

    .services-section {
        padding: 60px 24px 80px;
    }

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