/* ===========================
   RESPONSIVE CSS - Gieffe Vending
   Mobile-first responsive design
   =========================== */

/* ===========================
   TABLET LARGE - 1024px
   =========================== */
@media (max-width: 1024px) {
    .container {
        max-width: 960px;
    }
    
    /* Hero Adjustments */
    .hero-visual {
        display: none;
    }
    
    .hero-content {
        max-width: 700px;
        margin: 0 auto;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
    
    /* Features Grid */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* ROI Calculator */
    .roi-calculator-wrapper {
        grid-template-columns: 1fr;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* CTA Section */
    .cta-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .cta-features {
        justify-content: center;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===========================
   TABLET - 768px
   =========================== */
@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 2rem;
        transition: left var(--transition-base);
        box-shadow: var(--shadow-xl);
        z-index: var(--z-modal);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-link {
        font-size: var(--text-lg);
        color: var(--gray-800);
    }
    
    /* Typography */
    .hero-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .hero-subtitle {
        font-size: var(--text-lg);
    }
    
    h2, .section-title {
        font-size: var(--text-3xl);
    }
    
    /* Hero */
    .hero {
        min-height: 80vh;
        padding: 6rem 0 4rem;
    }
    
    .hero-cta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .trust-indicators {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 1 calc(50% - 0.5rem);
        font-size: var(--text-sm);
    }
    
    /* Brands */
    .brands-track {
        gap: 2rem;
    }
    
    /* Forms */
    .form-grid,
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===========================
   MOBILE LARGE - 480px
   =========================== */
@media (max-width: 480px) {
    /* Typography */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: var(--text-base);
    }
    
    h2, .section-title {
        font-size: var(--text-2xl);
    }
    
    h3 {
        font-size: var(--text-xl);
    }
    
    /* Sections */
    .section {
        padding: 3rem 0;
    }
    
    /* Hero */
    .hero-badge {
        margin-bottom: 0.5rem;
    }
    
    .badge-text {
        font-size: var(--text-xs);
        padding: 0.375rem 0.75rem;
    }
    
    /* Trust Indicators */
    .trust-indicators {
        gap: 1rem;
    }
    
    .trust-item {
        flex: 1 1 calc(50% - 0.5rem);
        padding: 0.75rem;
    }
    
    .trust-icon {
        width: 35px;
        height: 35px;
    }
    
    .trust-content strong {
        font-size: var(--text-lg);
    }
    
    .trust-content span {
        font-size: var(--text-xs);
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: var(--text-sm);
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-nav {
        gap: 0.5rem;
    }
    
    .tab-btn {
        flex: 1 1 100%;
        padding: 0.75rem 1rem;
    }
    
    .tab-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* Features Cards */
    .feature-card {
        padding: 2rem;
    }
    
    .feature-icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    /* CTA Features */
    .cta-features {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* ===========================
   MOBILE SMALL - 360px
   =========================== */
@media (max-width: 360px) {
    .container {
        padding: 0 0.75rem;
    }
    
    /* Typography */
    .hero-title {
        font-size: 1.75rem;
    }
    
    /* Section Headers */
    .section-tag {
        font-size: var(--text-xs);
        padding: 0.25rem 0.75rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.625rem 1.25rem;
    }
}

/* ===========================
   LANDSCAPE MOBILE
   =========================== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 4rem 0 3rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .trust-indicators {
        margin-top: 1rem;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* ===========================
   HIGH DPI DISPLAYS
   =========================== */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Optimize images for retina */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===========================
   HOVER STATES - Desktop Only
   =========================== */
@media (hover: hover) and (pointer: fine) {
    /* Add hover animations only on devices with precise pointers */
    .btn {
        position: relative;
        overflow: hidden;
    }
    
    .btn::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }
    
    .btn:hover::after {
        width: 400px;
        height: 400px;
    }
    
    /* Feature cards enhanced hover */
    .feature-card {
        position: relative;
    }
    
    .feature-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
        border-radius: var(--radius-xl);
        opacity: 0;
        transition: opacity var(--transition-base);
        z-index: -1;
    }
    
    .feature-card:hover::before {
        opacity: 0.1;
    }
}

/* ===========================
   TOUCH DEVICES
   =========================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn,
    .nav-link,
    .tab-btn {
        min-height: 44px;
    }
    
    /* Remove hover effects that don't work on touch */
    .feature-card:hover {
        transform: none;
    }
    
    .product-card:hover {
        transform: none;
    }
}

/* ===========================
   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;
    }
    
    .floating-card,
    .hero-particles::before,
    .hero-particles::after {
        animation: none;
    }
    
    .brands-track {
        animation: none;
    }
}

/* ===========================
   DARK MODE SUPPORT
   =========================== */
@media (prefers-color-scheme: dark) {
    :root {
        /* Override color variables for dark mode */
        --white: #0F172A;
        --gray-50: #1E293B;
        --gray-100: #334155;
        --gray-200: #475569;
        --gray-300: #64748B;
        --gray-400: #94A3B8;
        --gray-500: #CBD5E1;
        --gray-600: #E2E8F0;
        --gray-700: #F1F5F9;
        --gray-800: #F8FAFC;
        --gray-900: #FFFFFF;
        
        /* Adjust shadows for dark mode */
        --shadow-sm: 0 1px 2px 0 rgba(255, 255, 255, 0.05);
        --shadow: 0 1px 3px 0 rgba(255, 255, 255, 0.1), 0 1px 2px 0 rgba(255, 255, 255, 0.06);
        --shadow-md: 0 4px 6px -1px rgba(255, 255, 255, 0.1), 0 2px 4px -1px rgba(255, 255, 255, 0.06);
    }
    
    /* Specific dark mode overrides */
    .hero {
        background: linear-gradient(135deg, #0A4E63 0%, #B45309 100%);
    }
    
    .header {
        background: rgba(15, 23, 42, 0.95);
    }
    
    .stats-section {
        background: var(--primary-darker);
    }
    
    .features-section,
    .roi-section {
        background: var(--gray-900);
    }
    
    .feature-card,
    .product-card {
        background: var(--gray-800);
    }
    
    .footer {
        background: #020617;
    }
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
    /* Reset colors for print */
    * {
        color: #000 !important;
        background: #fff !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    /* Hide unnecessary elements */
    .header,
    .hero-cta,
    .scroll-indicator,
    .footer,
    .btn,
    video,
    audio {
        display: none !important;
    }
    
    /* Show URLs */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    /* Expand containers */
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* ===========================
   SPECIFIC DEVICE FIXES
   =========================== */

/* iPhone X and newer (with notch) */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: env(safe-area-inset-top);
    }
    
    .footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* iPad Pro specific */
@media only screen 
    and (min-width: 1024px) 
    and (max-width: 1366px) 
    and (-webkit-min-device-pixel-ratio: 2) {
    .container {
        max-width: 980px;
    }
}

/* Samsung Galaxy Fold */
@media (max-width: 280px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .btn {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}
