/* ======================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE DEVICES)
   ====================================================== */

/* Large Tablets & Small Laptops (Max-width: 1100px) */
@media (max-width: 1100px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .why-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .offer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

/* Tablets & Mobile Navigation (Max-width: 991px) */
@media (max-width: 991px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .about-content {
        text-align: center;
    }
}

/* Mobile Devices (Max-width: 768px) */
@media (max-width: 768px) {
    body.menu-open,
    body.cart-open {
        overflow: hidden;
    }
    body {
        padding-top: 70px;
    }

    .section {
        padding: 70px 0;
    }

    .section-title {
        margin-bottom: 45px;
    }

    .logo span {
        display: none;
    }

    .header {
        padding: 12px 0;
    }

    .header-btn {
        width: 42px;
        height: 42px;
    }

    /* Hero Responsive Adjustments */
    .hero {
        height: 65vh;
        min-height: 480px;
    }

    .hero-slide img{
        object-position: center;
        object-fit: cover;
        background: #F4DBD8;
    }

    .hero-content {
        right: 5%;
        left: 5%;
        width: 90%;
        max-width: 100%;
        text-align: center;
        transform: translateY(-50%);
    }

    .hero-content h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .hero-content p {
        font-size: 0.95rem;
        line-height: 1.8;
        margin-bottom: 25px;
    }

    .hero-btn {
        padding: 14px 30px;
        font-size: 0.95rem;
    }

    .slider-btn {
        width: 44px;
        height: 44px;
    }

    .prev { right: 15px; }
    .next { left: 15px; }

    /* Single Column Layouts */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        width: 100%;
    }

    .why-grid,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* Category Cards - کدهای خودتون */
    .categories-card{
        padding: 12px;
        border-radius: 20px;
        width: 100%;
    }

    .categories-card img{
        height: 120px;
        width: 100%;
        object-fit: cover;
    }

    .categories-card h3,
    .product-card h3{
        font-size: 16px;
        margin: 10px 0;
    }

    .categories-card p,
    .product-card p{
        font-size: 14px;
        line-height: 1.5;
    }

    .categories-card a,
    .categories-card button,
    .product-card a,
    .product-card button{
        font-size: 13px;
    }

    .category-image {
        height: 250px;
    }

    .product-image {
        height: 240px;
    }

    .product-content {
        padding: 10px;
    }

    .product-footer {
        flex-direction:column;
        align-items: flex-start;
        gap: 18px;
    }

    .details-btn {
        width: 100%;
        justify-content: center;
    }

    .about-home {
        padding-top: 70px;
    }

    .offer-content {
        padding: 40px 20px;
    }

    .offer-code {
        padding: 25px 18px;
    }

    .newsletter-box {
        padding: 40px 20px;
    }

    .newsletter-box h2 {
        font-size: 2rem;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }

    .footer {
        padding: 60px 0 25px;
    }

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

    .socials {
        justify-content: center;
    }

    /* ====== MOBILE MENU (کدهای خودتون) ====== */
    .mobile-btn{
        display: flex !important;
        width: 50px;
        height: 50px;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 10001;
    }

    .mobile-btn i {
        display: none;
    }

    .mobile-btn::before {
        content: "☰";
        font-size: 1.55rem;
        line-height: 1;
        font-family: Arial, sans-serif;
    }
       
    .navbar{
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        background: var(--bg-color);
        backdrop-filter: blur(20px);
        padding: 100px 35px;
        border-radius: 0 35px 35px 0;
        box-shadow: 20px 0 50px rgba(0,0,0,.15);
        transition: .45s ease;
        z-index: 9999;
    }

    .navbar.active{
        left: 0;
    }

    .navbar ul{
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 28px;
    }

    .navbar a{
        font-size: 1.15rem;
        color: var(--heading);
        transition: .3s;
    }

    .navbar a:hover{
        color: var(--primary);
        transform: translateX(8px);
    }

    /* لایه تار پشت منو */
    .menu-overlay{
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        opacity: 0;
        visibility: hidden;
        transition: .35s;
        z-index: 998;
    }

    .menu-overlay.active{
        opacity: 1;
        visibility: visible;
    }

    .mobile-btn[aria-expanded="true"]::before {
        content: "×";
        font-size: 2rem;
    }

    /* ====== MINI CART - اضافه شده برای رفع مشکل ====== */
    .mini-cart {
        right: -100% !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }

    .mini-cart.active {
        right: 0 !important;
    }

    /* ====== CART PAGE - کدهای خودتون ====== */
    .cart-hero {
        padding: 90px 20px 45px;
        text-align: center;
    }

    .cart-hero h1 {
        font-size: 2.2rem;
    }

    .cart-hero p {
        font-size: 0.9rem;
    }

    .cart-page {
        padding: 35px 15px 60px;
    }

    .cart-layout {
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    .cart-items-section {
        width: 100%;
    }

    .cart-section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 15px;
    }

    .cart-section-header h2 {
        font-size: 1.25rem;
    }

    .cart-item-count {
        font-size: 0.8rem;
    }

    .cart-item {
        display: grid;
        grid-template-columns: 75px 1fr;
        grid-template-areas:
            "image info"
            "image actions";
        gap: 12px;
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 16px;
    }

    .cart-item-image {
        grid-area: image;
        width: 75px;
        height: 90px;
        border-radius: 12px;
        overflow: hidden;
    }

    .cart-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .cart-item-info {
        grid-area: info;
        min-width: 0;
    }

    .cart-item-category {
        font-size: 0.65rem;
    }

    .cart-item-info h3 {
        font-size: 0.95rem;
        margin: 3px 0;
    }

    .cart-item-price {
        font-size: 0.8rem;
    }

    .cart-item-actions {
        grid-area: actions;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .cart-quantity {
        display: flex;
        align-items: center;
        gap: 9px;
    }

    .cart-quantity button {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .cart-quantity span {
        min-width: 18px;
        text-align: center;
        font-size: 0.85rem;
    }

    .cart-item-total {
        font-size: 0.9rem;
        margin-left: auto;
    }

    .cart-remove {
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .cart-summary {
        width: 100%;
        padding: 20px;
        border-radius: 18px;
    }

    .cart-summary h2 {
        font-size: 1.2rem;
        margin-bottom: 18px;
    }

    .summary-row {
        font-size: 0.9rem;
    }

    .summary-total {
        font-size: 1rem;
    }

    .proceed-checkout-btn {
        width: 100%;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 20px;
    }

    .continue-shopping-link {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 15px;
    }

    .cart-empty {
        padding: 45px 20px;
        text-align: center;
    }

    .cart-empty h2 {
        font-size: 1.25rem;
    }

    .cart-empty p {
        font-size: 0.85rem;
    }

    .continue-shopping-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    /* ====== CHECKOUT PAGE - کدهای خودتون ====== */
    .checkout-page {
        padding: 35px 15px 60px;
    }

    .checkout-layout {
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    .checkout-form-section {
        width: 100%;
    }

    .checkout-form {
        width: 100%;
    }

    .checkout-form h2 {
        font-size: 1.25rem;
    }

    .form-group {
        width: 100%;
    }

    .form-row {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        min-height: 48px;
        font-size: 0.9rem;
    }

    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }

    .checkout-summary {
        width: 100%;
        padding: 20px;
        border-radius: 18px;
    }

    .checkout-summary h2 {
        font-size: 1.2rem;
        margin-bottom: 18px;
    }

    .checkout-items {
        width: 100%;
    }

    .checkout-item {
        display: grid;
        grid-template-columns: 65px 1fr auto;
        align-items: center;
        gap: 10px;
        padding: 12px 0;
    }

    .checkout-item-image {
        width: 65px;
        height: 70px;
        border-radius: 10px;
        overflow: hidden;
    }

    .checkout-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .checkout-item-info {
        min-width: 0;
    }

    .checkout-item-info h4 {
        font-size: 0.88rem;
        line-height: 1.3;
        margin: 0 0 4px;
    }

    .checkout-item-info span {
        font-size: 0.75rem;
    }

    .checkout-item-total {
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .checkout-summary-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        font-size: 0.85rem;
    }

    .checkout-grand-total {
        font-size: 1rem;
        font-weight: 700;
    }

    .payment-methods {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .payment-method {
        width: 100%;
        min-height: 50px;
    }

    .place-order-btn {
        width: 100%;
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 20px;
    }

    .order-success {
        width: 100%;
        padding: 35px 20px;
        text-align: center;
    }

    .order-success h2 {
        font-size: 1.35rem;
    }

    .order-success p {
        font-size: 0.85rem;
        line-height: 1.6;
    }

}

/* Small Mobile Screens (Max-width: 480px) */
@media (max-width: 480px) {
    .container {
        width: 94%;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    .cart-hero {
        padding: 80px 15px 35px;
    }

    .cart-hero h1 {
        font-size: 1.9rem;
    }

    .cart-page {
        padding: 25px 10px 50px;
    }

    .cart-item {
        grid-template-columns: 65px 1fr;
        padding: 12px;
        gap: 10px;
    }

    .cart-item-image {
        width: 65px;
        height: 80px;
    }

    .cart-item-info h3 {
        font-size: 0.88rem;
    }

    .cart-item-actions {
        gap: 6px;
    }

    .cart-quantity {
        gap: 6px;
    }

    .cart-quantity button {
        width: 26px;
        height: 26px;
    }

    .cart-item-total {
        font-size: 0.8rem;
    }

    .cart-remove {
        width: 26px;
        height: 26px;
    }

    .cart-summary {
        padding: 17px;
    }

    .checkout-page {
        padding: 25px 10px 50px;
    }

    .checkout-summary {
        padding: 17px;
    }

    .checkout-item {
        grid-template-columns: 55px 1fr auto;
        gap: 8px;
    }

    .checkout-item-image {
        width: 55px;
        height: 62px;
    }

    .checkout-item-info h4 {
        font-size: 0.82rem;
    }

    .checkout-item-info span {
        font-size: 0.7rem;
    }

    .checkout-item-total {
        font-size: 0.75rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 0.85rem;
    }

}

/*================ DESKTOP - فقط برای مخفی کردن همبرگر ================*/
@media (min-width: 769px) {
    .mobile-btn {
        display: none !important;
    }
}
