/* ============================================
   Customer Order Form — Dark Themed Banner
   ============================================
   Modern dark banner with animated status tracker.
   Features Bolivian flag colors in progression.

   Structure:
   - Banner container & dark theme
   - Left column: Content, stats, features, CTA
   - Right column: Animated status timeline
   - Confetti celebration animations
   - Responsive behavior
   ============================================ */

/* ========================================
   CSS Variables (Dark Theme)
   ======================================== */

.bim-banner-section {
    /* Dark backgrounds */
    --banner-bg-dark: var(--bim-dark);
    --banner-bg-darker: #2a2a2a;

    /* Bolivian flag colors */
    --banner-red: var(--bim-bolivia-red);           /* Top stripe - Step 1 */
    --banner-yellow: var(--bim-bolivia-yellow);      /* Middle stripe - Steps 2-3 */
    --banner-green: var(--bim-bolivia-green);        /* Bottom stripe - Step 4 */
    --banner-green-bright: var(--bim-bolivia-green-bright);
    --banner-yellow-dark: var(--bim-bolivia-yellow-dark);

    /* Text colors */
    --banner-text-white: rgba(255, 255, 255, 1);
    --banner-text-muted: rgba(255, 255, 255, 0.6);

    /* Particle colors for confetti */
    --particle-red: var(--bim-bolivia-red);
    --particle-yellow: var(--bim-bolivia-yellow);
    --particle-green: var(--bim-bolivia-green);
}

/* ========================================
   Banner Container & Grid Pattern
   ======================================== */

.bim-banner-section {
    position: relative;
    width: 100%;
    min-height: 600px;
    background: linear-gradient(135deg, var(--banner-bg-dark) 0%, var(--banner-bg-darker) 100%);
    padding: 4rem 0;
    overflow: hidden;
}

/* Grid pattern overlay on section */
.bim-banner-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

/* Red radial glow at bottom-left of section */
.bim-banner-section::after {
    content: '';
    position: absolute;
    bottom: -200px;
    left: -150px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(227, 30, 36, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Main grid layout */
.bim-banner-grid {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   Left Column — Content
   ======================================== */

.bim-banner-left {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 2rem 0;
    position: relative;
}

/* Experience Badge */
.bim-banner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1.125rem;
    background: rgba(227, 30, 36, 0.15);
    border: 1px solid rgba(227, 30, 36, 0.3);
    border-radius: 100px;
    width: fit-content;
    opacity: 0;
}

.bim-badge-pulse {
    width: 8px;
    height: 8px;
    background: var(--banner-red);
    border-radius: 50%;
    animation: bimBadgePulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes bimBadgePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(227, 30, 36, 0.7);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
        box-shadow: 0 0 0 8px rgba(227, 30, 36, 0);
    }
}

.bim-badge-text {
    font-family: var(--bim-font);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--banner-red);
}

/* Main Headline */
.bim-banner-section h1.bim-banner-headline {
    font-family: var(--bim-font);
    font-size: var(--bim-text-hero);
    font-weight: 900;
    font-style: italic;
    line-height: 1.05;
    color: var(--banner-text-white);
    margin: 0;
    letter-spacing: -0.025em;
    text-transform: uppercase;
    opacity: 0;
}

.bim-headline-accent {
    color: var(--banner-red);
}

/* Subtitle */
.bim-banner-subtitle {
    font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
    font-weight: 400;
    line-height: 1.7;
    color: var(--banner-text-muted);
    margin: 0;
    max-width: 520px;
    opacity: 0;
}

/* "Totalmente gratis" inline highlight tag inside subtitle */
.bim-banner-section .bim-banner-subtitle .bim-gratis-tag {
    display: inline-block;
    background: rgba(0, 122, 61, 0.22);
    border: 1px solid rgba(0, 122, 61, 0.45);
    color: var(--banner-green-bright);
    font-weight: 700;
    font-size: 0.875em;
    padding: 0.1em 0.6em;
    border-radius: 100px;
    vertical-align: baseline;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* Features List */
.bim-banner-features {
    display: flex;
    flex-direction: column;
    gap: var(--bim-space-3);
    opacity: 0;
}

.bim-feature-item {
    display: flex;
    align-items: center;
    gap: var(--bim-space-3);
    font-size: var(--bim-text-base);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.bim-feature-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(227, 30, 36, 0.2);
    border: 1px solid rgba(227, 30, 36, 0.4);
    border-radius: 50%;
    flex-shrink: 0;
}

.bim-feature-text {
    font-size: var(--bim-text-base);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* Guarantee Badge */
.bim-banner-guarantee {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.125rem;
    background: rgba(252, 209, 22, 0.05);
    border: 1px solid rgba(252, 209, 22, 0.18);
    border-left: 3px solid var(--banner-yellow);
    border-radius: 0.625rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: all var(--bim-transition-slow) ease;
}

.bim-banner-guarantee:hover {
    background: rgba(252, 209, 22, 0.09);
    border-color: rgba(252, 209, 22, 0.32);
    border-left-color: var(--banner-yellow);
    transform: translateX(4px);
}

.bim-guarantee-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(252, 209, 22, 0.12);
    border: 1px solid rgba(252, 209, 22, 0.28);
    border-radius: var(--bim-radius-sm);
    color: var(--banner-yellow);
    flex-shrink: 0;
}

.bim-guarantee-text .bim-guarantee-label {
    display: block;
    font-size: var(--bim-text-base);
    font-weight: 700;
    color: var(--banner-yellow);
    margin-bottom: 0.125rem;
    line-height: 1.3;
}

.bim-guarantee-text .bim-guarantee-desc {
    font-size: var(--bim-text-sm);
    font-weight: 500;
    color: var(--banner-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* CTA Button Wrapper */
.bim-banner-cta {
    margin-top: var(--bim-space-1);
    opacity: 0;
}

/* .bim-btn-cta base styles live in components/buttons.css */

/* ========================================
   Right Column — Status Tracker
   ======================================== */

.bim-banner-right {
    background: var(--banner-bg-darker);
    display: flex;
    flex-direction: column;
    gap: var(--bim-space-6);
    padding: 2rem 2.5rem;
    position: relative;
    overflow: hidden;
}

/* Finer grid pattern for right column */
.bim-banner-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 0;
    pointer-events: none;
}

/* Tracker Header */
.bim-tracker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    position: relative;
    z-index: 1;
}

.bim-tracker-title {
    font-family: var(--bim-font);
    font-size: 0.8125rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 2.5px;
}

.bim-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--banner-green-bright);
    text-transform: uppercase;
}

.bim-live-dot {
    width: 8px;
    height: 8px;
    background: var(--banner-green-bright);
    border-radius: 50%;
    animation: bimLivePulse 1.5s ease-in-out infinite;
}

@keyframes bimLivePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.4);
    }
}

/* ========================================
   Status Timeline
   ======================================== */

.bim-status-timeline {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.625rem 0;
    z-index: 1;
}

/* Timeline vertical line (gray background) */
/* top/bottom are set dynamically by JS to align with dot centers */
.bim-timeline-line {
    position: absolute;
    left: 28px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 0;
}

/* Timeline progress line (Bolivian flag gradient) */
/* top is set dynamically by JS; height animated by GSAP (no CSS transition) */
.bim-timeline-progress {
    position: absolute;
    left: 28px;
    top: 0;
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, var(--banner-red) 0%, var(--banner-yellow) 33%, var(--banner-yellow) 66%, var(--banner-green) 100%);
    box-shadow: 0 0 10px rgba(227, 30, 36, 0.3);
    z-index: 1;
}

/* Status Step */
.bim-status-step {
    position: relative;
    display: block;
    padding-left: 68px;
    opacity: 0;
}

/* Step Dot — plain circle, colored via state classes */
.bim-step-dot {
    position: absolute;
    left: 20px;
    top: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
    z-index: 2;
}

/* Step Content */
.bim-step-content {
    padding-top: 2px;
}

.bim-step-title {
    font-family: var(--bim-font);
    font-size: var(--bim-text-xl);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: -0.3px;
    transition: color var(--bim-transition-slow) ease;
}

.bim-step-description {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    transition: color var(--bim-transition-slow) ease;
}

/* Step Time Badge — hidden by default, revealed when active */
.bim-step-time {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--bim-transition-slow) ease, transform var(--bim-transition-slow) ease;
}

/* Active step shows time badge */
.bim-status-step.active .bim-step-time {
    opacity: 1;
    transform: scale(1);
}

/* Completed step hides time badge — line has already passed through */
.bim-status-step.completed .bim-step-time {
    opacity: 0;
    transform: scale(0.8);
}

/* ========================================
   Status Step States (Bolivian Flag Colors)
   ======================================== */

/* --- Active state titles & descriptions --- */
.bim-status-step.active .bim-step-title {
    color: var(--banner-text-white);
}
.bim-status-step.active .bim-step-description {
    color: rgba(255, 255, 255, 0.6);
}

/* --- Completed state titles --- */
.bim-status-step.completed .bim-step-title {
    color: rgba(255, 255, 255, 0.7);
}
.bim-status-step.completed .bim-step-description {
    color: rgba(255, 255, 255, 0.4);
}

/* Step RED — Bolivian flag top stripe (Step 1) */
.bim-step--red.active .bim-step-dot,
.bim-step--red.completed .bim-step-dot {
    background: rgba(227, 30, 36, 0.2);
    border-color: var(--banner-red);
    box-shadow: 0 0 0 6px rgba(227, 30, 36, 0.15);
}

.bim-step--red.completed .bim-step-dot {
    background: rgba(227, 30, 36, 0.3);
}

.bim-step--red .bim-step-time {
    background: rgba(227, 30, 36, 0.15);
    border: 1px solid rgba(227, 30, 36, 0.3);
    color: var(--banner-red);
}

/* Step YELLOW — Bolivian flag middle stripe (Steps 2 & 3) */
.bim-step--yellow.active .bim-step-dot,
.bim-step--yellow.completed .bim-step-dot {
    background: rgba(252, 209, 22, 0.25);
    border-color: var(--banner-yellow);
    box-shadow: 0 0 0 6px rgba(252, 209, 22, 0.15);
}

.bim-step--yellow.completed .bim-step-dot {
    background: rgba(252, 209, 22, 0.35);
}

.bim-step--yellow .bim-step-time {
    background: rgba(252, 209, 22, 0.15);
    border: 1px solid rgba(252, 209, 22, 0.4);
    color: var(--banner-yellow-dark);
}

/* Step GREEN — Bolivian flag bottom stripe (Step 4) */
.bim-step--green.active .bim-step-dot,
.bim-step--green.completed .bim-step-dot {
    background: rgba(0, 122, 61, 0.25);
    border-color: var(--banner-green);
    box-shadow: 0 0 0 6px rgba(0, 122, 61, 0.15);
}

.bim-step--green.completed .bim-step-dot {
    background: rgba(0, 122, 61, 0.35);
    box-shadow: 0 0 0 8px rgba(0, 122, 61, 0.2);
}

.bim-step--green .bim-step-time {
    background: rgba(0, 122, 61, 0.15);
    border: 1px solid rgba(0, 122, 61, 0.4);
    color: var(--banner-green-bright);
}

/* ========================================
   Current Order Card
   ======================================== */

.bim-current-order {
    position: relative;
    z-index: 1;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--bim-radius);
    margin-top: var(--bim-space-2);
    opacity: 0;
    transition: all var(--bim-transition-slow) ease;
    overflow: visible;
}

.bim-current-order:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Order Header Row */
.bim-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--bim-space-4);
}

.bim-order-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.bim-order-badge {
    background: rgba(0, 122, 61, 0.2);
    border: 1px solid rgba(0, 122, 61, 0.4);
    color: var(--banner-green-bright);
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

/* Gloss sweep element for badge */
.bim-order-badge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
}

/* Product Row */
.bim-order-product {
    display: flex;
    align-items: center;
    gap: var(--bim-space-4);
}

.bim-product-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(227, 30, 36, 0.15);
    border: 1px solid rgba(227, 30, 36, 0.3);
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--banner-red);
    transition: all var(--bim-transition-slow) ease;
}

.bim-product-info {
    flex: 1;
}

.bim-product-name {
    font-size: var(--bim-text-base);
    font-weight: 700;
    color: var(--banner-text-white);
    margin-bottom: var(--bim-space-1);
    transition: all var(--bim-transition-slow) ease;
}

.bim-product-detail {
    font-size: var(--bim-text-sm);
    color: rgba(255, 255, 255, 0.4);
    transition: all var(--bim-transition-slow) ease;
}

/* ========================================
   Celebration Animations
   ======================================== */

/* Card celebrate state */
.bim-current-order.celebrate {
    animation: bimCardCelebrate 1s ease-out forwards;
}

@keyframes bimCardCelebrate {
    0% {
        transform: scale(1) translateY(0);
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(0, 122, 61, 0);
    }
    10% { transform: scale(1.02) translateY(-3px); }
    20% {
        transform: scale(1.06) translateY(-6px);
        box-shadow: 0 8px 25px rgba(0, 122, 61, 0.2);
    }
    40% {
        transform: scale(1.04) translateY(-4px);
        background: rgba(0, 122, 61, 0.18);
        border-color: rgba(0, 122, 61, 0.5);
        box-shadow: 0 10px 40px rgba(0, 122, 61, 0.35);
    }
    60% { transform: scale(1.05) translateY(-5px); }
    80% { transform: scale(1.02) translateY(-2px); }
    100% {
        transform: scale(1) translateY(0);
        background: rgba(0, 122, 61, 0.1);
        border-color: rgba(0, 122, 61, 0.3);
        box-shadow: 0 5px 25px rgba(0, 122, 61, 0.25);
    }
}

/* Product icon celebration — rotates and switches to green */
.bim-current-order.celebrate .bim-product-icon {
    animation: bimIconCelebrate 0.8s ease-out;
    background: rgba(0, 122, 61, 0.2);
    border-color: rgba(0, 122, 61, 0.4);
    color: var(--banner-green-bright);
}

@keyframes bimIconCelebrate {
    0%   { transform: scale(1) rotate(0deg); }
    15%  { transform: scale(1.3) rotate(-15deg); }
    30%  { transform: scale(0.9) rotate(15deg); }
    45%  { transform: scale(1.2) rotate(-10deg); }
    60%  { transform: scale(0.95) rotate(10deg); }
    75%  { transform: scale(1.1) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Product name text glow */
.bim-current-order.celebrate .bim-product-name {
    animation: bimTextGlow 0.8s ease-out;
}

@keyframes bimTextGlow {
    0%, 100% {
        color: #ffffff;
        text-shadow: 0 0 0 rgba(0, 122, 61, 0);
    }
    50% {
        color: #00FF7F;
        text-shadow: 0 0 10px rgba(0, 122, 61, 0.6);
    }
}

/* Product detail text brighten */
.bim-current-order.celebrate .bim-product-detail {
    animation: bimTextBrighten 0.8s ease-out;
}

@keyframes bimTextBrighten {
    0%, 100% { color: rgba(255, 255, 255, 0.4); }
    50%       { color: rgba(0, 255, 127, 0.8); }
}

/* Order badge shine */
.bim-current-order.celebrate .bim-order-badge {
    animation: bimBadgeShine 0.8s ease-out;
}

@keyframes bimBadgeShine {
    0%   { box-shadow: 0 0 0 rgba(0, 122, 61, 0.4); transform: scale(1); }
    50%  { box-shadow: 0 0 20px rgba(0, 122, 61, 0.8); transform: scale(1.1); }
    100% { box-shadow: 0 0 0 rgba(0, 122, 61, 0.4); transform: scale(1); }
}

/* Order badge gloss sweep */
.bim-current-order.celebrate .bim-order-badge::after {
    animation: bimBadgeGloss 0.6s ease-out 0.2s;
}

@keyframes bimBadgeGloss {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Confetti particles (Bolivian flag colors) */
.bim-particle-burst {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
}

.bim-particle-red    { background: var(--particle-red); }
.bim-particle-yellow { background: var(--particle-yellow); }
.bim-particle-green  { background: var(--particle-green); }

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
    .bim-banner-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .bim-banner-section {
        min-height: auto;
        padding: 3rem 0 0;
    }

    .bim-banner-left {
        padding: 1rem 2rem 2rem;
    }

    .bim-banner-right {
        padding: 2rem;
        min-height: 500px;
    }

    .bim-banner-section h1.bim-banner-headline {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    /* Features in 2-col grid to reduce vertical height */
    .bim-banner-features {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--bim-space-2) var(--bim-space-4);
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .bim-banner-section {
        padding: 2rem 0 0;
    }

    .bim-banner-left {
        padding: 1rem 1.25rem 2rem;
        gap: 1.25rem;
    }

    .bim-banner-right {
        padding: 1.5rem 1.25rem;
        min-height: auto;
    }

    .bim-banner-section h1.bim-banner-headline {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }

    .bim-banner-subtitle {
        font-size: 0.875rem;
    }

    .bim-feature-item {
        font-size: 0.8125rem;
    }

    .bim-feature-check {
        width: 18px;
        height: 18px;
    }

    .bim-banner-guarantee {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .bim-guarantee-icon {
        width: 34px;
        height: 34px;
    }

    .bim-guarantee-text strong {
        font-size: 0.8125rem;
    }

    .bim-guarantee-text p {
        font-size: 0.6875rem;
    }

    .bim-btn-cta {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: var(--bim-text-base);
    }

    .bim-tracker-title {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }

    .bim-live-indicator {
        font-size: 0.625rem;
    }

    .bim-status-timeline {
        padding: 0.5rem 0;
    }

    .bim-step-title {
        font-size: 1.0625rem;
    }

    .bim-step-description {
        font-size: 0.75rem;
    }

    .bim-current-order {
        padding: 1rem;
    }

    .bim-product-name {
        font-size: 0.8125rem;
    }

    .bim-product-detail {
        font-size: 0.6875rem;
    }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
    .bim-banner-left {
        padding: 1rem 1rem 2rem;
    }

    .bim-banner-right {
        padding: 1.25rem 1rem;
    }

}
