/* ============================================================================
   عمارت ۵ دری | Emarat 5 Dari - Responsive Stylesheet
   ----------------------------------------------------------------------------
   استراتژی: Mobile-First (پایه در style.css برای ۳۲۰px طراحی شده است)
   بریک‌پوینت‌های پشتیبانی‌شده:
   320 (پایه) | 375 | 390 | 414 | 480 | 576 | 768 | 992 | 1200 | 1400 | 1920
   ============================================================================ */

/* ============================================================================
   ۳۲۰px - پایه (Extra Small Mobile) - تنظیمات پیشگیرانه از اسکرول افقی
   ============================================================================ */
body {
    max-width: 100vw;
}

.container {
    padding-inline: var(--space-3);
}

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

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

.footer-col__contact li,
.top-bar__contact {
    justify-content: center;
}

table.responsive-table,
table.responsive-table thead,
table.responsive-table tbody,
table.responsive-table th,
table.responsive-table td,
table.responsive-table tr {
    display: block;
}

table.responsive-table thead {
    display: none;
}

table.responsive-table tr {
    margin-bottom: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    background: var(--color-white);
}

table.responsive-table td {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px dashed var(--color-cream-dark);
    font-size: var(--fs-sm);
}

table.responsive-table td:last-child { border-bottom: none; }

table.responsive-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--color-primary-dark);
}

/* ============================================================================
   375px - موبایل استاندارد (iPhone SE/8)
   ============================================================================ */
@media (min-width: 375px) {
    :root {
        --fs-3xl: 3.25rem;
    }

    .main-header__logo img {
        height: 46px;
    }
}

/* ============================================================================
   390px - موبایل (iPhone 12/13/14)
   ============================================================================ */
@media (min-width: 390px) {
    .products-grid {
        gap: var(--space-4);
    }

    .btn {
        padding: 0.9rem 1.9rem;
    }
}

/* ============================================================================
   414px - موبایل بزرگ (iPhone Plus/Max)
   ============================================================================ */
@media (min-width: 414px) {
    .container {
        padding-inline: var(--space-4);
    }

    .product-card__title {
        font-size: 0.95rem;
    }
}

/* ============================================================================
   480px - موبایل افقی (Landscape)
   ============================================================================ */
@media (min-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .site-footer__grid {
        grid-template-columns: repeat(2, 1fr);
        text-align: right;
    }

    .footer-col__contact li {
        justify-content: flex-start;
    }

    .top-bar__contact {
        justify-content: flex-start;
    }
}

/* ============================================================================
   576px - تبلت کوچک (Small Tablet)
   ============================================================================ */
@media (min-width: 576px) {
    .container {
        padding-inline: var(--space-5);
    }

    .top-bar__address {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
    }

    .flash-message {
        max-width: 640px;
        margin-inline: auto;
    }
}

/* ============================================================================
   768px - تبلت (iPad Portrait) - نمایش جستجوی دسکتاپ
   ============================================================================ */
@media (min-width: 768px) {
    .main-header__search {
        display: flex;
        align-items: center;
        flex: 1;
        max-width: 420px;
        margin-inline: var(--space-5);
        position: relative;
    }

    .main-header__search button {
        position: absolute;
        left: 6px;
        top: 50%;
        transform: translateY(-50%);
        width: 34px;
        height: 34px;
        border-radius: var(--radius-full);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-5);
    }

    .site-footer__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-col--brand {
        grid-column: span 3;
        text-align: center;
    }

    .footer-col__social {
        display: flex;
        justify-content: center;
    }
}

/* ============================================================================
   992px - لپ‌تاپ کوچک - تبدیل منوی موبایل به منوی افقی دسکتاپ
   ============================================================================ */
@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none;
    }

    .main-nav {
        display: block;
    }

    .main-nav__list {
        justify-content: center;
    }

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

    .site-footer__grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-col--brand {
        grid-column: span 1;
        text-align: right;
    }

    .footer-col__social {
        justify-content: flex-start;
    }

    :root {
        --header-height: 108px;
    }

    .container {
        padding-inline: var(--space-6);
    }
}

/* ============================================================================
   1200px - دسکتاپ استاندارد
   ============================================================================ */
@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-6);
    }

    :root {
        --fs-3xl: 3.5rem;
        --fs-2xl: 2.5rem;
    }

    .main-nav__list {
        gap: var(--space-7);
    }
}

/* ============================================================================
   1400px - دسکتاپ بزرگ
   ============================================================================ */
@media (min-width: 1400px) {
    .container {
        max-width: 1360px;
    }

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

/* ============================================================================
   1920px - مانیتورهای بزرگ / 4K
   ============================================================================ */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

    body {
        font-size: 1.0625rem;
    }

    .products-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: var(--space-7);
    }

    :root {
        --fs-3xl: 4rem;
        --fs-2xl: 2.75rem;
        --fs-xl: 2rem;
    }
}

/* ============================================================================
   حالت موبایل معکوس - اطمینان از رفتار صحیح منوی کشویی زیر 992px
   ============================================================================ */
@media (max-width: 991.98px) {
    .main-nav {
        display: none !important;
    }
}
