/* Layout styles: floating storefront header and content structure. */

/* استایل جدید برای صفحه شناور ویترین */
.floating-shop-header {
    position: sticky;
    top: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.32));
    backdrop-filter: blur(34px) saturate(180%) contrast(108%);
    -webkit-backdrop-filter: blur(34px) saturate(180%) contrast(108%);
    padding: 8px 10px;
    z-index: 1200;
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(255, 255, 255, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 15px;
    margin-bottom: 15px;
    transform: translateY(0);
    transition: transform 0.24s ease, opacity 0.2s ease, box-shadow 0.3s ease, padding 0.3s ease;
    will-change: transform, opacity;
}

.floating-shop-header.header-hidden {
    transform: translateY(calc(-100% - 18px));
    opacity: 0;
    pointer-events: none;
}

.floating-shop-header::before {
    content: "";
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 46%;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.06));
    pointer-events: none;
}

.floating-shop-header.scrolled {
    padding: 10px 15px;
    box-shadow: 0 10px 15px rgba(50, 50, 93, 0.1);
}

.shop-header-content {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.floating-shop-header .shop-search-sort-row {
    position: relative;
    z-index: 1;
}

.shop-title {
    text-align: center;
    padding: 4px 0;
    font-size: 1.4rem;
    line-height: 1.35;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin: 0;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* تغییر استایل بخش محتوای اصلی ویترین */
#shop-section {
    padding-top: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important; /* همیشه 2 ستون */
    gap: 15px;
    padding: 15px;
    max-width: 100% !important; /* استفاده از کل عرض در دسترس */
    margin: 0 auto !important; /* مرکز قرار دادن کل گرید */
    width: 100% !important; /* عرض کامل */
    justify-content: center !important; /* مرکز قرار دادن ستون‌ها */
    justify-items: center !important; /* مرکز قرار دادن آیتم‌ها در ستون‌ها */
}

.content-area {
    padding: 0 5px !important; /* کاهش پدینگ کناری */
    flex: 1 0 auto;
}

@media (min-width: 768px) {
    .shop-header-content {
        min-height: 0;
    }

    .shop-title {
        padding: 0;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* همچنان 2 ستون */
        gap: 20px; /* فقط فاصله بین آیتم‌ها را افزایش می‌دهیم */
        margin: 0 -20px !important; /* حاشیه منفی بیشتر در صفحات بزرگتر */
        width: calc(100% + 40px) !important;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        /* Desktop: keep mobile-like card width, increase columns based on screen width */
        grid-template-columns: repeat(auto-fill, minmax(210px, 240px)) !important;
        justify-content: center !important;
        gap: 18px !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 1400px !important;
    }
}

@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 240px)) !important;
        gap: 20px !important;
    }
}

/* کاهش پدینگ در section برای افزایش فضای محصولات */
section {
    padding: 10px 5px !important; /* کاهش پدینگ */
}
