/* ============================================================
   RESPONSIVE OPTIMIZATION — Multi-Device Support
   Targets: Desktop (1440+), Laptop (1024–1440), iPad (1024),
   Android Tab (600–768), Large Phone (576), Small Phone (<360)

   NOTE: This file ONLY adds missing breakpoints and enhancements.
   Existing breakpoints (480, 768, 992, 1200) are in style.css
   and luxury-addons.css — we do NOT duplicate those rules here.
   ============================================================ */

/* ===== GLOBAL TOUCH & VIEWPORT FIXES ===== */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
}

/* Safe area insets for iPhone notch / dynamic island */
.header, .announcement-bar {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

.footer {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ===== EXTRA LARGE DESKTOP (1440px+) ===== */
@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }

    .hero-text h1 {
        font-size: 56px;
    }

    .deal-grid {
        max-width: 1200px;
        gap: 56px;
    }

    .brand-story-grid {
        gap: 72px;
    }

    .testimonial-layout {
        gap: 40px;
    }
}

/* ===== iPad / Tablet Landscape (1024px) ===== */
/* Fills the gap between existing 992px and 1200px breakpoints */
@media (max-width: 1024px) and (min-width: 993px) {
    .deal-grid {
        gap: 32px;
    }

    .deal-grid .deal-image {
        max-height: 420px;
    }

    .brand-story-image {
        max-height: 400px;
    }

    .promo-card-content h3 {
        font-size: 16px;
    }

    .rooms-grid {
        gap: 16px;
    }
}

/* ===== Android Tablet Portrait (600–768px) ===== */
/* Fills the gap between existing 768px and 480px breakpoints */
@media (min-width: 601px) and (max-width: 768px) {
    /* On Android tablets, categories look better at 3 cols */
    .cat-image-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px;
    }

    /* Keep deal as 2 columns on tablet, not stacked */
    .deal-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 24px;
    }

    .deal-grid .deal-image {
        max-height: 300px;
        aspect-ratio: 3 / 4;
    }

    /* Products 2-col is fine */
    .products-grid,
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    /* Best sellers grid */
    .bs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rooms-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Large Phone (481–576px) ===== */
/* Fills the gap between existing 480px and 640px breakpoints */
@media (min-width: 481px) and (max-width: 576px) {
    .hero-text .btn-primary {
        padding: 10px 22px;
        font-size: 13px;
    }

    .hero-arrow {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* Keep 2-col products at this size */
    .products-grid,
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Countdown boxes slightly smaller */
    .countdown-box {
        min-width: 58px;
        padding: 10px 12px;
    }

    .count-num {
        font-size: 28px;
    }

    .count-label {
        font-size: 10px;
    }

    /* Rooms — 1 column at this phone size */
    .rooms-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .rooms-grid .room-large {
        grid-row: span 1;
    }

    .rooms-grid .room-card:not(.room-large) {
        aspect-ratio: 16 / 9;
    }

    /* Stats slightly smaller */
    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 11px;
    }

    /* Offer cards — 1 column */
    .offer-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Extra Small Phone — iPhone SE, Galaxy A01 (<360px) ===== */
@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }

    .section-padding {
        padding: 32px 0;
    }

    .section-title {
        font-size: 18px;
    }

    .section-subtitle {
        font-size: 10px;
    }

    .hero-slides {
        min-height: 260px;
    }

    .hero-text h1 {
        font-size: 20px;
    }

    .hero-text h2 {
        font-size: 15px;
    }

    .hero-text .btn-primary {
        padding: 8px 18px;
        font-size: 12px;
    }

    /* Categories — tighter */
    .cat-image-grid {
        gap: 6px;
    }

    .cat-img-info {
        padding: 6px 4px;
    }

    .cat-img-info h3 {
        font-size: 10px;
    }

    .cat-img-info i {
        font-size: 14px;
    }

    /* Deal */
    .deal-grid .deal-image {
        max-height: 200px;
    }

    .countdown-box {
        min-width: 44px;
        padding: 6px 8px;
    }

    .count-num {
        font-size: 20px;
    }

    .count-label {
        font-size: 9px;
    }

    /* Products */
    .product-name {
        font-size: 11px;
    }

    .current-price {
        font-size: 14px;
    }

    .product-actions .btn-primary {
        font-size: 10px;
        padding: 6px 10px;
    }

    /* Brand story */
    .brand-story-image {
        max-height: 200px;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    /* Best sellers — single col on tiny screens */
    .bs-hero {
        grid-column: span 1;
    }

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

    /* WhatsApp float — smaller */
    .whatsapp-float {
        width: 48px;
        height: 48px;
        font-size: 20px;
        bottom: 16px;
        right: 12px;
    }

    /* Look tabs horizontal scroll */
    .look-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }

    .look-tabs::-webkit-scrollbar {
        display: none;
    }

    .look-tab-btn, .look-tab {
        padding: 6px 14px;
        font-size: 12px;
        flex-shrink: 0;
    }
}

/* ===== LANDSCAPE MODE FIXES ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slides {
        min-height: 260px;
    }

    .hero-text h1 {
        font-size: 24px;
    }

    .hero-text p {
        display: none;
    }

    /* Keep deal side-by-side in landscape */
    .deal-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px;
    }

    .deal-grid .deal-image {
        max-height: 250px;
        aspect-ratio: 1;
    }

    .section-padding {
        padding: 30px 0;
    }
}

/* ===== TOUCH DEVICE ENHANCEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover-dependent transforms on touch — prevents sticky hover */
    .product-card:hover {
        transform: none;
    }

    .cat-img-card:hover {
        transform: none;
    }

    .room-card:hover img {
        transform: none;
    }

    .deal-grid .deal-image:hover img {
        transform: none;
    }

    .bestseller-card:hover {
        transform: none;
    }

    .offer-card:hover {
        transform: none;
    }

    /* Minimum 44px touch targets (WCAG 2.5.5) */
    .carousel-arrow {
        min-width: 44px;
        min-height: 44px;
    }

    .tab-btn, .filter-chip {
        min-height: 40px;
        padding: 10px 16px;
    }

    .product-actions .btn-primary {
        min-height: 40px;
    }

    .pagination button,
    .pagination a {
        min-width: 44px;
        min-height: 44px;
    }

    /* Smooth momentum scrolling on touch carousels */
    .carousel-scroll,
    .rv-carousel-scroll,
    .look-tabs,
    .section-tabs,
    .mobile-filter-chips {
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .carousel-scroll::-webkit-scrollbar,
    .rv-carousel-scroll::-webkit-scrollbar,
    .look-tabs::-webkit-scrollbar,
    .mobile-filter-chips::-webkit-scrollbar {
        display: none;
    }

    .carousel-scroll > *,
    .rv-carousel-scroll > * {
        scroll-snap-align: start;
    }
}

/* ===== HIGH DPI / RETINA SCREENS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-card,
    .cat-img-card,
    .testimonial-card-wrap,
    .countdown-box {
        border: 0.5px solid rgba(0, 0, 0, 0.06);
    }
}

/* ===== REDUCED MOTION (comprehensive override) ===== */
@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;
    }
}

/* ===== PRINT OPTIMIZATION ===== */
@media print {
    .hero-slider,
    .announcement-bar,
    .whatsapp-float,
    .back-to-top,
    .luxury-preloader,
    .deal-countdown,
    .carousel-arrow,
    .newsletter-section {
        display: none !important;
    }

    .product-card,
    .cat-img-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ===== DEAL OF THE DAY — centered info on mobile ===== */
@media (max-width: 768px) {
    .deal-info {
        text-align: center;
    }

    .deal-countdown {
        justify-content: center;
    }

    .deal-stock-bar {
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
    }

    .deal-info > div:last-child {
        justify-content: center;
    }
}

/* ===== SHOP PAGE — inner page responsive ===== */
@media (max-width: 576px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        display: none;
    }

    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .shop-grid.list-view {
        grid-template-columns: 1fr;
    }

    .shop-grid.list-view .product-card {
        grid-template-columns: 1fr;
    }

    .shop-grid.list-view .product-image {
        height: 180px;
    }

    .shop-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .page-title-section h1 {
        font-size: 24px;
    }
}

@media (max-width: 360px) {
    .shop-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .page-title-section {
        padding: 28px 0;
    }

    .page-title-section h1 {
        font-size: 20px;
    }
}
