/* ===================================================================
   RESPONSIVE FIXES - Smart Displays & Tall Phones
   =================================================================== */

/* Nest Hub / Smart Displays - Landscape orientation */
@media (max-width: 1024px) and (orientation: landscape) and (max-height: 600px) {
    .hero-headline {
        font-size: clamp(36px, 6vw, 56px) !important;
        line-height: 1.05 !important;
        margin-bottom: 16px !important;
    }
    
    .hero-subheadline {
        font-size: 16px !important;
        margin-bottom: 24px !important;
        max-width: 70%;
    }
    
    .hero-content {
        padding-top: 15px !important; /* Much closer to top */
        padding-bottom: 4vh !important;
    }
    
    /* Hide less critical elements to save vertical space */
    .hero-brand-logos {
        display: none !important;
    }
    
    .credibility-row {
        font-size: 0.75rem !important;
        margin-bottom: 16px !important;
    }
    
    .scroll-cta {
        display: none !important; /* Remove on landscape */
    }
    
    /* Smaller badges */
    .app-badge img {
        height: 40px !important;
    }
}

/* Samsung Galaxy A51/71 and other tall phones (20:9 ratio) */
@media (max-width: 480px) and (min-aspect-ratio: 2/1) {
    .hero {
        min-height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .hero-content {
        padding-top: 15px !important; /* Much closer to top */
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    .hero-headline {
        font-size: clamp(42px, 11vw, 52px) !important;
        margin-bottom: 20px !important;
    }
    
    .hero-subheadline {
        margin-bottom: 36px !important;
    }
    
    /* Stack badges vertically if needed */
    .hero-app-badges {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px !important;
        margin-bottom: 24px !important;
    }
    
    /* Compact brand logos */
    .hero-brand-logos {
        gap: 10px 14px !important;
        margin-bottom: 20px !important;
        max-width: 95vw;
    }
    
    .hero-brand-logo {
        height: 16px !important;
    }
    
    /* Move CTA to fixed position at bottom */
    .scroll-cta {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 50;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(10px);
    }
    
    /* Ensure content doesn't get cut off */
    .hero-main {
        padding-bottom: 80px !important; /* Space for fixed CTA */
    }
}

/* Extra small landscape (like Nest Hub in landscape) */
@media (max-height: 480px) and (orientation: landscape) {
    .hero-content {
        padding: 20px !important;
    }
    
    .hero-headline {
        font-size: 32px !important;
        margin-bottom: 12px !important;
    }
    
    .hero-subheadline {
        font-size: 14px !important;
        margin-bottom: 20px !important;
    }
    
    /* Hide everything except essential elements */
    .app-badges-subtext,
    .hero-brand-logos,
    .credibility-row,
    .scroll-cta {
        display: none !important;
    }
}

/* Ensure video doesn't get cut off on wide displays */
@media (min-aspect-ratio: 21/9) {
    .hero-video {
        object-fit: contain;
        background: #000;
    }
}

/* Fix text overlap on ultra-wide displays */
@media (min-aspect-ratio: 16/9) and (max-height: 800px) {
    .hero-text-section {
        max-width: 45vw !important;
        background: linear-gradient(to right, 
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.6) 70%,
            transparent 100%);
        padding: 20px 30px;
        border-radius: 0 12px 12px 0;
    }
}

/* ===================================================================
   TABLET FIXES - Samsung & Other Tablets (Portrait & Landscape)
   =================================================================== */

/* Standard tablets in portrait (iPad, Samsung Tab, etc.) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .hero {
        min-height: 100vh;
        height: 100vh;
    }
    
    .hero-content {
        padding: 8vh 40px !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .hero-main {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100%;
        max-width: 600px;
    }
    
    .hero-text-section {
        align-items: center !important;
        text-align: center !important;
        width: 100%;
    }
    
    .hero-headline {
        font-size: clamp(48px, 8vw, 72px) !important;
        line-height: 1.1 !important;
        margin-bottom: 24px !important;
        text-align: center !important;
    }
    
    .hero-subheadline {
        font-size: clamp(18px, 2.5vw, 22px) !important;
        line-height: 1.5 !important;
        margin-bottom: 40px !important;
        max-width: 85%;
        text-align: center !important;
    }
    
    .hero-app-badges {
        justify-content: center !important;
        gap: 16px !important;
        margin-bottom: 24px !important;
    }
    
    .app-badge img {
        height: 48px !important;
    }
    
    .app-badges-subtext {
        text-align: center !important;
        margin-bottom: 32px !important;
    }
    
    /* Brand logos - make them wrap properly */
    .hero-brand-logos {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 16px 24px !important;
        margin-bottom: 28px !important;
        max-width: 100%;
    }
    
    .hero-brand-logo {
        height: 24px !important;
    }
    
    /* Properly size custom logos */
    .hero-brand-logos img[src="asos-white.png"] {
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
    }
    
    .hero-brand-logos img[src="uniqlo-logo-transparent.png"] {
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
    }
    
    .credibility-row {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 8px 16px !important;
        margin-bottom: 32px !important;
    }
    
    .scroll-cta {
        margin: 0 auto !important;
    }
}

/* Tablets in landscape mode */
@media (min-width: 768px) and (max-width: 1280px) and (orientation: landscape) {
    .hero-content {
        padding: 6vh 60px !important;
    }
    
    .hero-main {
        align-items: center !important;
    }
    
    .hero-headline {
        font-size: clamp(42px, 5vw, 56px) !important;
        line-height: 1.1 !important;
        margin-bottom: 20px !important;
    }
    
    .hero-subheadline {
        font-size: clamp(16px, 1.8vw, 19px) !important;
        margin-bottom: 32px !important;
    }
    
    .hero-app-badges {
        gap: 12px !important;
        margin-bottom: 20px !important;
    }
    
    .app-badge img {
        height: 44px !important;
    }
    
    /* Compact brand logos in landscape */
    .hero-brand-logos {
        gap: 12px 20px !important;
        margin-bottom: 24px !important;
    }
    
    .hero-brand-logo {
        height: 20px !important;
    }
    
    .credibility-row {
        font-size: 0.875rem !important;
        margin-bottom: 24px !important;
    }
}

/* Samsung Galaxy Tab specific (common resolutions) */
@media (width: 800px), (width: 1280px) {
    .hero-content {
        padding: 6vh 5vw !important;
    }
    
    /* Ensure proper centering on Samsung tabs */
    .hero-main {
        margin: 0 auto !important;
        width: 100% !important;
    }
}

/* Fix for tablets with non-standard aspect ratios */
@media (min-width: 600px) and (max-width: 1024px) {
    /* Ensure video covers properly */
    .hero-video {
        object-fit: cover !important;
        object-position: center center !important;
    }
    
    /* Prevent content overflow */
    .hero {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    
    /* Ensure gradient overlay works on all tablets */
    .gradient-overlay {
        position: absolute !important;
        inset: 0 !important;
    }
}

/* Small tablets and large phones in landscape */
@media (min-width: 568px) and (max-width: 812px) and (orientation: landscape) {
    .hero-content {
        padding: 4vh 40px !important;
    }
    
    .hero-headline {
        font-size: 36px !important;
        margin-bottom: 16px !important;
    }
    
    .hero-subheadline {
        font-size: 15px !important;
        margin-bottom: 24px !important;
    }
    
    /* Hide brand logos to save space */
    .hero-brand-logos {
        display: none !important;
    }
    
    .app-badge img {
        height: 40px !important;
    }
    
    .credibility-row {
        font-size: 0.75rem !important;
    }
}

/* Fix for how-works section on tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .how-flow {
        flex-direction: column !important;
        gap: 40px !important;
        align-items: center !important;
    }
    
    .how-step {
        max-width: 400px !important;
        width: 100% !important;
    }
    
    .premium-mockup {
        max-width: 360px !important;
        margin: 0 auto !important;
    }
}

/* Testimonials section tablet fixes */
@media (min-width: 768px) and (max-width: 1024px) {
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        max-width: 600px !important;
        margin: 0 auto !important;
    }
    
    .testimonial-card {
        padding: 32px !important;
    }
}

/* Why Remode section tablet fixes */
@media (min-width: 768px) and (max-width: 1024px) {
    .benefits-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
        max-width: 500px !important;
        margin: 0 auto !important;
    }
    
    .benefit-card {
        padding: 40px !important;
    }
}

/* Footer tablet fixes */
@media (min-width: 768px) and (max-width: 1024px) {
    .footer-content {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 40px !important;
    }
    
    .footer-nav {
        flex-direction: row !important;
        justify-content: center !important;
        gap: 40px !important;
    }
    
    .footer-column {
        text-align: center !important;
    }
}

/* Scanner UI tablet fixes */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Adjust scanner UI positioning for tablets */
    .scanner-ui {
        transform: scale(0.9);
        transform-origin: center;
    }
    
    .scan-frame {
        width: 60% !important;
        height: 45% !important;
    }
    
    .camera-button {
        width: 56px !important;
        height: 56px !important;
        bottom: 15% !important;
    }
    
    .zoom-control {
        bottom: calc(15% + 56px + 55px) !important;
        font-size: 14px !important;
    }
    
    .ui-button {
        width: 36px !important;
        height: 36px !important;
    }
    
    .ui-button svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    .scanner-text {
        font-size: 13px !important;
        padding: 10px 16px !important;
    }
}

/* Ensure proper container width on tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 100% !important;
        padding: 0 40px !important;
    }
    
    section {
        padding: 60px 0 !important;
    }
    
    /* Ensure all content is properly contained */
    body {
        overflow-x: hidden !important;
    }
}