/* assets/css/custom.css - نسخه نهایی با فیلتر کشویی در تمام دستگاه‌ها */

/* ========== فونت وزیرمتن ========== */
@font-face {
    font-family: 'Vazirmatn';
    src: url('vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

body {
    background: #f4f6f9;
    font-size: 1rem;
    line-height: 1.5;
}

/* ========== هدر ========== */
.header-custom {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.header-custom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.header-logo img {
    height: 45px;
    width: auto;
    max-width: 150px;
}
.club-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
}
.club-title {
    font-size: 0.75rem;
    color: #6c757d;
    display: block;
    margin-top: 2px;
}
.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.welcome-text {
    font-size: 0.85rem;
    color: #495057;
    white-space: nowrap;
}
.avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #0d6efd, #0a58ca);
    box-shadow: 0 4px 10px rgba(13,110,253,0.3);
    flex-shrink: 0;
}

/* ========== فوتر ========== */
.footer-custom {
    background-color: #343a40;
    color: #ffffff;
    padding: 1rem 0;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ========== کارت محصولات (پیشرفته) ========== */
.product-card {
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1), box-shadow 0.3s ease;
    border-radius: 1.2rem;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    background: #fff;
    will-change: transform;
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.2);
}
.product-card .card-img-top {
    transition: transform 0.5s ease-out;
    height: 200px;
    object-fit: cover;
    width: 100%;
}
.product-card:hover .card-img-top {
    transform: scale(1.05);
}
.product-card .card-title a {
    transition: color 0.2s;
    font-weight: 600;
    color: #1e2a3a;
    text-decoration: none;
}
.product-card .card-title a:hover {
    color: #0d6efd;
}
.product-card .text-primary.fw-bold {
    font-size: 1.25rem;
    font-weight: bold;
    transition: color 0.2s;
}
.product-card:hover .text-primary.fw-bold {
    color: #0b5ed7 !important;
}
.add-to-cart-btn {
    border-radius: 2rem;
    transition: all 0.25s ease-in-out;
}
.add-to-cart-btn:active {
    transform: scale(0.96);
}
.stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 2;
    backdrop-filter: blur(4px);
}
.product-card:hover .stock-badge {
    transform: scale(1.02);
}

/* انیمیشن fadeInUp برای کارت‌ها */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.product-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}
.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }

/* ========== اسلایدر ========== */
#shopSlider {
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 2rem;
}
#shopSlider .carousel-item img {
    transition: transform 0.5s ease;
}
#shopSlider .carousel-item.active img {
    transform: scale(1.02);
}
.carousel-caption {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 1rem;
    padding: 1rem;
    bottom: 1.5rem;
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0,0,0,0.4);
    border-radius: 50%;
    padding: 1rem;
}

/* ========================================
   فیلتر سایدبار کشویی (هم در موبایل و هم دسکتاپ)
   ======================================== */
.filter-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 380px;
    height: 100%;
    background: #fff;
    z-index: 1060;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    padding: 1rem;
}
.filter-sidebar.open {
    transform: translateX(0);
}
/* پشت‌زمینه تیره */
.filter-sidebar.open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    animation: fadeIn 0.3s ease;
}
.filter-sidebar .card {
    border: none;
    box-shadow: none;
    background: transparent;
}
.filter-sidebar .card-header {
    background-color: #0d6efd;
    border-radius: 1rem 1rem 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.filter-sidebar .btn-close-white {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}
.filter-sidebar .btn-close-white:hover {
    opacity: 1;
}
.filter-sidebar .form-control,
.filter-sidebar .form-select {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.filter-sidebar .form-control:focus,
.filter-sidebar .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.2);
}
.filter-sidebar .btn {
    border-radius: 30px;
    padding: 0.6rem;
    font-weight: 500;
}
.filter-sidebar .btn-primary {
    background-color: #0d6efd;
    border: none;
}
.filter-sidebar .btn-primary:hover {
    background-color: #0b5ed7;
    transform: translateY(-2px);
}
.filter-sidebar .btn-secondary {
    background-color: #6c757d;
    border: none;
}
.filter-sidebar .btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

/* دکمه باز کردن فیلتر (در همه دستگاه‌ها) */
.filter-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    background-color: #0d6efd;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.filter-toggle-btn i {
    font-size: 1.5rem;
}
.filter-toggle-btn:hover {
    background-color: #0b5ed7;
    transform: scale(1.05);
}
#closeFilterBtn {
    display: block;
}

/* واکنش‌گرایی عمومی */
@media (max-width: 768px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .header-custom .container {
        flex-direction: column;
        text-align: center;
    }
    .header-logo {
        justify-content: center;
    }
    .club-name {
        font-size: 1rem;
    }
    .header-user {
        justify-content: center;
        width: 100%;
    }
    .welcome-text {
        white-space: normal;
    }
    .avatar-circle {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    .card-img-top {
        height: 150px;
    }
    #shopSlider .carousel-item img {
        height: 200px !important;
    }
    .carousel-caption {
        display: none !important;
    }
    .filter-sidebar {
        max-width: 320px;
    }
}

/* انیمیشن overlay */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}