/* ============================================================
   صفحه محصولات - نگار ممتاز
   ساختار مرتب‌شده:
   1) هیرو و سربرگ
   2) بخش محصولات
   3) کارت محصول - دسکتاپ
   4) دکمه‌ها و لینک‌ها
   5) ریسپانسیو تبلت و موبایل
   ============================================================ */


/* ============================================================
   1. هیرو
   ============================================================ */

.page-hero {
    min-height: 40vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 72px;
    text-align: center;
    background: url('/image/products-background.jpg') center / cover no-repeat;
    background-attachment: fixed;
}

.page-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.85) 0%,
        rgba(15, 23, 42, 0.7) 100%
    );
}

.page-hero-content {
    position: relative;
    z-index: 2;
    padding: 1rem;
}

.page-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    padding: 0.5rem 1.2rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 100px;
    background: rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(10px);
    color: var(--accent-light);
    font-size: 0.85rem;
}

.page-hero-title {
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
}

.page-hero-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.page-hero-breadcrumb a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

.page-hero-breadcrumb a:hover {
    color: var(--accent-light);
}


/* ============================================================
   2. بخش محصولات
   ============================================================ */

.products-list-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-title {
    margin-bottom: 0.5rem;
    font-size: clamp(1.6rem, 4vw, 2rem);
    font-weight: 800;
}

.section-desc {
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-muted);
}


/* ============================================================
   3. کارت محصول - دسکتاپ
   ============================================================ */

.product-card-wrapper {
    height: 100%;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 560px;
    overflow: hidden;
    border-radius: 24px;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}


/* تصویر محصول */

.product-image {
    position: relative;
    flex: 0 0 260px;
    height: 260px;
    min-height: 260px;
    overflow: hidden;
}

.product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.07);
}


/* لایه مشاهده جزئیات روی تصویر */

.product-image-overlay {
    position: absolute;
    right: 0;
    bottom: -100%;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 1rem;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.95),
        transparent
    );
    text-align: center;
    transition: bottom 0.3s ease;
}

.product-card:hover .product-image-overlay {
    bottom: 0;
}


/* محتوای کارت */

.product-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: 1.2rem;
}


/* دسته‌بندی */

.product-category {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    margin-bottom: 0.7rem;
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    background: rgba(212, 175, 55, 0.12);
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 600;
}


/* عنوان محصول */

.product-title {
    flex: 0 0 auto;
    min-height: 26px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.5;
    transition: var(--transition);
}

.product-card:hover .product-title {
    color: var(--accent);
}


/* توضیحات محصول */

.product-description {
    display: -webkit-box;
    flex: 0 0 auto;
    height: 54px;
    min-height: 54px;
    max-height: 54px;
    margin-bottom: 0.8rem;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.5;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}


/* مزایا و ویژگی‌های محصول */

.product-features {
    display: flex;
    flex: 0 0 88px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    height: 88px;
    min-height: 88px;
    max-height: 88px;
    margin-bottom: 0.7rem;
    padding-bottom: 0.6rem;
    overflow: hidden;
    border-bottom: 1px solid #e2e8f0;
}

.product-features .feature {
    display: flex;
    flex: 0 0 21px;
    align-items: center;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 21px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.6rem;
    line-height: 21px;
}

.product-features .feature i {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 0.65rem;
}

.product-features .feature span {
    display: block;
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* در کارت فقط چهار مزیت اول نمایش داده می‌شود */
.product-features .feature:nth-child(n + 5) {
    display: none;
}


/* فوتر کارت: قیمت و دکمه */

.product-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 40px;
    height: 40px;
    margin-top: auto;
}

.product-price .price {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 800;
}

.product-price .unit {
    color: var(--text-muted);
    font-size: 0.55rem;
}


/* ============================================================
   4. دکمه‌ها و لینک‌ها
   ============================================================ */

.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 50px;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-view:hover {
    gap: 10px;
    background: var(--primary-dark) !important;
    color: #fff !important;
}

.btn-view:focus,
.btn-view:active {
    outline: none;
    box-shadow: none;
}

.btn-product {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 50px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.btn-product:hover {
    gap: 10px;
    background: var(--accent-dark) !important;
    color: var(--primary-dark) !important;
}

.btn-product:focus,
.btn-product:active {
    outline: none;
    box-shadow: none;
}

.btn-view-all-products {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0.6rem 1.8rem !important;
    border: 2px solid var(--primary) !important;
    border-radius: 50px !important;
    background: transparent !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: var(--transition) !important;
}

.btn-view-all-products:hover {
    gap: 14px !important;
    background: var(--primary) !important;
    color: #fff !important;
}

.product-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    color: var(--accent) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: var(--transition) !important;
}

.product-link:hover {
    gap: 10px !important;
    color: var(--accent-dark) !important;
}


/* ============================================================
   5. تبلت و صفحه‌های متوسط
   ============================================================ */

@media (max-width: 800px) {
    .page-hero {
        min-height: 35vh;
    }

    .product-card {
        height: 510px;
    }

    .product-image {
        flex-basis: 235px;
        height: 235px;
        min-height: 235px;
    }

    .product-content {
        padding: 1rem;
    }

    .product-description {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
    }

    .product-features {
        flex-basis: 84px;
        height: 84px;
        min-height: 84px;
        max-height: 84px;
    }
}


/* ============================================================
   6. موبایل
   در موبایل ارتفاع کارت تابع محتوای واقعی آن است.
   توضیحات سه خط و مزایا حداکثر چهار مورد هستند.
   فوتر بلافاصله بعد از مزایا می‌آید.
   ============================================================ */

@media (max-width: 768px) {
    .page-hero {
        margin-top: 65px;
        min-height: 35vh;
        background-attachment: scroll;
    }

    .products-list-section {
        padding: 50px 0;
    }

    /* دو ستون در موبایل */
    .products-list-section .row {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        margin-right: -6px;
        margin-left: -6px;
    }

    .products-list-section .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .products-list-section [class*="col-"] {
        display: block;
        padding-right: 6px;
        padding-left: 6px;
        margin-bottom: 14px;
    }

    .product-card-wrapper {
        height: auto;
    }

    .product-card {
        height: auto;
        min-height: 0;
        border-radius: 18px;
    }

    .product-image {
        flex: 0 0 auto;
        width: 100%;
        height: 175px;
        min-height: 175px;
        max-height: 175px;
    }

    /* نمایش دکمه جزئیات با لمس محصول در موبایل */
    .product-image-overlay {
        bottom: -100%;
        padding: 0.6rem;
        background: linear-gradient(
            to top,
            rgba(15, 23, 42, 0.85),
            transparent
        );
    }

/* نمایش با لمس یا قرار گرفتن فوکوس */
.product-card:hover .product-image-overlay,
.product-card:focus-within .product-image-overlay {
    bottom: 0;
}

    .product-content {
        display: flex;
        flex: 0 0 auto;
        flex-direction: column;
        height: auto;
        min-height: 0;
        padding: 0.7rem;
        overflow: visible;
    }

    .product-category {
        gap: 4px;
        margin-bottom: 0.45rem;
        padding: 0.18rem 0.5rem;
        font-size: 0.52rem;
    }

    .product-title {
        height: auto;
        min-height: 0;
        margin-bottom: 0.4rem;
        font-size: 0.78rem;
        line-height: 1.5;
    }

    .product-description {
        display: -webkit-box;
        flex: 0 0 auto;
        height: auto;
        min-height: 0;
        max-height: none;
        margin-bottom: 0.55rem;
        overflow: hidden;
        font-size: 0.62rem;
        line-height: 1.65;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .product-features {
        display: flex;
        flex: 0 0 auto;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        height: auto;
        min-height: 0;
        max-height: none;
        margin-bottom: 0.45rem;
        padding-bottom: 0.45rem;
        overflow: visible;
    }

    .product-features .feature {
        display: flex;
        flex: 0 0 19px;
        align-items: center;
        height: 19px;
        min-height: 19px;
        font-size: 0.51rem;
        line-height: 19px;
    }

    .product-features .feature i {
        flex: 0 0 auto;
        font-size: 0.52rem;
    }

    .product-features .feature:nth-child(n + 5) {
        display: none;
    }

    .product-footer {
        display: flex;
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.25rem;
        height: auto;
        min-height: 32px;
        margin-top: 0;
    }

    .product-price .price {
        font-size: 0.7rem;
    }

    .product-price .unit {
        font-size: 0.5rem;
    }

    .btn-product {
        width: auto;
        padding: 0.32rem 0.5rem;
        font-size: 0.52rem;
        gap: 3px;
    }

    .btn-product i {
        font-size: 0.52rem;
    }
}


/* ============================================================
   7. موبایل کوچک
   ============================================================ */

@media (max-width: 480px) {
    .products-list-section {
        padding: 40px 0;
    }

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

    .product-image {
        height: 135px;
        min-height: 135px;
        max-height: 135px;
    }

    .product-content {
        padding: 0.6rem;
    }

    .product-category {
        margin-bottom: 0.4rem;
        padding: 0.15rem 0.42rem;
        font-size: 0.48rem;
    }

    .product-title {
        margin-bottom: 0.35rem;
        font-size: 0.7rem;
    }

    .product-description {
        margin-bottom: 0.45rem;
        font-size: 0.56rem;
        line-height: 1.65;
    }

    .product-features {
        margin-bottom: 0.4rem;
        padding-bottom: 0.4rem;
    }

    .product-features .feature {
        flex-basis: 17px;
        height: 17px;
        min-height: 17px;
        font-size: 0.46rem;
        line-height: 17px;
    }

    .product-features .feature i {
        font-size: 0.46rem;
    }

    .product-footer {
        min-height: 30px;
    }

    .product-price .price {
        font-size: 0.63rem;
    }

    .btn-product {
        padding: 0.28rem 0.42rem;
        font-size: 0.47rem;
    }
}


/* ============================================================
   8. موبایل بسیار کوچک
   ============================================================ */

@media (max-width: 360px) {
    .product-image {
        height: 115px;
        min-height: 115px;
        max-height: 115px;
    }

    .product-content {
        padding: 0.5rem;
    }

    .product-category {
        gap: 3px;
        padding: 0.13rem 0.35rem;
        font-size: 0.43rem;
    }

    .product-title {
        font-size: 0.64rem;
    }

    .product-description {
        font-size: 0.51rem;
    }

    .product-features .feature {
        font-size: 0.42rem;
    }

    .product-price .price {
        font-size: 0.57rem;
    }

    .btn-product {
        gap: 2px;
        padding: 0.25rem 0.32rem;
        font-size: 0.42rem;
    }
}
