/* ==========================================================================
   Components — Buttons, Cards, Navigation, Forms
   ========================================================================== */

/* --- Header & Navigation --- */

.site-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-strong);
    transition: box-shadow var(--duration-normal) var(--ease-out);
    overflow: visible;
}

.site-header.is-scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}

.site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-sm);
    height: var(--header-height);
    position: relative;
    z-index: 1002;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
    grid-column: 1;
    color: var(--brand-warm);
}

.site-logo:hover {
    color: var(--brand-warm);
}

.site-logo img {
    height: 80px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.site-logo__brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
    gap: 2px;
    min-width: 0;
}

.site-logo__brand-line {
    font-family: var(--font-heading);
    font-size: clamp(0.9rem, 0.8rem + 0.45vw, 1.125rem);
    font-weight: 700;
    color: var(--brand-warm);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-footer__logo img {
    height: 80px;
}

.site-footer__logo .site-logo__brand-line {
    font-size: clamp(0.8125rem, 0.75rem + 0.35vw, 1rem);
}

@media (max-width: 767px) {
    .site-logo {
        gap: var(--space-sm);
    }

    .site-logo img {
        height: 80px;
    }

    .site-logo__brand-line {
        font-size: 0.75rem;
    }
}

@media (max-width: 380px) {
    .site-logo img {
        height: 80px;
    }

    .site-logo__brand-line {
        font-size: 0.6875rem;
    }
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    grid-column: 2;
    justify-self: end;
    z-index: 1002;
    transition: background var(--duration-fast) var(--ease-out);
}

.nav-toggle:hover {
    background: var(--bg-card);
}

.nav-toggle__bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform var(--duration-normal) var(--ease-out),
                opacity var(--duration-normal) var(--ease-out);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    background: color-mix(in srgb, var(--bg-dark) 98%, transparent);
    padding: var(--space-xl);
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform var(--duration-normal) var(--ease-out),
                visibility var(--duration-normal) var(--ease-out);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.site-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.site-nav__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.site-nav__link {
    display: block;
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--text-main);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast) var(--ease-out),
                background var(--duration-fast) var(--ease-out);
}

.site-nav__link:hover,
.site-nav__link.is-active {
    color: var(--accent);
    background: var(--nav-active-bg);
}

.site-nav__cta {
    align-self: flex-start;
    width: 100%;
    justify-content: center;
}

@media (min-width: 1024px) {
    .site-header__inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--header-height);
        gap: var(--space-lg);
    }

    .nav-toggle {
        display: none;
    }

    .site-nav {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        z-index: auto;
        flex-direction: row;
        align-items: center;
        gap: var(--space-lg);
        background: transparent;
        padding: 0;
        transform: none;
        visibility: visible;
        pointer-events: auto;
        overflow: visible;
        flex-shrink: 0;
    }

    .site-nav__list {
        flex-direction: row;
        align-items: center;
        gap: var(--space-lg);
    }

    .site-nav__link {
        font-size: var(--text-sm);
        padding: var(--space-xs) var(--space-sm);
    }

    .site-nav__cta {
        width: auto;
        flex-shrink: 0;
        margin-left: var(--space-sm);
    }
}

@media (min-width: 1200px) {
    .site-header__inner {
        gap: var(--space-md);
    }

    .site-nav__list {
        gap: var(--space-xl);
    }
}

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-full);
    transition: background var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out),
                transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn--primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-family: var(--font-heading);
}

.btn--primary:hover {
    background: var(--btn-primary-hover-bg);
    color: var(--btn-primary-text);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn--outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
}

.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn--whatsapp {
    background: var(--accent-green);
    color: #fff;
}

.btn--whatsapp:hover {
    background: var(--accent-green-hover);
    color: #fff;
    box-shadow: 0 4px 20px rgba(58, 195, 100, 0.25);
}

.btn--pulse {
    animation: cta-pulse 2.5s ease-in-out infinite;
}

@keyframes cta-pulse {
    0% { box-shadow: 0 0 0 0 rgba(58, 195, 100, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(58, 195, 100, 0); }
    100% { box-shadow: 0 0 0 0 rgba(58, 195, 100, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .btn--pulse {
        animation: none;
    }
}

.btn--lg {
    padding: 1rem 2rem;
    font-size: var(--text-base);
}

.btn__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    font-size: 1.15em;
    line-height: 1;
}

/* --- Cards --- */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: border-color var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent-glow);
    border-radius: var(--radius-md);
    color: var(--accent);
    margin-bottom: var(--space-lg);
}

.card__icon svg {
    width: 24px;
    height: 24px;
}

.card__title {
    margin-bottom: var(--space-sm);
}

.card__text {
    font-size: var(--text-sm);
}

/* --- Stats --- */

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

@media (min-width: 640px) {
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat {
    text-align: center;
    padding: var(--space-lg);
}

.stat__number {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat__label {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* --- Steps --- */

.steps {
    display: grid;
    gap: var(--space-lg);
    counter-reset: step;
}

@media (min-width: 768px) {
    .steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

.step {
    position: relative;
    text-align: center;
    padding: var(--space-lg) var(--space-md);
}

.step::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-md);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--brand-warm);
    border-radius: var(--radius-full);
}

.step__title {
    margin-bottom: var(--space-sm);
}

.step__text {
    font-size: var(--text-sm);
    color: var(--brand-warm);
}

/* --- Image Frame --- */

.image-frame {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.image-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 60%,
        color-mix(in srgb, var(--bg-dark) 40%, transparent) 100%
    );
    pointer-events: none;
}

.image-frame img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* --- Footer --- */

.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    padding-block: var(--space-xl) var(--space-md);
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

@media (min-width: 640px) {
    .site-footer__inner {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: space-between;
        gap: var(--space-lg) var(--space-2xl);
    }
}

.site-footer__nav {
    width: 100%;
}

@media (min-width: 640px) {
    .site-footer__nav {
        width: auto;
    }
}

.site-footer__heading {
    font-family: var(--font-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.site-footer__map {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm) var(--space-lg);
}

@media (min-width: 480px) {
    .site-footer__map {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-sm) var(--space-xl);
    }
}

.site-footer__map a {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
}

.site-footer__map a:hover {
    color: var(--accent);
}

.site-footer__bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.site-footer__copyright {
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: 1.5;
}

.site-footer__legal {
    font-size: var(--text-xs);
    color: var(--text-muted);
    opacity: 0.75;
    line-height: 1.5;
    max-width: 640px;
}
