/* ===================== تبلت بزرگ (≤1100px) ===================== */
@media (max-width: 1100px){
    .products-grid{
        grid-template-columns: repeat(2, 1fr);
    }
    .category-grid{
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===================== تبلت (≤900px) ===================== */
@media (max-width: 900px){
    .container{
        width: 94%;
    }
    .hero-wrapper{
        grid-template-columns: 1fr;
    }
    .hero-banners{
        flex-direction: row;
        height: auto;
    }
    .footer-grid{
        grid-template-columns: 1fr 1fr;
    }
    .promo-grid{
        grid-template-columns: 1fr;
    }

    /* صفحاتی که چیدمان دوستونه دارن، تو موبایل زیر هم بیفتن */
    .cart-layout,
    .checkout-layout,
    .contact-wrapper,
    .shop-layout,
    .product-layout{
        grid-template-columns: 1fr;
    }
    .cart-summary,
    .checkout-summary,
    .sidebar{
        position: static;
    }
    .about-content{
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    .about-image{
        order: -1;
    }
    .stats{
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-top: 40px;
    }

    /* فیلترهای products.html به شکل مودال باز/بسته می‌شن */
    .open-filters-btn{
        display: flex;
    }
    .sidebar{
        display: none;
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(15, 23, 42, .5);
        padding: 20px;
        overflow-y: auto;
    }
    .sidebar.open{
        display: block;
    }
    .sidebar .filter-box{
        position: relative;
        max-width: 360px;
        margin: 40px auto;
        max-height: 85vh;
        overflow-y: auto;
    }
    .close-filters-btn{
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 15px;
        left: 15px;
        background: var(--light);
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: 16px;
        cursor: pointer;
    }
}

/* ===================== موبایل بزرگ (≤768px) ===================== */
@media (max-width: 768px){
    .header-main .container{
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
        gap: 12px;
    }
    .logo img{
        max-width: 110px;
    }
    .header-actions{
        gap: 12px;
    }
    .search-box{
        order: 3;
        width: 100%;
        max-width: 100%;
    }
    .search-box input{
        height: 46px;
        padding: 0 15px;
        font-size: 14px;
    }
    .search-box button{
        width: 46px;
        height: 46px;
    }
    .navbar .container{
        overflow-x: auto;
    }
    .navbar ul{
        gap: 20px;
        white-space: nowrap;
    }

    .hero{
        margin-top: 15px;
    }
    .hero-slider{
        min-height: auto;
    }
    .slide{
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    .slide-content{
        width: 100%;
    }
    .slide-content h1{
        font-size: 26px;
        max-width: 100%;
    }
    .slide-image img{
        width: 70%;
    }
    .hero-banners{
        flex-direction: column;
        height: auto;
    }
    .banner img{
        height: 160px;
    }

    /* دسته‌بندی‌ها به‌صورت اسکرول افقی، مثل دیجی‌کالا */
    .categories{
        margin-top: 35px;
    }
    .category-grid{
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 15px;
        padding-bottom: 10px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }
    .category-grid::-webkit-scrollbar{
        height: 4px;
    }
    .category-card{
        flex: 0 0 90px;
        padding: 15px 10px;
        scroll-snap-align: start;
    }
    .category-icon{
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    .category-icon img{
        width: 34px;
    }
    .category-card h3{
        font-size: 13px;
        white-space: nowrap;
    }

    .section-title{
        font-size: 20px;
    }
    .section-header{
        margin-bottom: 18px;
    }

    /* کارت محصولات دو ستونه و جمع‌وجور */
    .products-grid{
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .product-card__image{
        height: 130px;
        padding: 12px;
    }
    .product-card__image img{
        max-width: 100px;
    }
    .product-card__body{
        padding: 12px;
    }
    .product-card__brand{
        font-size: 11px;
        margin-bottom: 4px;
    }
    .product-card__title{
        font-size: 13px;
        height: 40px;
        line-height: 1.5;
    }
    .product-card__rating{
        font-size: 12px;
        margin: 8px 0;
    }
    .product-card__price strong{
        font-size: 15px;
    }
    .product-card__price del{
        font-size: 11px;
    }
    .product-card__button{
        font-size: 12px;
        padding: 8px 5px;
        height: auto;
    }
    .promo-card{
        height: 160px;
    }
    .promo-content h2{
        font-size: 18px;
    }

    .product-gallery,
    .product-info{
        padding: 20px;
    }
    .gallery-thumbs{
        flex-wrap: wrap;
    }
    .gallery-thumbs img{
        width: 60px;
        height: 60px;
    }
    .price-box h2{
        font-size: 26px;
    }

    .cart-item{
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
    }
    .cart-item__content{
        flex-direction: column;
        width: 100%;
        text-align: center;
    }
    .cart-item__actions{
        width: 100%;
        margin-top: 15px;
    }

    /* فوتر جمع‌وجور */
    .footer-grid{
        grid-template-columns: 1fr 1fr;
        gap: 25px 15px;
    }
    .footer-column:first-child{
        grid-column: 1 / -1;
        text-align: center;
    }
    .footer-column:first-child p{
        max-width: 320px;
        margin: 10px auto 0;
        font-size: 13px;
    }
    .footer-column h3{
        font-size: 15px;
        margin-bottom: 10px;
    }
    .footer-column ul li{
        margin-bottom: 8px;
        font-size: 13px;
    }
    .footer-bottom{
        margin-top: 20px;
        padding-top: 15px;
        font-size: 12px;
    }

    .admin-header{
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .admin-product-form{
        grid-template-columns: 1fr;
    }
}

/* ===================== موبایل (≤576px) ===================== */
@media (max-width: 576px){
    .container{
        width: 92%;
    }
    .footer-grid{
        grid-template-columns: 1fr 1fr;
    }
    .promo-card{
        height: 180px;
    }

    .login-box{
        width: 100%;
        padding: 25px;
    }

    .header-actions{
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    .auth-links{
        gap: 12px;
    }

    .checkout-form,
    .checkout-summary{
        padding: 18px;
    }
    .checkout-form input,
    .checkout-form textarea{
        padding: 14px;
        font-size: 16px;
    }
}

/* ===================== موبایل خیلی کوچیک (≤480px) ===================== */
@media (max-width: 480px){
    .hero-btn{
        padding: 14px 30px;
        font-size: 15px;
    }
    .slide-content h1{
        font-size: 22px;
    }
    .product-info h1{
        font-size: 20px;
    }
    .feature-icon{
        font-size: 32px;
    }
    .features-grid{
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-table th,
    .admin-table td{
        font-size: 12px;
        padding: 8px;
    }
}
