/* ============================================
   FORTALEZA Y FRONTERA — Design System
   ============================================ */

/* --- CSS Custom Properties (oklch color space) --- */
:root {
    --ff-primary: oklch(0.55 0.18 35);
    --ff-primary-container: oklch(0.65 0.22 40);
    --ff-on-primary: oklch(1 0 0);
    --ff-secondary: oklch(0.45 0.15 260);
    --ff-secondary-container: oklch(0.55 0.2 260);
    --ff-tertiary: oklch(0.45 0.15 150);
    --ff-tertiary-container: oklch(0.6 0.2 150);
    --ff-surface: oklch(0.98 0.003 265);
    --ff-surface-bright: oklch(0.98 0.003 265);
    --ff-surface-container: oklch(0.95 0.005 265);
    --ff-surface-container-low: oklch(0.96 0.005 265);
    --ff-surface-variant: oklch(0.92 0.01 265);
    --ff-on-surface: oklch(0.2 0.02 265);
    --ff-on-surface-variant: oklch(0.4 0.04 35);
    --ff-outline: oklch(0.6 0.04 35);
    --ff-outline-variant: oklch(0.8 0.03 35);
    --ff-orange-glow: oklch(0.7 0.2 45);
    --ff-blue-glow: oklch(0.6 0.15 260);
    --ff-green-glow: oklch(0.65 0.18 150);
}

/* --- Global Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    overflow-x: hidden;
}

::selection {
    background: var(--ff-primary-container);
    color: var(--ff-on-primary);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--ff-surface-container);
}

::-webkit-scrollbar-thumb {
    background: var(--ff-outline);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ff-primary);
}

/* ============================================
   TEXTURE UTILITIES
   ============================================ */

/* Brushed Metal Texture */
.brushed-metal {
    background-color: #f3f3f6;
    background-image:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(0, 0, 0, 0.02) 50%,
            rgba(255, 255, 255, 0.05) 100%
        ),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.01) 2px,
            rgba(0, 0, 0, 0.01) 4px
        );
}

/* Glassmorphism Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid oklch(90% 0.01 240);
}

/* Dark Glass (for overlays) */
.glass-dark {
    background: rgba(20, 22, 26, 0.7);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   HEADER
   ============================================ */
#main-header,
.header-inner {
    height: 5rem !important; /* Mantener h-20 (80px) constante */
}

.header-scrolled {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(24px) saturate(1.5) !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* ============================================
   MOBILE NAV
   ============================================ */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 101;
    width: min(320px, 85vw);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}

.mobile-nav-panel.active {
    transform: translateX(0);
}

.mobile-nav-panel a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1a1c1e;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    text-decoration: none;
    transition:
        color 0.2s ease,
        padding-left 0.2s ease;
}

.mobile-nav-panel a:hover,
.mobile-nav-panel a.active {
    color: #ff6b00;
    padding-left: 0.5rem;
}

/* Hamburger Button */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    z-index: 102;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1a1c1e;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   HERO BACKGROUND OVERLAY
   ============================================ */
.hero-bg-overlay {
    background:
        radial-gradient(
            ellipse 80% 60% at 70% 40%,
            rgba(255, 107, 0, 0.06),
            transparent
        ),
        radial-gradient(
            ellipse 60% 50% at 20% 80%,
            rgba(0, 76, 203, 0.04),
            transparent
        );
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition:
        opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition:
        opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition:
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay helpers */
.delay-100 {
    transition-delay: 0.1s;
}
.delay-200 {
    transition-delay: 0.2s;
}
.delay-300 {
    transition-delay: 0.3s;
}
.delay-400 {
    transition-delay: 0.4s;
}
.delay-500 {
    transition-delay: 0.5s;
}

/* ============================================
   ANIMATED PROGRESS BARS
   ============================================ */
.progress-bar-fill {
    width: 0%;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   STAT COUNTER
   ============================================ */
.stat-counter {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   SERVICE CARD HOVER
   ============================================ */
.service-card {
    transition:
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.04);
}

.service-card .service-icon {
    transition:
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.35s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.15) rotate(-5deg);
    color: #ff6b00;
}

/* ============================================
   MACHINE CARD
   ============================================ */
.machine-card {
    transition:
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.machine-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.04);
}

/* ============================================
   WHATSAPP FLOATING BUTTON
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 90;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 16px rgba(37, 211, 102, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    text-decoration: none;
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s ease;
    animation: whatsapp-pulse 2.5s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow:
        0 6px 24px rgba(37, 211, 102, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
    fill: white;
}

@keyframes whatsapp-pulse {
    0%,
    100% {
        box-shadow:
            0 4px 16px rgba(37, 211, 102, 0.4),
            0 2px 8px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow:
            0 4px 16px rgba(37, 211, 102, 0.4),
            0 2px 8px rgba(0, 0, 0, 0.15),
            0 0 0 8px rgba(37, 211, 102, 0.15);
    }
}

/* ============================================
   CONTACT FORM
   ============================================ */
.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--ff-outline);
    border-radius: 0 !important;
    background: var(--ff-surface-container-lowest);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.875rem;
    color: var(--ff-on-surface);
    transition: all 0.2s ease;
    outline: none;
    box-shadow: none;
}

.form-input:focus {
    border-color: var(--ff-primary-container);
    background: var(--ff-surface-bright);
    box-shadow: 2px 2px 0px 0px var(--ff-primary-container);
}

.form-input::placeholder {
    color: var(--ff-outline);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238e7164' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ============================================
   TECHNICAL SPECS & TEXTURES
   ============================================ */
.diagnostic-bar-container {
    width: 100%;
    height: 12px;
    background-color: var(--ff-surface-variant);
    display: flex;
    border: 1px solid var(--ff-outline-variant);
}

.diagnostic-bar-fill {
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        currentColor,
        currentColor 4px,
        transparent 4px,
        transparent 6px
    );
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-dot-matrix {
    background-image: radial-gradient(rgba(142, 113, 100, 0.25) 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: var(--ff-surface-container);
}

/* ============================================
   GRADIENT DECORATIVE LINES
   ============================================ */
.gradient-line-orange {
    height: 3px;
    background: linear-gradient(90deg, #ff6b00, #ff9a56, transparent);
    border: none;
}

.gradient-line-blue {
    height: 3px;
    background: linear-gradient(90deg, #004ccb, #0262ff, transparent);
    border: none;
}

.gradient-line-green {
    height: 3px;
    background: linear-gradient(90deg, #006e2a, #00b149, transparent);
    border: none;
}

/* ============================================
   SECTION DIVIDER
   ============================================ */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #8e7164;
    padding: 0.375rem 0.75rem;
    border: 1px solid #e2bfb0;
    border-radius: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero-model-bg {
        font-size: 30vw !important;
        right: -10% !important;
        top: 5% !important;
    }

    .whatsapp-float {
        width: 52px;
        height: 52px;
        bottom: 1rem;
        right: 1rem;
    }

    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }

    /* Section vertical spacing */
    .py-margin {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    /* Stat counters */
    .stat-counter {
        font-size: 1.875rem;
    }

    /* Machine catalog card headings */
    #view-grid h3 {
        font-size: 1.875rem;
        line-height: 1;
    }

    /* Section heading scale */
    .text-h2-model {
        font-size: 1.75rem;
        line-height: 1.25;
    }

    /* Service cards inner padding */
    .service-card {
        padding: 1.5rem;
    }
}

/* ============================================
   NEW HERO & GALLERY ANIMATIONS
   ============================================ */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bg-dot-matrix {
    background-image: radial-gradient(#d4d4d8 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ============================================
   CAROUSEL
   ============================================ */
#carousel-track {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

#carousel-track::-webkit-scrollbar {
    display: none;
}

#carousel-track > div {
    flex-shrink: 0;
    scroll-snap-align: start;
    height: 420px;
}

/* Mobile Carousel Widths */
@media (max-width: 767px) {
    #carousel-track > div {
        width: 85vw;
    }
}

@media (min-width: 640px) and (max-width: 767px) {
    #carousel-track > div {
        width: calc(50% - 10px);
    }
}

/* Desktop Grid Widths */
@media (min-width: 768px) {
    #carousel-track > div {
        width: 100% !important; /* El grid de Tailwind controla el ancho */
        height: 460px;
    }
}

.carousel-dot {
    cursor: pointer;
    transition:
        width 0.3s ease,
        background-color 0.3s ease;
}
