/* 
LuxeThreads - Responsive Stylesheet
Mobile-first responsive design for all devices
*/

/* ===== Extra Small Devices (phones, less than 576px) ===== */
@media (max-width: 575.98px) {
    /* Typography */
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
    
    .display-4 {
        font-size: 2.5rem !important;
    }
    
    .display-5 {
        font-size: 2rem !important;
    }
    
    /* Navigation */
    .navbar-brand .brand-name {
        font-size: 1.25rem;
    }
    
    .mega-menu .container {
        padding: 0 15px;
    }
    
    .mega-menu .row {
        margin: 0;
    }
    
    .mega-menu .col-md-3 {
        margin-bottom: 1.5rem;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 3rem 0 !important;
    }
    
    .hero-content {
        padding-right: 0;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero-content .lead {
        font-size: 1rem;
    }
    
    /* Product Cards */
    .product-card {
        margin-bottom: 1.5rem;
    }
    
    .product-image img {
        height: 250px;
    }
    
    .product-actions {
        opacity: 1;
        transform: translateX(0);
    }
    
    /* Trust Badges */
    .trust-badges .col-6 {
        margin-bottom: 1.5rem;
    }
    
    /* Footer */
    footer .col-md-4,
    footer .col-md-2 {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    footer .social-icons {
        justify-content: center;
    }
    
    .payment-methods {
        justify-content: center;
    }
    
    /* Shop Page */
    .shop-header {
        text-align: center;
    }
    
    .shop-header .breadcrumb {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .size-filter .size-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    /* Product Details */
    .product-title {
        font-size: 1.5rem !important;
    }
    
    .thumbnail-images .thumb-item {
        width: 60px;
        height: 60px;
    }
    
    .color-selector .color-option {
        width: 35px;
        height: 35px;
        margin-right: 1rem !important;
    }
    
    .color-selector .color-option .color-label {
        font-size: 0.7rem;
        bottom: -20px;
    }
    
    /* Cart Page */
    .cart-table {
        display: block;
        overflow-x: auto;
    }
    
    .cart-product {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-product img {
        margin-bottom: 1rem;
    }
    
    /* Checkout Page */
    .checkout-steps::before {
        display: none;
    }
    
    .step {
        margin-bottom: 1.5rem;
    }
    
    /* Account Page */
    .account-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 2rem;
        margin-bottom: 2rem;
    }
    
    /* Blog */
    .blog-image {
        height: 200px;
    }
    
    /* 404 Page */
    .error-content {
        padding: 2rem 1rem;
    }
    
    .error-content h1 {
        font-size: 4rem !important;
    }
    
    .error-content h2 {
        font-size: 1.5rem;
    }
    
    .error-content .btn {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* ===== Small Devices (phones, 576px and up) ===== */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Navigation */
    .navbar-brand .brand-name {
        font-size: 1.3rem;
    }
    
    /* Hero Section */
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    /* Product Cards */
    .product-image img {
        height: 280px;
    }
    
    /* Shop Page */
    .size-filter .size-btn {
        width: 42px;
        height: 42px;
    }
    
    /* Product Details */
    .thumbnail-images .thumb-item {
        width: 70px;
        height: 70px;
    }
    
    /* 404 Page */
    .error-content h1 {
        font-size: 5rem;
    }
}

/* ===== Medium Devices (tablets, 768px and up) ===== */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Navigation */
    .navbar-nav .nav-item {
        margin: 0 0.25rem;
    }
    
    /* Hero Section */
    .hero-content h1 {
        font-size: 3rem;
    }
    
    /* Mega Menu */
    .mega-menu .col-md-3 {
        margin-bottom: 1rem;
    }
    
    /* Product Cards */
    .product-image img {
        height: 250px;
    }
    
    /* Shop Page */
    .size-filter .size-btn {
        width: 40px;
        height: 40px;
    }
    
    /* Account Page */
    .account-sidebar {
        padding-right: 1.5rem;
    }
}

/* ===== Large Devices (desktops, 992px and up) ===== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Product Cards */
    .product-image img {
        height: 280px;
    }
    
    /* Shop Page */
    .size-filter .size-btn {
        width: 42px;
        height: 42px;
    }
}

/* ===== Extra Large Devices (large desktops, 1200px and up) ===== */
@media (min-width: 1200px) {
    /* Container adjustments */
    .container {
        max-width: 1200px;
    }
    
    /* Hero Section */
    .hero-content h1 {
        font-size: 3.5rem;
    }
}

/* ===== Tablet Landscape ===== */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .hero-section {
        padding: 4rem 0;
    }
    
    .product-image img {
        height: 220px;
    }
}

/* ===== Mobile Landscape ===== */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .product-image img {
        height: 200px;
    }
}

/* ===== High DPI Screens ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure images are high-res */
    .hero-image img,
    .product-image img,
    .blog-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== Print Styles ===== */
@media print {
    /* Hide unnecessary elements */
    .navbar,
    .footer,
    .newsletter,
    .product-actions,
    .add-to-cart-btn,
    .btn,
    .social-icons,
    .payment-methods {
        display: none !important;
    }
    
    /* Improve readability for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    /* Ensure links are visible */
    a {
        color: #000;
        text-decoration: underline;
    }
    
    /* Add URL after links */
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    /* Page breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .product-card,
    .blog-card {
        page-break-inside: avoid;
    }
}

/* ===== 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;
        scroll-behavior: auto !important;
    }
    
    .product-card:hover,
    .blog-card:hover,
    .testimonial-card:hover {
        transform: none !important;
    }
    
    .img-zoom-on-hover:hover,
    .product-card:hover .product-image img,
    .blog-card:hover .blog-image img {
        transform: none !important;
    }
}

/* ===== Accessibility: High Contrast ===== */
@media (prefers-contrast: high) {
    :root {
        --primary-dark: #000;
        --accent-color: #000;
        --border-color: #000;
    }
    
    .btn-outline-dark {
        border-width: 2px;
    }
    
    .nav-link.active::after,
    .section-title::after {
        height: 3px;
    }
}

/* ===== Accessibility: Dark Mode ===== */
@media (prefers-color-scheme: dark) {
    /* These styles would be overridden by the template's dark mode toggle if implemented */
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    .bg-white,
    .card,
    .modal-content {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }
    
    .text-dark {
        color: #e0e0e0 !important;
    }
    
    .text-muted {
        color: #b0b0b0 !important;
    }
    
    .border,
    .border-bottom,
    .border-top {
        border-color: #333 !important;
    }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    /* Improve touch targets */
    .btn,
    .nav-link,
    .action-btn,
    .size-btn,
    .color-option {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects that don't work on touch */
    .product-actions {
        opacity: 1;
        transform: translateX(0);
    }
    
    /* Increase spacing for touch */
    .product-card,
    .blog-card {
        margin-bottom: 1.5rem;
    }
    
    /* Better scrolling on mobile */
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== Foldable Devices ===== */
@media (max-width: 350px) {
    /* Adjust for very small screens */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .product-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ===== Very Large Screens ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* ===== Fix for iOS Safari ===== */
@supports (-webkit-touch-callout: none) {
    .hero-section,
    .banner-card {
        background-attachment: scroll;
    }
    
    .sticky-top {
        position: -webkit-sticky;
    }
}

/* ===== Fix for Chrome on Android ===== */
@media (-webkit-device-pixel-ratio: 1.5) {
    .hero-image img,
    .product-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ===== Responsive Typography ===== */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 14px;
    }
}

/* ===== Responsive Spacing ===== */
.section-padding-responsive {
    padding: 3rem 0;
}

@media (min-width: 768px) {
    .section-padding-responsive {
        padding: 5rem 0;
    }
}

/* ===== Grid Adjustments ===== */
.row.gap-3 {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.row.gap-3 > [class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* ===== Modal Responsive Fixes ===== */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
}

/* ===== Form Responsive Fixes ===== */
@media (max-width: 767.98px) {
    .form-row > .col,
    .form-row > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    .input-group {
        flex-wrap: wrap;
    }
    
    .input-group .form-control {
        width: 100%;
        border-radius: 0.375rem !important;
        margin-bottom: 0.5rem;
    }
    
    .input-group .btn {
        border-radius: 0.375rem !important;
        width: 100%;
    }
}

/* ===== Carousel Responsive Fixes ===== */
@media (max-width: 767.98px) {
    .carousel-item img {
        height: 300px;
        object-fit: cover;
    }
    
    .carousel-caption {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .carousel-caption h5 {
        font-size: 1.25rem;
    }
}

/* ===== Table Responsive Fixes ===== */
.table-responsive {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* ===== Accordion Responsive Fixes ===== */
@media (max-width: 767.98px) {
    .accordion-button {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .accordion-body {
        padding: 1rem;
    }
}

/* ===== Footer Responsive Fixes ===== */
@media (max-width: 767.98px) {
    footer {
        text-align: center;
    }
    
    footer .row > div {
        margin-bottom: 2rem;
    }
    
    footer .row > div:last-child {
        margin-bottom: 0;
    }
    
    footer .list-unstyled li {
        margin-bottom: 0.5rem;
    }
}

/* ===== Utility Classes for Responsive ===== */
.responsive-text-center {
    text-align: center;
}

@media (min-width: 768px) {
    .responsive-text-center-md {
        text-align: center !important;
    }
    
    .responsive-text-left-md {
        text-align: left !important;
    }
    
    .responsive-text-right-md {
        text-align: right !important;
    }
}

.responsive-mt-3 {
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .responsive-mt-3-md {
        margin-top: 1rem !important;
    }
}

.responsive-d-none {
    display: none;
}

@media (min-width: 768px) {
    .responsive-d-block-md {
        display: block !important;
    }
}

/* ===== Image Aspect Ratio Fixes ===== */
.img-ratio-1-1 {
    aspect-ratio: 1/1;
    object-fit: cover;
}

.img-ratio-16-9 {
    aspect-ratio: 16/9;
    object-fit: cover;
}

.img-ratio-4-3 {
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* ===== Loading State Responsive ===== */
@media (max-width: 767.98px) {
    .loading-spinner {
        width: 30px;
        height: 30px;
    }
}

/* ===== Animation Responsive Adjustments ===== */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}