/**
 * Mukto Mona - Responsive Stylesheet
 *
 * Theme: Mukto Mona (Cutly BD)
 * Version: 1.0.0
 * Text Domain: mukto-mona
 *
 * Breakpoints:
 * - Tablet: max-width 991px
 * - Mobile: max-width 767px
 * - Small Mobile: max-width 479px
 */

/* ===== TABLET (max-width: 991px) ===== */
@media (max-width: 991px) {
    .main-navigation {
        display: none;
    }

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

    .order-now-btn {
        display: none;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-gallery {
        flex-direction: column;
    }

    .hero-thumbnails {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
    }

    .hero-thumbnail {
        flex-shrink: 0;
        width: 60px;
        height: 60px;
    }

    .trust-badges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

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

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

    .quick-view-inner {
        grid-template-columns: 1fr;
    }

    .qv-top {
        grid-template-columns: 1fr;
    }

    .qv-tab-btn {
        padding: 12px 14px;
        font-size: 13px;
    }

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

    .reviews-summary-card {
        position: static;
    }

    /* Shop Modal Responsive */
    .shop-modal-container {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    .shop-sidebar {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        border-right: none;
        border-bottom: 1px solid var(--mm-border);
        padding: 18px 16px 14px;
        padding-right: 72px; /* keep clear of close button */
        background: #fff;
        position: relative;
        z-index: 50;
    }

    .shop-sidebar-section {
        position: static;
        margin-bottom: 0;
        border-bottom: none;
        min-width: 0;
    }

    .sidebar-title.mobile-toggle {
        padding: 10px 6px;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 4px;
        cursor: pointer;
        background: var(--mm-bg-light);
        border: 1px solid var(--mm-border);
        border-radius: 8px;
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
        line-height: 1.2;
        min-height: 40px;
        text-align: center;
    }

    .sidebar-title.mobile-toggle span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-content {
        display: none;
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        width: 100%;
        background: #fff;
        padding: 16px;
        box-shadow: 0 15px 30px rgba(0,0,0,0.15);
        border: 1px solid var(--mm-border);
        border-radius: 12px;
        z-index: 100;
        max-height: 50vh;
        overflow-y: auto;
    }

    .shop-modal.shop-filter-open .shop-main-content {
        filter: blur(5px);
        pointer-events: none;
        transition: filter 0.3s ease;
    }

    .shop-sidebar-section:nth-child(2) .sidebar-content,
    .shop-sidebar-section:nth-child(3) .sidebar-content {
        left: 0;
        transform: none;
    }

    .shop-category-list {
        display: block;
    }

    .shop-category-list li {
        white-space: normal;
    }

    .shop-header {
        padding: 20px 16px;
    }

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

    .shop-grid .product-card {
        border-radius: 16px;
    }

    .shop-grid .product-card-image {
        aspect-ratio: 1;
        height: auto;
        min-height: 150px;
        padding: 0 !important;
        background: var(--mm-bg-light);
    }

    .shop-grid .product-card-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 10px;
        display: block;
    }

    .shop-grid .product-card-info {
        padding: 14px;
    }

    .shop-grid .product-card-title {
        font-size: 13px;
        min-height: 38px;
    }

    .shop-grid .product-card-price {
        font-size: 15px;
        margin-bottom: 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* ===== MOBILE (max-width: 767px) ===== */
@media (max-width: 767px) {
    .container {
        padding: 0 15px;
    }

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

    .hero-info h1 {
        font-size: 22px;
    }

    .hero-price {
        font-size: 20px;
    }

    form.cart {
        flex-direction: column;
        align-items: stretch;
    }

    form.cart button.single_add_to_cart_button {
        width: 100%;
    }

    .hero-trust {
        flex-direction: column;
        gap: 10px;
    }

    .variations tr {
        flex-direction: column;
        align-items: flex-start;
    }

    .variations select {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .checkout-box {
        padding: 20px;
        border-radius: 16px;
    }

    .checkout-fields {
        grid-template-columns: 1fr;
    }

    .cross-sells-section,
    .checkout-section,
    .return-section,
    .reviews-section {
        padding: 40px 0;
    }

    .review-form-wrapper {
        padding: 20px;
    }

    .review-form .form-row {
        grid-template-columns: 1fr;
    }

    .muktomona-modal-body {
        padding: 16px 16px 0;
    }

    .shop-main-content {
        overflow: visible;
    }

    .qv-top {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mm-details-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .back-to-top,
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-float {
        bottom: 75px;
    }

    .muktomona-toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
        max-width: none;
    }

    .return-form {
        padding: 20px;
    }
}

/* ===== SMALL MOBILE (max-width: 479px) ===== */
@media (max-width: 479px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card-info {
        padding: 10px;
    }

    .product-card-title {
        font-size: 12px;
        min-height: 32px;
    }

    .trust-badges-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .hero-thumbnail {
        width: 52px;
        height: 52px;
    }

    .shop-sidebar {
        max-height: 220px;
    }
}

/* ===== PWA / APP-LIKE ===== */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

@supports (padding: env(safe-area-inset-bottom)) {
    .back-to-top {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .whatsapp-float {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

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