/* ========== TIPOGRAFÍA ========== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Serif+Display:ital@0;1&display=swap');

/* ========== VARIABLES ========== */
:root {
    --bg:           #0D0A08;
    --bg-raised:    #130F0B;
    --surface:      #1A1410;
    --surface-alt:  #221A14;
    --border:       rgba(255, 180, 80, 0.10);
    --border-hover: rgba(255, 180, 80, 0.22);
    --text:         #F5EDE3;
    --text-muted:   rgba(245, 237, 227, 0.55);
    --text-dim:     rgba(245, 237, 227, 0.30);
    --accent:       #E8894A;
    --accent-light: #F5A96B;
    --accent-soft:  rgba(232, 137, 74, 0.12);
    --accent-glow:  rgba(232, 137, 74, 0.20);
    --radius-sm:    8px;
    --radius:       16px;
    --radius-lg:    24px;
    --radius-xl:    32px;
    --shadow-sm:    0 2px 12px rgba(0, 0, 0, 0.35);
    --shadow:       0 8px 40px rgba(0, 0, 0, 0.55);
    --shadow-lg:    0 24px 80px rgba(0, 0, 0, 0.70);
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
    --ease:         cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition:   0.2s var(--ease);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    min-height: 100vh;
    background-color: var(--bg);

    /* Imagen de fondo global con overlay cálido */
    background-image:
        linear-gradient(
            to bottom,
            rgba(8, 5, 3, 0.82) 0%,
            rgba(13, 10, 8, 0.88) 30%,
            rgba(13, 10, 8, 0.94) 60%,
            rgba(8, 5, 3, 0.98) 100%
        ),
        url('../img/bg.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
}

/* ========== LAYOUT ========== */
.container {
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: 32px;
    padding-block: 0;
}

/* ========== HEADER ========== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 7, 5, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 18px;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: 0.01em;
    transition: opacity var(--transition);
}

.brand:hover { opacity: 0.75; }

.logo {
    max-height: 80px;
    width: auto;
    object-fit: contain;
    background: transparent;
    background-color: transparent;
    background-image: none;
    display: block;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.nav a:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.nav a.active {
    color: var(--accent-light);
    background: var(--accent-soft);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    padding: 8px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), background var(--transition);
}

.mobile-toggle:hover {
    border-color: var(--border-hover);
    background: var(--surface);
}

.mobile-toggle span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.mobile-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ========== SECCIONES ========== */
.hero    { padding-block: 100px 72px; }
.section { padding-block: 80px; }

.section-header { margin-bottom: 48px; }

.section-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

/* ========== TIPOGRAFÍA ========== */
h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text);
}

h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
}

h3 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text);
    margin-bottom: 10px;
}

h4 {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

p {
    color: var(--text-muted);
    line-height: 1.75;
    font-size: 0.97rem;
}

a { color: var(--accent-light); }

/* ========== BOTONES ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #0D0A08;
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(232, 137, 74, 0.25);
}

.btn-primary:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(232, 137, 74, 0.35);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-hover);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: rgba(245, 237, 227, 0.25);
    background: var(--surface);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-large {
    padding: 14px 28px;
    font-size: 0.92rem;
}

/* ========== TARJETAS ========== */
.service-card,
.about-card,
.metric-card,
.testimonial-card {
    background: rgba(26, 20, 16, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.service-card:hover,
.about-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.metric-value {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 400;
    color: var(--accent);
    display: block;
    line-height: 1;
    margin-bottom: 16px;
}

/* ========== GRILLAS ========== */
.services-grid,
.about-grid,
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

/* ========== FORMULARIOS ========== */
input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(20, 15, 10, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.93rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    backdrop-filter: blur(8px);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath stroke='%23E8894A' stroke-width='1.5' fill='none' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder, textarea::placeholder {
    color: var(--text-dim);
}

label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 7px;
    text-transform: uppercase;
}

/* ========== LISTAS ========== */
ul { padding-left: 18px; }
li { margin-bottom: 8px; color: var(--text-muted); font-size: 0.95rem; }

/* ========== FOOTER ========== */
.footer {
    padding-block: 56px;
    border-top: 1px solid var(--border);
    background: rgba(8, 5, 3, 0.85);
    backdrop-filter: blur(20px);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.footer-brand { display: grid; gap: 14px; }
.footer-logo  { height: 32px; width: auto; }

.footer-brand p {
    font-size: 0.88rem;
    line-height: 1.65;
    max-width: 260px;
}

.footer-links, .footer-contact { display: grid; gap: 10px; }

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer-links a:hover { color: var(--accent-light); }
.footer-contact p { font-size: 0.9rem; }

/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--surface-alt);
    color: var(--text);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-hover);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
    z-index: 999;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error { border-color: rgba(255, 100, 100, 0.35); color: #fca5a5; }

/* ========== WHATSAPP ========== */
.whatsapp-float {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    transition: transform var(--transition), box-shadow var(--transition);
    z-index: 998;
}

.whatsapp-float:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.42);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .container { padding-inline: 24px; }
    .nav { display: none; }
    .mobile-toggle { display: flex; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .container { padding-inline: 18px; }
    .hero    { padding-block: 72px 48px; }
    .section { padding-block: 56px; }
    .topbar-inner { flex-wrap: wrap; }

    .nav.open {
        display: flex;
        flex-direction: column;
        width: 100%;
        background: rgba(20, 15, 10, 0.95);
        backdrop-filter: blur(20px);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 8px;
        margin-top: 4px;
        gap: 2px;
    }

    .nav.open a { padding: 10px 14px; border-radius: var(--radius-sm); width: 100%; }
    .footer-inner { grid-template-columns: 1fr; }

    .toast {
        width: calc(100% - 36px);
        text-align: center;
        white-space: normal;
    }

    body {
        background-attachment: scroll;
    }
}