/*
 * Mapa de Calibración Financiera - Responsive Styles
 * Mobile-First Approach
 * Breakpoints: 320px (base), 768px (tablet), 1024px (desktop), 1440px (wide)
 */

/* ========================================
   BASE / MOBILE STYLES (320px - 767px)
   ======================================== */

/* Already defined in main styles.css as mobile-first base */

/* Mobile-specific adjustments */
@media (max-width: 767px) {
    :root {
        --fs-xl: 2rem;          /* 32px */
        --fs-lg: 1.75rem;       /* 28px */
        --fs-md: 1.5rem;        /* 24px */
        --fs-base: 1rem;        /* 16px */

        --spacing-lg: 3rem;     /* 48px */
        --spacing-xl: 4rem;     /* 64px */

        --container-padding: 1rem;
    }

    /* Typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    /* Sections */
    .section {
        padding: 3rem 0;
    }

    /* Hero Section */
    .hero {
        min-height: 100svh; /* Use svh for better mobile support */
    }

    .hero__headline {
        font-size: 1.75rem;
    }

    .hero__subheadline {
        font-size: 1rem;
    }

    .hero__guarantee {
        flex-direction: column;
        font-size: 0.875rem;
    }

    /* Buttons */
    .btn {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }

    .btn--large {
        padding: 1rem 1.75rem;
        font-size: 1.125rem;
    }

    .btn--xlarge {
        padding: 1.125rem 2rem;
        font-size: 1.125rem;
    }

    /* Problem Section */
    .problem__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .checkbox-card__content {
        padding: var(--spacing-sm);
    }

    .checkbox-card__text {
        font-size: 0.9375rem;
    }

    .problem__revelation {
        padding: var(--spacing-md);
    }

    .problem__revelation-title {
        font-size: 1.25rem;
    }

    .problem__revelation-text {
        font-size: 1rem;
    }

    /* Benefits Grid */
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .benefit-card {
        padding: var(--spacing-md);
    }

    .benefit-card__icon {
        font-size: 2.5rem;
    }

    .benefit-card__title {
        font-size: 1.25rem;
    }

    /* Pillars */
    .pillar {
        flex-direction: column;
        padding: var(--spacing-md);
    }

    .pillar__number {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    /* Authority Section */
    .authority__content {
        grid-template-columns: 1fr;
    }

    .authority__stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .stat__number {
        font-size: 2.5rem;
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .testimonial-card {
        padding: var(--spacing-md);
    }

    .testimonial-card__image {
        width: 50px;
        height: 50px;
    }

    .testimonial-card__name {
        font-size: 1rem;
    }

    .testimonials__stats {
        grid-template-columns: 1fr;
    }

    .testimonials__stat-number {
        font-size: 2.5rem;
    }

    /* Stack Items */
    .stack-item {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--spacing-sm);
    }

    .stack-item__title {
        font-size: 1rem;
    }

    .stack-item__value {
        font-size: 1.125rem;
        align-self: flex-end;
    }

    /* Pricing */
    .pricing__comparison {
        flex-direction: column;
        padding: var(--spacing-md);
    }

    .pricing__arrow {
        transform: rotate(90deg);
    }

    .pricing__amount {
        font-size: 2.5rem;
    }

    /* Guarantee */
    .guarantee__content {
        flex-direction: column;
        text-align: center;
    }

    .guarantee__badge svg {
        width: 100px;
        height: 100px;
    }

    /* Countdown */
    .countdown {
        flex-wrap: wrap;
    }

    .countdown__item {
        min-width: 90px;
        padding: var(--spacing-sm);
    }

    .countdown__number {
        font-size: 2.5rem;
    }

    .countdown__separator {
        display: none;
    }

    /* FAQ */
    .accordion__header {
        padding: var(--spacing-sm);
    }

    .accordion__title {
        font-size: 1rem;
    }

    .accordion__content p {
        padding: 0 var(--spacing-sm) var(--spacing-sm);
        font-size: 0.9375rem;
    }

    /* Comparison */
    .comparison {
        grid-template-columns: 1fr;
    }

    .comparison__option {
        padding: var(--spacing-md);
    }

    /* Checkout */
    .checkout__content {
        grid-template-columns: 1fr;
    }

    .checkout__summary,
    .checkout__payment {
        padding: var(--spacing-md);
    }

    .order-total__amount {
        font-size: 1.75rem;
    }

    /* Popup */
    .popup__content {
        width: 95%;
        padding: var(--spacing-md);
    }

    .popup__title {
        font-size: 1.5rem;
    }

    .popup__timer {
        font-size: 2rem;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-lg) 0 var(--spacing-md);
    }

    .footer__content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .footer__disclaimer {
        font-size: 0.75rem;
    }

    /* Floating CTA - Always visible on mobile */
    .floating-cta {
        padding: 0.75rem;
    }

    .floating-cta .btn {
        padding: 0.875rem;
        font-size: 0.9375rem;
    }
}

/* ========================================
   SMALL MOBILE (320px - 480px)
   ======================================== */
@media (max-width: 480px) {
    :root {
        --container-padding: 0.75rem;
    }

    /* Extra small adjustments */
    .hero__headline {
        font-size: 1.5rem;
    }

    .section__title {
        font-size: 1.5rem;
    }

    .countdown__item {
        min-width: 80px;
        padding: 0.5rem;
    }

    .countdown__number {
        font-size: 2rem;
    }

    .countdown__label {
        font-size: 0.75rem;
    }

    /* Smaller touch targets but still accessible */
    .btn {
        min-height: 44px; /* Maintain minimum touch target */
    }

    /* Stack smaller on very small screens */
    .pricing__amount {
        font-size: 2rem;
    }

    .testimonials__stat-number {
        font-size: 2rem;
    }

    .stat__number {
        font-size: 2rem;
    }
}

/* ========================================
   TABLET (768px - 1023px)
   ======================================== */
@media (min-width: 768px) {
    :root {
        --container-padding: 1.5rem;
    }

    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }

    /* Hero */
    .hero__headline {
        font-size: 2.5rem;
    }

    .hero__subheadline {
        font-size: 1.25rem;
    }

    /* Problem Grid - 2 columns */
    .problem__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    /* Benefits - 2 columns */
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Pillars - Row layout */
    .pillar {
        flex-direction: row;
    }

    .pillar__number {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    /* Authority Stats - 3 columns */
    .authority__stats {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Testimonials - 2 columns */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Testimonial Stats */
    .testimonials__stats {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Pricing side by side */
    .pricing__comparison {
        flex-direction: row;
    }

    .pricing__arrow {
        transform: rotate(0deg);
    }

    /* Guarantee */
    .guarantee__content {
        flex-direction: row;
        text-align: left;
    }

    /* Countdown */
    .countdown__separator {
        display: block;
    }

    /* Comparison */
    .comparison {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Checkout */
    .checkout__content {
        grid-template-columns: 1fr 1.2fr;
    }

    /* Footer - 2 columns */
    .footer__content {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hide floating CTA on tablet and up */
    .floating-cta {
        display: none;
    }
}

/* ========================================
   DESKTOP (1024px - 1439px)
   ======================================== */
@media (min-width: 1024px) {
    :root {
        --container-padding: 2rem;
        --fs-xl: 3.5rem;
        --fs-lg: 2.5rem;
        --fs-md: 2rem;
    }

    /* Typography */
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    h3 { font-size: 2rem; }

    /* Hero */
    .hero__headline {
        font-size: 3.5rem;
    }

    .hero__subheadline {
        font-size: 1.375rem;
    }

    /* Benefits - 3 columns */
    .benefits-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Testimonials - 3 columns */
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer - 4 columns */
    .footer__content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    /* Hover effects active on desktop */
    .pillar:hover {
        transform: translateX(10px);
    }

    .benefit-card:hover {
        transform: translateY(-5px);
    }

    .testimonial-card:hover {
        transform: translateY(-5px);
    }

    /* Better spacing */
    .section {
        padding: var(--spacing-xl) 0;
    }
}

/* ========================================
   WIDE DESKTOP (1440px+)
   ======================================== */
@media (min-width: 1440px) {
    :root {
        --container-width: 1400px;
    }

    /* Hero - Full glory */
    .hero__headline {
        font-size: 4rem;
    }

    .hero__subheadline {
        font-size: 1.5rem;
    }

    /* More breathing room */
    .section {
        padding: 7rem 0;
    }

    /* Larger stats */
    .stat__number {
        font-size: 3.5rem;
    }

    .testimonials__stat-number {
        font-size: 3.5rem;
    }

    .countdown__number {
        font-size: 5rem;
    }

    /* Larger pricing */
    .pricing__amount {
        font-size: 3.5rem;
    }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */
@media (max-width: 1023px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-xl) 0;
    }

    .hero__headline {
        font-size: 2rem;
    }

    .hero__subheadline {
        font-size: 1rem;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Ensure touch targets are at least 44x44px */
    .btn,
    .accordion__header,
    .checkbox-card {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover {
        transform: none;
    }

    .pillar:hover,
    .benefit-card:hover,
    .testimonial-card:hover {
        transform: none;
    }

    /* Larger tap areas */
    .checkbox-card__check {
        width: 32px;
        height: 32px;
    }

    /* Better spacing for fingers */
    .accordion__item {
        margin-bottom: var(--spacing-md);
    }
}

/* ========================================
   HIGH DPI / RETINA DISPLAYS
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders */
    .checkbox-card__content,
    .form-input,
    .stack-item {
        border-width: 1px;
    }

    /* Better font rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    /* Hide non-essential elements */
    .floating-cta,
    .popup,
    .hero__cta,
    .btn,
    .checkout,
    footer {
        display: none !important;
    }

    /* Optimize for printing */
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .section {
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    /* Remove shadows and backgrounds */
    * {
        box-shadow: none !important;
        background: white !important;
        color: black !important;
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Disable pulse and shake animations */
    .btn--pulse,
    .btn--shake {
        animation: none;
    }
}

/* ========================================
   DARK MODE (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment if you want to support dark mode */
    /*
    :root {
        --color-background: #1A1A1A;
        --color-white: #2A2A2A;
        --color-text: #E0E0E0;
        --color-text-light: #B0B0B0;
    }

    body {
        background-color: var(--color-background);
        color: var(--color-text);
    }
    */
}

/* ========================================
   BROWSER-SPECIFIC FIXES
   ======================================== */

/* iOS Safari - Fix viewport height */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
}

/* Firefox - Smooth scrolling fix */
@-moz-document url-prefix() {
    html {
        scroll-behavior: smooth;
    }
}

/* Edge - Grid gap fallback */
@supports (-ms-ime-align: auto) {
    .benefits-grid,
    .testimonials-grid,
    .problem__grid {
        display: -ms-grid;
        -ms-grid-columns: 1fr 2rem 1fr 2rem 1fr;
    }
}

/* ========================================
   UTILITY RESPONSIVE CLASSES
   ======================================== */

/* Hide on mobile */
.hide-mobile {
    @media (max-width: 767px) {
        display: none !important;
    }
}

/* Hide on tablet */
.hide-tablet {
    @media (min-width: 768px) and (max-width: 1023px) {
        display: none !important;
    }
}

/* Hide on desktop */
.hide-desktop {
    @media (min-width: 1024px) {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none !important;
    @media (max-width: 767px) {
        display: block !important;
    }
}

/* Show only on tablet */
.show-tablet {
    display: none !important;
    @media (min-width: 768px) and (max-width: 1023px) {
        display: block !important;
    }
}

/* Show only on desktop */
.show-desktop {
    display: none !important;
    @media (min-width: 1024px) {
        display: block !important;
    }
}
