/* ============================================
   TRENDARYO - COMPREHENSIVE RESPONSIVE FRAMEWORK
   Perfect fit for all screen sizes - NO horizontal scrolling
   ============================================ */

/* ============================================
   MOBILE-FIRST BASE STYLES
   ============================================ */

/* Prevent horizontal scrolling globally */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Responsive images and media */
img, video, iframe, embed, object {
    max-width: 100% !important;
    height: auto !important;
}

/* Touch-friendly tap targets */
button, a, input, select, textarea {
    min-height: 44px !important;
    min-width: 44px !important;
}

/* ============================================
   ULTRA SMALL PHONES (240px - 320px)
   ============================================ */
@media (max-width: 320px) {
    /* Reduce heavy elements for performance */
    #three-canvas {
        opacity: 0.5 !important;
    }
    
    /* Typography scaling */
    body {
        font-size: 13px !important;
    }
    
    .store-logo {
        font-size: 1rem !important;
    }
    
    .hero-title-3d {
        font-size: 1.3rem !important;
    }
    
    .section-title {
        font-size: 1.2rem !important;
    }
    
    /* Header adjustments */
    .store-header-inner {
        padding: 0.5rem 0.75rem !important;
        gap: 0.5rem !important;
    }
    
    .store-brand {
        min-width: auto !important;
    }
    
    .store-icon-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }
    
    /* Hide secondary actions */
    .store-actions a[aria-label="Compare"],
    .store-actions a[aria-label="Wishlist"] {
        display: none !important;
    }
    
    /* Navigation */
    .store-nav-list {
        font-size: 0.8rem !important;
    }
    
    .store-nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.7rem !important;
    }
    
    /* Welcome banner */
    .welcome-banner {
        top: 100px !important;
        padding: 0.75rem 1rem !important;
    }
    
    .welcome-text {
        font-size: 0.7rem !important;
    }
    
    .page-offset {
        padding-top: 150px !important;
    }
    
    /* Hero section */
    .hero-section-3d {
        padding: 2rem 0.75rem 1.5rem !important;
    }
    
    .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .hero-left {
        text-align: center !important;
    }
    
    .hero-cta-3d {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.75rem !important;
    }
    
    .btn-3d {
        width: 100% !important;
        max-width: 200px !important;
        padding: 0.8rem 1rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Cards grid */
    .cards-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .card {
        padding: 1rem !important;
    }
    
    .card-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }
    
    .card-title {
        font-size: 0.9rem !important;
    }
    
    .card-sub {
        font-size: 0.8rem !important;
    }
    
    /* Product grid */
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .product {
        border-radius: 12px !important;
    }
    
    .product-media {
        height: 120px !important;
        padding: 0.75rem !important;
    }
    
    .product-badge {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    .product-price {
        font-size: 0.9rem !important;
    }
    
    .product-body {
        padding: 0.75rem !important;
    }
    
    .product-name {
        font-size: 0.85rem !important;
    }
    
    .product-desc {
        font-size: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .product-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .product-actions .btn-3d {
        font-size: 0.75rem !important;
        padding: 0.6rem 1rem !important;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .testimonial-card {
        padding: 1.5rem !important;
    }
    
    /* Features */
    .features-grid-3d {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .feature-card-3d {
        padding: 1.5rem !important;
    }
    
    .feature-icon-3d {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.5rem !important;
    }
    
    .feature-title-3d {
        font-size: 1.1rem !important;
    }
    
    .feature-text-3d {
        font-size: 0.85rem !important;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 1rem 1rem !important;
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Section spacing */
    .section-pad {
        padding: 2rem 0.75rem !important;
    }
    
    .section-wrap {
        padding: 0 0.5rem !important;
    }
}

/* ============================================
   SMALL PHONES (321px - 480px)
   ============================================ */
@media (min-width: 321px) and (max-width: 480px) {
    /* Reduce 3D canvas opacity for performance */
    #three-canvas {
        opacity: 0.6 !important;
    }
    
    body {
        font-size: 14px !important;
    }
    
    /* Header */
    .store-header-inner {
        padding: 0.6rem 1rem !important;
    }
    
    .store-logo {
        font-size: 1.2rem !important;
    }
    
    .store-icon-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
    }
    
    /* Navigation */
    .store-nav-link {
        font-size: 0.75rem !important;
        padding: 0.6rem 0.8rem !important;
    }
    
    /* Welcome banner */
    .welcome-banner {
        top: 110px !important;
        padding: 0.875rem 1.25rem !important;
    }
    
    .welcome-text {
        font-size: 0.85rem !important;
    }
    
    .page-offset {
        padding-top: 170px !important;
    }
    
    /* Hero section */
    .hero-section-3d {
        padding: 2.5rem 1rem 2rem !important;
    }
    
    .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .hero-left {
        text-align: center !important;
    }
    
    .hero-title-3d {
        font-size: 1.8rem !important;
    }
    
    .hero-subtitle-3d {
        font-size: 1rem !important;
    }
    
    .hero-cta-3d {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .btn-3d {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.85rem !important;
    }
    
    /* Cards */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.875rem !important;
    }
    
    .card {
        padding: 1.125rem !important;
    }
    
    .card-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
    }
    
    .card-title {
        font-size: 0.95rem !important;
    }
    
    .card-sub {
        font-size: 0.85rem !important;
    }
    
    /* Products */
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 0.875rem !important;
    }
    
    .product-media {
        height: 140px !important;
        padding: 0.875rem !important;
    }
    
    .product-badge {
        font-size: 0.7rem !important;
    }
    
    .product-price {
        font-size: 1rem !important;
    }
    
    .product-name {
        font-size: 0.9rem !important;
    }
    
    .product-desc {
        font-size: 0.8rem !important;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    
    .testimonial-card {
        padding: 1.75rem !important;
    }
    
    /* Features */
    .features-grid-3d {
        grid-template-columns: 1fr !important;
        gap: 1.75rem !important;
    }
    
    .feature-card-3d {
        padding: 2rem !important;
    }
    
    .feature-icon-3d {
        width: 70px !important;
        height: 70px !important;
        font-size: 1.75rem !important;
    }
    
    .feature-title-3d {
        font-size: 1.25rem !important;
    }
    
    .feature-text-3d {
        font-size: 0.9rem !important;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.75rem !important;
    }
    
    /* Sections */
    .section-pad {
        padding: 2.5rem 1rem !important;
    }
}

/* ============================================
   MEDIUM PHONES (481px - 600px)
   ============================================ */
@media (min-width: 481px) and (max-width: 600px) {
    #three-canvas {
        opacity: 0.7 !important;
    }
    
    /* Header */
    .store-header-inner {
        padding: 0.7rem 1.25rem !important;
    }
    
    .store-logo {
        font-size: 1.3rem !important;
    }
    
    .store-icon-btn {
        width: 38px !important;
        height: 38px !important;
    }
    
    /* Navigation */
    .store-nav-link {
        font-size: 0.78rem !important;
    }
    
    /* Welcome banner */
    .welcome-banner {
        top: 115px !important;
    }
    
    .welcome-text {
        font-size: 0.9rem !important;
    }
    
    .page-offset {
        padding-top: 175px !important;
    }
    
    /* Hero */
    .hero-section-3d {
        padding: 3rem 1.25rem 2.5rem !important;
    }
    
    .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 2.25rem !important;
    }
    
    .hero-title-3d {
        font-size: 2.2rem !important;
    }
    
    .hero-subtitle-3d {
        font-size: 1.1rem !important;
    }
    
    .hero-cta-3d {
        flex-direction: row !important;
        justify-content: center !important;
    }
    
    /* Cards */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Products */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .product-media {
        height: 150px !important;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Features */
    .features-grid-3d {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
    
    .section-pad {
        padding: 3rem 1.25rem !important;
    }
}

/* ============================================
   LARGE PHONES / SMALL TABLETS (601px - 768px)
   ============================================ */
@media (min-width: 601px) and (max-width: 768px) {
    #three-canvas {
        opacity: 0.8 !important;
    }
    
    /* Show search bar */
    .store-search {
        display: flex !important;
        min-width: 180px !important;
    }
    
    /* Header */
    .store-header-inner {
        padding: 0.8rem 1.5rem !important;
    }
    
    .store-logo {
        font-size: 1.4rem !important;
    }
    
    .store-icon-btn {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Navigation */
    .store-nav-link {
        font-size: 0.8rem !important;
        padding: 0.65rem 0.9rem !important;
    }
    
    /* Welcome banner */
    .welcome-banner {
        top: 120px !important;
    }
    
    .welcome-text {
        font-size: 0.95rem !important;
    }
    
    .page-offset {
        padding-top: 180px !important;
    }
    
    /* Hero */
    .hero-section-3d {
        padding: 3.5rem 1.5rem 3rem !important;
    }
    
    .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }
    
    .hero-title-3d {
        font-size: 2.6rem !important;
    }
    
    .hero-subtitle-3d {
        font-size: 1.15rem !important;
    }
    
    .hero-cta-3d {
        justify-content: center !important;
    }
    
    /* Cards */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.125rem !important;
    }
    
    /* Products */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.125rem !important;
    }
    
    .product-media {
        height: 155px !important;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.625rem !important;
    }
    
    /* Features */
    .features-grid-3d {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2.25rem !important;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2.25rem !important;
    }
    
    .section-pad {
        padding: 3.5rem 1.5rem !important;
    }
}

/* ============================================
   TABLETS (769px - 900px)
   ============================================ */
@media (min-width: 769px) and (max-width: 900px) {
    /* Full 3D canvas */
    #three-canvas {
        opacity: 0.9 !important;
    }
    
    /* Desktop navigation */
    .store-search {
        display: flex !important;
        min-width: 220px !important;
    }
    
    .store-nav {
        display: block !important;
    }
    
    .store-nav-list {
        flex-direction: row !important;
        justify-content: center !important;
    }
    
    .store-mobile-toggle {
        display: none !important;
    }
    
    /* Header */
    .store-header-inner {
        padding: 0.9rem 1.75rem !important;
    }
    
    .store-logo {
        font-size: 1.5rem !important;
    }
    
    /* Welcome banner */
    .welcome-banner {
        top: 130px !important;
    }
    
    .welcome-text {
        font-size: 1rem !important;
    }
    
    .page-offset {
        padding-top: 190px !important;
    }
    
    /* Hero */
    .hero-section-3d {
        padding: 4rem 1.75rem 3.5rem !important;
    }
    
    .hero-grid {
        grid-template-columns: 1.2fr 0.8fr !important;
        gap: 2.75rem !important;
    }
    
    .hero-left {
        text-align: left !important;
    }
    
    .hero-title-3d {
        font-size: 3rem !important;
    }
    
    .hero-subtitle-3d {
        font-size: 1.2rem !important;
    }
    
    .hero-cta-3d {
        justify-content: flex-start !important;
    }
    
    /* Cards */
    .cards-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    /* Products */
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    .product-media {
        height: 160px !important;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.75rem !important;
    }
    
    /* Features */
    .features-grid-3d {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2.5rem !important;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 2.5rem !important;
    }
    
    .section-pad {
        padding: 4rem 1.75rem !important;
    }
}

/* ============================================
   LARGE TABLETS / SMALL LAPTOPS (901px - 1024px)
   ============================================ */
@media (min-width: 901px) and (max-width: 1024px) {
    /* Full 3D canvas */
    #three-canvas {
        opacity: 1 !important;
    }
    
    /* Desktop navigation fully restored */
    .store-nav {
        display: block !important;
    }
    
    .store-nav-list {
        flex-direction: row !important;
    }
    
    .store-mobile-toggle {
        display: none !important;
    }
    
    /* Header */
    .store-header-inner {
        padding: 1rem 2rem !important;
    }
    
    .store-logo {
        font-size: 1.55rem !important;
    }
    
    /* Welcome banner */
    .welcome-banner {
        top: 135px !important;
    }
    
    .page-offset {
        padding-top: 195px !important;
    }
    
    /* Hero */
    .hero-section-3d {
        padding: 4.5rem 2rem 4rem !important;
    }
    
    .hero-grid {
        grid-template-columns: 1.2fr 0.8fr !important;
        gap: 3rem !important;
    }
    
    .hero-title-3d {
        font-size: 3.2rem !important;
    }
    
    .hero-subtitle-3d {
        font-size: 1.25rem !important;
    }
    
    /* Cards */
    .cards-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1.375rem !important;
    }
    
    /* Products */
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.375rem !important;
    }
    
    .product-media {
        height: 165px !important;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.875rem !important;
    }
    
    /* Features */
    .features-grid-3d {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2.75rem !important;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 2.75rem !important;
    }
    
    .section-pad {
        padding: 4.5rem 2rem !important;
    }
}

/* ============================================
   DESKTOP (1025px - 1200px)
   ============================================ */
@media (min-width: 1025px) and (max-width: 1200px) {
    /* Full desktop experience */
    .store-header-inner {
        padding: 1rem 2.25rem !important;
    }
    
    .store-logo {
        font-size: 1.6rem !important;
    }
    
    .welcome-banner {
        top: 140px !important;
    }
    
    .page-offset {
        padding-top: 200px !important;
    }
    
    .hero-section-3d {
        padding: 5rem 2.25rem 4.5rem !important;
    }
    
    .hero-grid {
        gap: 3.25rem !important;
    }
    
    .hero-title-3d {
        font-size: 3.4rem !important;
    }
    
    .cards-grid {
        gap: 1.5rem !important;
    }
    
    .product-grid {
        gap: 1.5rem !important;
    }
    
    .product-media {
        height: 170px !important;
    }
    
    .testimonials-grid {
        gap: 2rem !important;
    }
    
    .features-grid-3d {
        gap: 3rem !important;
    }
    
    .footer-grid {
        gap: 3rem !important;
    }
    
    .section-pad {
        padding: 5rem 2.25rem !important;
    }
}

/* ============================================
   LARGE DESKTOP (1201px - 1440px)
   ============================================ */
@media (min-width: 1201px) and (max-width: 1440px) {
    .container,
    .section-wrap {
        max-width: 1200px !important;
        margin: 0 auto !important;
    }
    
    .store-header-inner {
        padding: 1rem 2.5rem !important;
    }
    
    .welcome-banner {
        top: 140px !important;
    }
    
    .page-offset {
        padding-top: 210px !important;
    }
    
    .hero-section-3d {
        padding: 5.5rem 2.5rem 5rem !important;
    }
    
    .hero-grid {
        gap: 3.5rem !important;
    }
    
    .hero-title-3d {
        font-size: 3.6rem !important;
    }
    
    .section-pad {
        padding: 5.5rem 2.5rem !important;
    }
}

/* ============================================
   ULTRA WIDE (1441px+)
   ============================================ */
@media (min-width: 1441px) {
    .container,
    .section-wrap {
        max-width: 1400px !important;
        margin: 0 auto !important;
    }
    
    .store-header-inner {
        padding: 1rem 3rem !important;
    }
    
    .hero-section-3d {
        padding: 6rem 3rem 5.5rem !important;
    }
    
    .hero-grid {
        gap: 4rem !important;
    }
    
    .hero-title-3d {
        font-size: 3.8rem !important;
    }
    
    .section-pad {
        padding: 6rem 3rem !important;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION FIXES
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .welcome-banner {
        top: 80px !important;
        padding: 0.5rem 1rem !important;
    }
    
    .welcome-text {
        font-size: 0.8rem !important;
    }
    
    .page-offset {
        padding-top: 120px !important;
    }
    
    .hero-section-3d {
        padding: 2rem 1.5rem 1.5rem !important;
    }
    
    .hero-title-3d {
        font-size: 2rem !important;
    }
    
    .hero-subtitle-3d {
        font-size: 0.9rem !important;
        margin-bottom: 1rem !important;
    }
    
    .section-pad {
        padding: 2rem 1.5rem !important;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects */
    .card:hover,
    .product:hover,
    .store-icon-btn:hover,
    .btn-3d:hover,
    .feature-card-3d:hover {
        transform: none !important;
    }
    
    /* Simplify animations */
    .card,
    .product,
    .feature-card-3d {
        transition: none !important;
    }
    
    /* Larger touch targets */
    .store-icon-btn,
    .btn-3d,
    .card,
    .product {
        min-height: 48px !important;
    }
}

/* ============================================
   HIGH DPI / RETINA DISPLAYS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisper text rendering */
    body {
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
}

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

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark theme */
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    #three-canvas,
    .store-header,
    .store-nav,
    .welcome-banner,
    .preloader-3d,
    .hero-cta-3d,
    .product-actions {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt !important;
    }
    
    .page-offset {
        padding-top: 0 !important;
    }
    
    .section-pad {
        padding: 1rem !important;
    }
    
    .card,
    .product,
    .feature-card-3d,
    .testimonial-card {
        break-inside: avoid !important;
        border: 1px solid #ccc !important;
        margin-bottom: 1rem !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hide-mobile {
    display: none !important;
}

@media (min-width: 769px) {
    .hide-mobile {
        display: block !important;
    }
    
    .hide-desktop {
        display: none !important;
    }
}

.text-center-mobile {
    text-align: center !important;
}

@media (min-width: 769px) {
    .text-center-mobile {
        text-align: left !important;
    }
}

.full-width-mobile {
    width: 100% !important;
    max-width: 100% !important;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
@media (max-width: 768px) {
    /* Reduce blur effects for performance */
    .store-header,
    .welcome-banner,
    .card,
    .product,
    .feature-card-3d {
        backdrop-filter: blur(5px) !important;
        -webkit-backdrop-filter: blur(5px) !important;
    }
    
    /* Disable complex animations */
    .hero-title-3d,
    .welcome-text,
    .feature-icon-3d {
        animation: none !important;
    }
}

/* ============================================
   ERROR PREVENTION
   ============================================ */
/* Ensure no content exceeds viewport width */
* {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden !important;
    position: relative !important;
}

/* Safe area support for notched devices */
.safe-area {
    padding-left: env(safe-area-inset-left) !important;
    padding-right: env(safe-area-inset-right) !important;
}
