/* =============================================
   Qasim Jamil - Responsive Stylesheet
   Mobile-First Breakpoints
   ============================================= */

/* =============================================
   Breakpoints:
   - sm: 576px
   - md: 768px
   - lg: 992px
   - xl: 1200px
   - xxl: 1400px
   ============================================= */

/* =============================================
   Mobile Navigation
   ============================================= */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-white);
    z-index: var(--z-fixed);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-light-gray);
}

.mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.mobile-nav-close svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-text);
}

.mobile-nav-body {
    padding: var(--space-4) 0;
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    border-bottom: 1px solid var(--color-light-gray);
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-dark-gray);
}

.mobile-nav-submenu {
    display: none;
    background-color: var(--color-off-white);
}

.mobile-nav-submenu.active {
    display: block;
}

.mobile-nav-submenu-link {
    display: block;
    padding: var(--space-3) var(--space-8);
    font-size: var(--text-sm);
    color: var(--color-dark-gray);
    border-bottom: 1px solid var(--color-light-gray);
}

.mobile-nav-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--color-light-gray);
}

.mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Mobile Search Overlay */
.search-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--color-white);
    z-index: var(--z-fixed);
    padding: var(--space-4);
    display: none;
}

.search-overlay.active {
    display: block;
}

.search-overlay-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.search-overlay-input {
    flex: 1;
    padding: var(--space-4);
    border: 1px solid var(--color-gray);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
}

.search-overlay-close {
    padding: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-primary);
    font-weight: var(--font-medium);
}

/* =============================================
   Tablet and Below (max-width: 991px)
   ============================================= */
@media (max-width: 991px) {
    /* Header */
    .header-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .search-bar {
        display: none;
    }

    /* Footer */
    .footer-main {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-brand {
        grid-column: span 2;
        padding-right: 0;
        margin-bottom: var(--space-8);
    }

    /* Modal Quick View */
    .modal-quick-view .modal-body {
        grid-template-columns: 1fr;
    }

    /* Trust Badges */
    .trust-badges {
        flex-wrap: wrap;
        gap: var(--space-6);
    }

    .trust-badge {
        flex: 0 0 calc(50% - var(--space-3));
    }
}

/* =============================================
   Mobile Only (max-width: 767px)
   ============================================= */
@media (max-width: 767px) {
    /* Typography */
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }

    /* Container */
    .container {
        padding: 0 var(--space-4);
    }

    /* Sections */
    .section {
        padding: var(--space-10) 0;
    }

    .section-title {
        font-size: var(--text-2xl);
    }

    .section-subtitle {
        font-size: var(--text-base);
        margin-bottom: var(--space-8);
    }

    /* Header */
    .header-main {
        padding: var(--space-3) 0;
    }

    .header-logo {
        font-size: var(--text-xl);
    }

    .header-action-btn {
        width: 36px;
        height: 36px;
    }

    .header-action-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Footer */
    .footer-main {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .footer-brand {
        grid-column: span 1;
    }

    .footer-column {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: var(--space-4);
    }

    .footer-column-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        margin-bottom: 0;
    }

    .footer-column-title::after {
        content: '+';
        font-size: var(--text-xl);
        font-weight: var(--font-light);
    }

    .footer-column.active .footer-column-title::after {
        content: '-';
    }

    .footer-links {
        display: none;
        padding-top: var(--space-4);
    }

    .footer-column.active .footer-links {
        display: flex;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    /* Product Cards - Mobile */
    .product-card-actions {
        opacity: 1;
        transform: translateY(0);
    }

    .product-card-quick-add {
        display: none;
    }

    .product-card-image {
        border-radius: var(--radius-lg);
    }

    .product-card-badges {
        top: var(--space-3);
        left: var(--space-3);
    }

    .product-badge {
        padding: 0.4rem 0.75rem;
        font-size: 0.65rem;
    }

    /* Buttons */
    .btn {
        padding: var(--space-3) var(--space-4);
    }

    .btn-lg {
        padding: var(--space-3) var(--space-6);
    }

    /* Toast */
    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* Modal */
    .modal {
        width: 95%;
        max-height: 85vh;
    }

    .modal-body {
        padding: var(--space-4);
    }

    /* Tabs */
    .tabs-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tabs-trigger {
        white-space: nowrap;
        padding: var(--space-3) var(--space-4);
    }

    /* Quantity Selector */
    .quantity-btn {
        width: 36px;
        height: 36px;
    }

    .quantity-input {
        width: 40px;
        height: 36px;
    }

    /* Size Selector */
    .size-option {
        min-width: 40px;
        height: 40px;
    }

    /* Trust Badges */
    .trust-badge {
        flex: 0 0 100%;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: var(--text-xs);
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Pagination */
    .pagination {
        gap: var(--space-1);
    }

    .pagination-btn {
        width: 36px;
        height: 36px;
    }

    /* Tables */
    .table th,
    .table td {
        padding: var(--space-3);
        font-size: var(--text-sm);
    }
}

/* =============================================
   Small Mobile (max-width: 575px)
   ============================================= */
@media (max-width: 575px) {
    /* Typography */
    h1 { font-size: var(--text-2xl); }
    h2 { font-size: var(--text-xl); }

    /* Header */
    .header-actions {
        gap: var(--space-2);
    }

    .header-action-btn .badge {
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }

    /* Newsletter */
    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-btn {
        width: 100%;
    }

    /* Product Card */
    .product-card-content {
        padding: var(--space-3);
    }

    .product-card-title {
        font-size: var(--text-sm);
    }

    .product-card-price-current {
        font-size: var(--text-base);
    }

    /* Blog Card */
    .blog-card-content {
        padding: var(--space-4);
    }

    .blog-card-title {
        font-size: var(--text-lg);
    }

    /* Collection Card */
    .collection-card-title {
        font-size: var(--text-xl);
    }

    /* Testimonial */
    .testimonial-card {
        padding: var(--space-5);
    }

    .testimonial-text {
        font-size: var(--text-base);
    }
}

/* =============================================
   Desktop Only (min-width: 992px)
   ============================================= */
@media (min-width: 992px) {
    /* Hide mobile elements */
    .mobile-nav,
    .mobile-menu-toggle,
    .search-overlay {
        display: none !important;
    }

    /* Show desktop search */
    .header-search-mobile {
        display: none;
    }
}

/* =============================================
   Large Desktop (min-width: 1200px)
   ============================================= */
@media (min-width: 1200px) {
    /* Increase spacing */
    .section-lg {
        padding: var(--space-24) 0;
    }

    /* Nav spacing */
    .nav-list {
        gap: var(--space-8);
    }
}

/* =============================================
   Product Detail Page (Responsive)
   ============================================= */

/* Product Detail Layout */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* Product title with badge inline */
.product-info .product-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.product-info .product-title-row .product-badge {
    order: 2;
}

.product-info .product-title {
    margin: 0;
    order: 1;
}

.product-gallery-main {
    aspect-ratio: 5/4;
    max-height: 480px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-light-gray);
    margin-bottom: 1rem;
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.product-gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
}

/* Product Info - Compact spacing */
.product-info .product-title {
    font-size: var(--text-2xl);
    margin-bottom: 0.5rem;
}

.product-info .product-description {
    font-size: var(--text-sm);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.product-info .fabric-specs {
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.product-info .product-options {
    margin-bottom: 1rem;
}

.product-info .product-option {
    margin-bottom: 1rem;
}

.product-info .product-option-label {
    font-size: var(--text-sm);
    margin-bottom: 0.5rem;
}

/* Tablet (max-width: 991px) */
@media (max-width: 991px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-gallery-main {
        max-height: 450px;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    .product-detail {
        gap: 1.5rem;
    }

    .product-gallery-main {
        aspect-ratio: 1/1;
        max-height: 350px;
    }

    .product-info .product-title {
        font-size: var(--text-xl);
    }

    .product-info .price {
        margin-bottom: 1rem;
    }

    .product-info .product-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .product-info .product-actions .btn {
        width: 100%;
    }
}

/* Related Products Grid - ensure proper columns */
.related-products-grid {
    grid-template-columns: repeat(4, 1fr) !important;
}

@media (max-width: 991px) {
    .related-products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 767px) {
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* =============================================
   Grid Utilities (Responsive)
   ============================================= */

/* Products Grid - Modern spacing */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (min-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .products-grid {
        gap: 2rem;
    }
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Categories Grid - Modern spacing */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .categories-grid {
        gap: 2rem;
    }
}

/* Collections Grid */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (min-width: 768px) {
    .collections-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-6);
    }
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 576px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =============================================
   Responsive Utilities
   ============================================= */

/* Hide on specific breakpoints */
@media (max-width: 575px) {
    .hide-sm { display: none !important; }
}

@media (max-width: 767px) {
    .hide-md { display: none !important; }
}

@media (max-width: 991px) {
    .hide-lg { display: none !important; }
}

@media (min-width: 576px) {
    .show-sm-only { display: none !important; }
}

@media (min-width: 768px) {
    .show-md-only { display: none !important; }
}

@media (min-width: 992px) {
    .show-lg-only { display: none !important; }
}

/* Text alignment responsive */
@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center;
    }
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
    .header,
    .footer,
    .announcement-bar,
    .mobile-nav,
    .toast-container,
    .modal,
    .modal-backdrop {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}
