/* =======================================
   فونت‌ها و استایل‌های پایه
   ======================================= */
@font-face { font-family: titr; src: url(../../fonts/Rubik/static/Rubik-Bold.ttf); }
@font-face { font-family: titr2; src: url(../../fonts/Lalezar-Regular.ttf); }
@font-face { font-family: titr3; src: url(../../fonts/Alexandria/static/Alexandria-Bold.ttf); }
@font-face { font-family: titr4; src: url(../../fonts/Rubik/static/Rubik-Bold.ttf); }

.titr { font-family: titr; font-size: 18px; text-shadow: 0.1rem 0.1rem 0.8rem #000; }
.titr2 { font-family: titr2; font-size: 28px; text-shadow: 0.1rem 0.1rem 0.8rem #fff; }
.titr3 { font-family: titr3; font-size: 17px; }
.titr4 { font-family: titr4; font-size: 17px; }

body, html {
    background-image: url('../images/callbg2.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    margin: 0;
    padding: 0;
    font-family: titr3, Tahoma, sans-serif;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
}

/* =======================================
   ناوبری (Navbar)
   ======================================= */
.navbar { background-color: rgba(34, 34, 34, 0.9); backdrop-filter: blur(10px); padding: 10px 0; position: sticky; top: 0; z-index: 1000; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.nav-logo { display: flex; align-items: center; text-decoration: none; color: #fff; }
.nav-logo img { width: 40px; height: 40px; margin-left: 10px; }
.nav-title { font-family: titr2; font-size: 18px; }
.nav-menu { display: flex; align-items: center; gap: 20px; }
.nav-menu a { color: #000000; text-decoration: none; font-family: titr4; }
#btnsearch { background-color: #04c783; transition: all 0.2s ease-in-out; }
#btnsearch:hover { box-shadow: inset 0px 4px 6px #04c783, 0px 5px 10px #74f6c8; }
#btnbox { background-color: #ccfceb; width: 500px; }
#loginadmin { color: rgb(238, 138, 7); }

/* =======================================
   ساختار اصلی صفحه
   ======================================= */
.shop-container {
    max-width: 1200px;
    margin: 100px auto 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

/* =======================================
   سایدبار (دسته‌بندی‌ها)
   ======================================= */
.sidebar {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 25px;
    height: fit-content;
}
.sidebar-title {
    font-family: titr2;
    font-size: 20px;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid rgb(76, 159, 200);
    padding-bottom: 10px;
    background-color: rgb(135, 201, 235);
    border-radius: 5px;
}
.category-list { display: flex; flex-direction: column; gap: 10px; }
.category-item {
    display: block;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    font-family: titr4;
    color: #495057;
    text-align: center;
    transition: all 0.3s ease;
}
.category-item:hover, .category-item.active {
    background-color: rgb(76, 159, 200);
    color: #fff;
    transform: translateY(-2px);
}

/* =======================================
   گرید محصولات (راه حل نهایی)
   ======================================= */
main.shop-container .content-area .product-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(250px, 1fr)) !important;
    gap: 25px !important;
}

/* =======================================
   کارت محصول
   ======================================= */
.product-card {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}
.product-card:hover { transform: translateY(-5px); }
.product-image-link {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    height: 200px;
}
.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}
.product-image-link:hover .product-image { transform: scale(1.05); }
.view-details {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(76, 159, 200, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: titr4;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.product-image-link:hover .view-details { opacity: 1; }
.product-info { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.product-title { font-family: titr3; font-size: 18px; color: #333; margin: 0 0 10px 0; text-align: center; }
.product-price { font-family: titr2; font-size: 20px; color: #159223; font-weight: bold; text-align: center; margin-bottom: 20px; }
.product-actions { margin-top: auto; display: flex; gap: 10px; }
.product-actions form, .product-actions a { flex: 1; }
.btn-add-cart {
    width: 100%;
    padding: 10px 5px;
    border: none;
    border-radius: 8px;
    background-color: rgb(76, 159, 200);
    color: #fff;
    font-family: titr4;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-add-cart:hover { background-color: rgb(1, 79, 119); }
.btn-view-more {
    display: block;
    padding: 10px 5px;
    border-radius: 8px;
    background-color: #6c757d;
    color: #fff;
    font-family: titr4;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-view-more:hover { background-color: #292d30; }

/* =======================================
   صفحه‌بندی (Pagination) - بازگردانی شده از کد اولیه
   ======================================= */
.pagination-nav {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.pagination-nav .pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 5px;
    align-items: center;
    direction: rtl;
}
.pagination-nav .pagination li a,
.pagination-nav .pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-family: titr4;
    font-size: 15px;
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    min-width: 100px;
}
.pagination-nav .pagination li.active a {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}
.pagination-nav .pagination li a:hover,
.pagination-nav .pagination li.active a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.pagination-nav .pagination li.disabled span {
    background-color: #e9ecef;
    color: #adb5bd;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}
.pagination-nav .pagination .prev-link i { margin-right: 8px; }
.pagination-nav .pagination .next-link i { margin-left: 8px; }

/* =======================================
   فوتر (Footer) - بازگردانی شده از کد اولیه
   ======================================= */
.modern-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 60px 0 20px 0;
    font-family: titr4;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}
.footer-section .footer-title {
    font-family: titr2;
    font-size: 20px;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}
.footer-section.about { text-align: center; }
.footer-logo { max-width: 150px; margin-bottom: 20px; }
.footer-description { line-height: 1.8; color: #bdc3c7; }
.footer-section.contact .contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #bdc3c7;
}
.footer-section.contact .contact-item i { font-size: 18px; margin-left: 15px; width: 20px; text-align: center; }
.footer-section.contact .contact-item a { color: #bdc3c7; text-decoration: none; transition: color 0.3s ease; }
.footer-section.contact .contact-item a:hover { color: rgb(212, 129, 93); }
.footer-section.links ul { list-style: none; padding: 0; margin: 0; }
.footer-section.links ul li { margin-bottom: 10px; }
.footer-section.links ul li a { color: #bdc3c7; text-decoration: none; transition: color 0.3s ease; }
.footer-section.links ul li a:hover { color: rgb(212, 129, 93); }
.social-links { margin-top: 20px; display: flex; justify-content: center; gap: 15px; }
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
}
.social-links a:hover { 
    color: rgb(0, 170, 255);
    transform: scale(1.1);
    }
.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    color: #95a5a6;
}
.footer-bottom p { margin: 5px 0; font-size: 14px; }
.footer-bottom a { color: #fff; text-decoration: none; font-weight: bold; transition: all 0.5s ease; }
.footer-bottom a:hover { color: #00FF00; }

/* =======================================
   ریسپانسیو (Responsive)
   ======================================= */
@media (max-width: 1024px) {
    main.shop-container .content-area .product-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr)) !important;
    }
}
@media (max-width: 768px) {
    main.shop-container .content-area .product-grid {
        grid-template-columns: 1fr !important;
        max-width: 400px;
        margin: 0 auto;
    }
    /* ریسپانسیو برای فوتر */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    .social-links { justify-content: center; }
}