/* Variables and Fundamentals */
:root {
  --bg-color: #FDFBF7; /* Warm Cream */
  --bg-light: #F4F2EC; /* Slightly darker cream for alternate sections */
  --bg-dark: #2C302E; /* Deep Sepia/Charcoal */
  --text-color: #2A2A28; /* Soft Black */
  --text-light: #5A5A58; /* Muted text */
  --text-inverse: #FFFFFF;
  --accent-primary: #B8860B; /* Cobre / Oro Envejecido */
  --accent-primary-hover: #9c7209;
  --accent-secondary: #e6dac3; /* Highlight color */
  --border-color: #E6E2D8;
  --white: #FFFFFF;
  
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px rgba(44, 48, 46, 0.12);
  --radius-md: 8px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 { 
    font-family: var(--font-heading); 
    color: var(--text-color); 
    font-weight: 600;
}
p { color: var(--text-light); }
a { text-decoration: none; color: inherit; }

/* Utility Classes */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}
.text-center { text-align: center; }
.bg-light { background-color: var(--bg-light); }
.bg-dark { background-color: var(--bg-dark); color: var(--text-inverse); }
.color-white { color: var(--text-inverse) !important; }
.color-white p { color: #EAE8E3; }
.wrapper-section { padding: 6rem 0; }

.section-title { margin-bottom: 4rem; max-width: 700px; margin-left: auto; margin-right: auto; }
.section-title h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.section-title p { font-size: 1.15rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}
.btn-primary {
    background-color: var(--accent-primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background-color: var(--accent-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-ghost {
    background-color: transparent;
    border-color: var(--text-color);
    color: var(--text-color);
    padding: 0.6rem 1.5rem;
}
.btn-ghost:hover {
    background-color: var(--text-color);
    color: var(--white);
}
.btn-block {
    width: 100%;
}

/* Header */
.header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background-color: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    position: relative;
}
.logo a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}
.logo-image {
    height: 40px;
    width: auto;
    display: block;
}
.logo-brand-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: inherit;
}
.nav { display: flex; align-items: center; gap: 2rem; }
.nav-link { font-weight: 500; transition: color 0.2s; }
.nav-link:hover { color: var(--accent-primary); }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--text-color); }

/* Hero */
.hero {
    padding: 10rem 0 6rem; /* extra top padding for fixed header */
}
.hero-content {
    max-width: 800px;
    margin: 0 auto;
}
.kicker {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--accent-primary);
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.hero h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}
.hero .subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto; margin-right: auto;
}
.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
.hero-buttons {
    display: flex;
    gap: 1.3rem;
    flex-wrap: wrap;
    justify-content: center;
}
.hero-buttons .btn {
    min-width: 290px;
    padding: 1rem 2rem;
}
.micro-copy {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}
.micro-copy svg {
    margin-right: 4px;
    color: var(--accent-primary);
}

/* ============================================================
   SECCIÓN ANTES / DESPUÉS — estilos scoped bajo #antes-despues
   NO tocar fuera de este bloque
   ============================================================ */

/* Filtro visual para imagen «antes» */
.img-damaged {
    filter: sepia(0.6) grayscale(0.5) contrast(0.85) brightness(0.9) blur(0.5px);
}

/* --- Bloque principal (par único en la parte superior) --- */
#antes-despues .fixed-comparison-main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    align-items: stretch;
    overflow: hidden;
}
#antes-despues .comparison-side {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 100%;
    background: #1f1f1f;
    min-width: 0;
}
#antes-despues .comparison-side img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
#antes-despues .label-before,
#antes-despues .label-after {
    position: absolute;
    top: 16px;
    background: rgba(44, 48, 46, 0.72);
    color: white;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 1px;
}
#antes-despues .label-before { left: 16px; }
#antes-despues .label-after  { right: 16px; }

/* --- Galería de casos (pares repetibles) --- */
#antes-despues .gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}
#antes-despues .gallery-item {
    max-width: 100%;
}
#antes-despues .hidden-item {
    display: none;
}

/* Cómo funciona */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.step-card {
    text-align: center;
    padding: 2rem;
}
.step-icon {
    width: 60px; height: 60px;
    background-color: var(--white);
    color: var(--accent-primary);
    font-family: var(--font-heading);
    font-size: 1.5rem; font-weight: 700;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
.step-card h3 { margin-bottom: 0.8rem; font-size: 1.4rem; }

/* Servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
.service-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    position: relative;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.service-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}
.service-card h3 { margin-bottom: 1rem; font-size: 1.5rem; }
.service-badge {
    position: absolute;
    top: -12px; right: 24px;
    background: var(--text-color);
    color: var(--white);
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    padding: 4px 10px; border-radius: 20px; letter-spacing: 1px;
}
.service-badge.special {
    background: var(--accent-primary);
}

/* Precios */
.pricing-table {
    background: rgba(255,255,255,0.05); /* very subtle light transparent on dark bg */
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    max-width: 800px; margin: 0 auto;
}
.pricing-row {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.1rem;
}
.pricing-row:last-child { border-bottom: none; }
.pricing-row .price { font-weight: 600; font-family: var(--font-heading); font-size: 1.25rem; color: var(--accent-primary); }
.pricing-row.urgent { background-color: rgba(184, 134, 11, 0.1); border-radius: 0 0 8px 8px; }

/* Confianza */
.trust-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.trust-list { list-style: none; margin-top: 2rem; }
.trust-list li {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.list-icon {
    color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 2px;
}
.trust-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* FAQ */
.faq-container { max-width: 800px; }
.faq-list {
    border-top: 1px solid var(--border-color);
}
.faq-item {
    border-bottom: 1px solid var(--border-color);
}
.faq-question {
    width: 100%;
    text-align: left; background: none; border: none;
    padding: 1.5rem 0;
    font-size: 1.1rem; font-weight: 600; font-family: var(--font-body); color: var(--text-color);
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer;
}
.faq-question .icon { transition: transform 0.3s; }
.faq-answer {
    max-height: 0; overflow: hidden; transition: max-height 0.4s ease;
}
.faq-answer p { padding-bottom: 1.5rem; }
.faq-item.active .faq-question { color: var(--accent-primary); }
.faq-item.active .faq-question .icon { transform: rotate(180deg); }
.faq-item.active .faq-answer { max-height: 500px; }

/* Formulario */
.form-container { max-width: 700px; }
.form-card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.form-header { margin-bottom: 2rem; }
.form-header h2 { font-size: 2rem; }
.form-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.col-half { flex: 1; }
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.95rem;
}
input[type="text"], input[type="email"], textarea {
    width: 100%; padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px; font-family: var(--font-body); font-size: 1rem;
    background-color: var(--bg-color); transition: border-color 0.2s;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent-primary); }

/* Estado de error visual en formulario */
.form-group.field-error input[type="text"],
.form-group.field-error input[type="email"],
.form-group.field-error textarea {
    border-color: #a32020;
    box-shadow: 0 0 0 3px rgba(163, 32, 32, 0.15);
}
.drop-zone.field-error {
    border-color: #a32020;
    background-color: rgba(163, 32, 32, 0.08);
}
.consent-section.field-error {
    border: 1px solid #a32020;
    border-radius: 10px;
    padding: 1rem;
    background-color: rgba(163, 32, 32, 0.06);
}
.field-error-pulse {
    animation: fieldErrorPulse 0.8s ease;
}
@keyframes fieldErrorPulse {
    0% { transform: scale(1); }
    35% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

.drop-zone {
    border: 2px dashed var(--accent-primary);
    border-radius: 8px;
    padding: 2.5rem 1rem;
    text-align: center;
    background-color: rgba(184, 134, 11, 0.05); /* very light gold */
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.drop-zone:hover, .drop-zone.dragover { background-color: rgba(184, 134, 11, 0.1); }
.file-input {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.drop-zone h4 { margin: 1rem 0 0.5rem; font-family: var(--font-body); }
.file-hint { font-size: 0.85rem; color: var(--text-light); }

.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.custom-checkbox {
    display: flex; align-items: center; position: relative; padding-left: 30px; cursor: pointer; user-select: none;
}
.custom-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark {
    position: absolute; left: 0; top: 2px;
    height: 20px; width: 20px; background-color: var(--bg-color);
    border: 1px solid var(--border-color); border-radius: 4px;
}
.custom-checkbox:hover input ~ .checkmark { background-color: var(--border-color); }
.custom-checkbox input:checked ~ .checkmark { background-color: var(--accent-primary); border-color: var(--accent-primary); }
.checkmark:after {
    content: ""; position: absolute; display: none;
    left: 6px; top: 2px; width: 5px; height: 10px;
    border: solid white; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.custom-checkbox input:checked ~ .checkmark:after { display: block; }

/* Toggle Urgencia */
.toggle-group {
    background-color: var(--bg-light); padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border-color);
}
.toggle-container {
    display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.toggle-text { display: flex; flex-direction: column; }
.toggle-text strong { color: var(--accent-primary); font-size: 1.1rem; }
.toggle-text span { font-size: 0.9rem; color: var(--text-light); margin-top: 4px; font-weight: normal; }

.toggle-switch { position: relative; width: 50px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-primary); }
input:checked + .slider:before { transform: translateX(24px); }

.form-submit { text-align: center; margin-top: 2rem; }
.privacy-note {
    font-size: 0.85rem; display: flex; align-items: center; justify-content: center; margin-top: 1rem; gap: 6px;
}

/* Footer */
.footer {
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 3rem 0;
}
.footer-inner {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2rem;
}
.footer-logo { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { opacity: 0.8; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; }
.footer p { opacity: 0.9; font-size: 0.9rem; color: #F2EDE2; }

/* Responsive (Mobile First adjustments mainly done via flex wrap / clamp, adding media queries here) */
@media (max-width: 900px) {
    .trust-grid { grid-template-columns: 1fr; }
    .trust-image { order: -1; } /* Image on top */
    .pricing-table { font-size: 1rem; }
}
@media (max-width: 768px) {
    .nav { display: none; } /* Basic mobile hide, for real implementation a menu is needed */
    .nav.nav-open {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        padding: 1rem;
        background-color: rgba(253, 251, 247, 0.98);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
    }
    .nav.nav-open .btn-ghost {
        width: 100%;
        text-align: center;
    }
    .mobile-menu-btn { display: block; }
    .hero { padding: 8rem 0 4rem; }
    .hero h1 { font-size: 2.2rem; }
    .hero-buttons {
        width: 100%;
        flex-direction: column;
    }
    .hero-buttons .btn {
        width: 100%;
    }
    .hero-highlights {
        margin-top: 0.8rem !important;
        gap: 0.45rem !important;
    }
    .hero-highlights > div {
        padding: 0.65rem 0.75rem !important;
        font-size: 0.88rem !important;
    }
    
    .steps-grid, .services-grid, .checkbox-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
    .form-card { padding: 1.5rem; }
    
    .pricing-row { flex-direction: column; gap: 0.5rem; align-items: center; text-align: center; }
    .footer-inner { flex-direction: column; text-align: center; justify-content: center; }
    /* Antes/Después responsive — scoped */
    #antes-despues .fixed-comparison-main {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    #antes-despues .comparison-side {
        min-height: 0;
    }
}

