/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --text-color: #374151;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
}

body {
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    direction: rtl;
    background-color: #ffffff;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    background-color: var(--dark-color);
    color: #ffffff;
    padding: 10px 0;
    font-size: 14px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info span {
    margin-left: 20px;
}

.contact-info i {
    margin-left: 5px;
}

.user-actions .user-link {
    color: #ffffff;
    text-decoration: none;
    margin-right: 20px;
    transition: color 0.3s;
}

.user-actions .user-link:hover {
    color: var(--secondary-color);
}

.main-header {
    padding: 20px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo h1 {
    font-size: 28px;
    color: var(--dark-color);
}

.logo h1 span {
    color: var(--primary-color);
}

.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-bar form {
    display: flex;
    background-color: var(--light-color);
    border-radius: 50px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    background: transparent;
    font-size: 14px;
}

.search-bar button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-bar button:hover {
    background-color: #1d4ed8;
}

.cart-widget .cart-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark-color);
    position: relative;
}

.cart-widget .cart-link i {
    font-size: 24px;
    margin-left: 10px;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Navigation */
.main-nav {
    background-color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: #1d4ed8;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: none;
    list-style: none;
}

.has-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: var(--dark-color);
    padding: 12px 20px;
}

.dropdown-menu a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.hero-slider .slide {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s;
}

.hero-slider .slide.active {
    opacity: 1;
}

.slide-content {
    text-align: center;
    color: white;
    background-color: rgba(0,0,0,0.5);
    padding: 40px;
    border-radius: 10px;
}

.slide-title {
    font-size: 48px;
    margin-bottom: 20px;
}

.slide-subtitle {
    font-size: 24px;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s;
    font-size: 16px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

.slider-controls button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.8);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
}

.slider-controls .prev-slide {
    right: 20px;
}

.slider-controls .next-slide {
    left: 20px;
}

.slider-controls button:hover {
    background-color: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

/* Features Section */
.features-section {
    padding: 60px 0;
    background-color: var(--light-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    text-align: center;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-item i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-item h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* Products Section */
.products-section {
    padding: 80px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 32px;
    color: var(--dark-color);
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.view-all:hover {
    color: #1d4ed8;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--danger-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1;
}

.product-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.quick-view {
    background-color: white;
    color: var(--dark-color);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.quick-view:hover {
    background-color: var(--primary-color);
    color: white;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.product-rating {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.btn-add-cart {
    flex: 1;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

.btn-add-cart:hover {
    background-color: #1d4ed8;
}

.btn-wishlist {
    background-color: var(--light-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-wishlist:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Categories Section */
.categories-section {
    padding: 80px 0;
    background-color: var(--light-color);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.category-card {
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s;
}

.category-card:hover {
    transform: scale(1.05);
}

.category-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 30px;
}

.category-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.category-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.category-link:hover {
    color: var(--secondary-color);
}

/* Newsletter Section */
.newsletter-section {
    background-color: var(--primary-color);
    padding: 60px 0;
}

.newsletter-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.newsletter-text h2 {
    color: white;
    font-size: 32px;
    margin-bottom: 10px;
}

.newsletter-text p {
    color: rgba(255,255,255,0.8);
    font-size: 18px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 500px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
}

.newsletter-form .btn {
    background-color: var(--secondary-color);
    white-space: nowrap;
}

.newsletter-form .btn:hover {
    background-color: #dc2626;
}

/* Footer Styles */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.footer-column p {
    line-height: 1.8;
    color: rgba(255,255,255,0.8);
}

.social-links {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    transition: background-color 0.3s;
}

.social-links a:hover {
    background-color: var(--primary-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    color: rgba(255,255,255,0.8);
}

.contact-item i {
    margin-left: 10px;
    margin-top: 5px;
}

.payment-methods {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.payment-methods img {
    height: 30px;
}

.footer-bottom {
    background-color: rgba(0,0,0,0.2);
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-bottom-content p {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

.footer-bottom-links a {
    color: rgba(255,255,255,0.8);
    margin-right: 15px;
    text-decoration: none;
    font-size: 14px;
}

.footer-bottom-links a:hover {
    color: white;
}
/* Product Badges */
.new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--success-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1;
}

.popular-badge {
    position: absolute;
    top: 50px;
    right: 10px;
    background-color: var(--secondary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1;
}

.product-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 10px;
    line-height: 1.5;
}

.product-stock {
    margin-bottom: 10px;
    font-size: 14px;
}

.in-stock {
    color: var(--success-color);
}

.low-stock {
    color: var(--danger-color);
    font-weight: bold;
}

.old-price {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 16px;
    margin-left: 10px;
}

.bg-light {
    background-color: var(--light-color);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-add-cart:disabled {
    background-color: #6b7280;
}

.btn-add-cart:disabled:hover {
    background-color: #6b7280;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Product card link styles */
.product-title a:hover {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.product-image a {
    display: block;
    width: 100%;
    height: 100%;
}
/* 📦 Product Card Styles - Digikala Style */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.product-img {
    position: relative;
    background: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.badge-discount {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ef394e;
    color: #fff;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.badge-outofstock {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #666;
    color: #fff;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 4px;
}

.product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-info h3 {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    min-height: 40px;
    line-height: 1.4;
}

.price-box {
    margin-bottom: 10px;
}

.old-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-left: 6px;
}

.new-price {
    font-size: 14px;
    font-weight: bold;
    color: #ef394e;
}

.btn-addcart {
    background: #ef394e;
    color: #fff;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease;
    font-size: 14px;
}

.btn-addcart:hover {
    background: #d82d42;
}

.btn-addcart.disabled {
    background: #ccc !important;
    cursor: not-allowed;
}
/* ارتفاع ثابت برای لیست محصولات و اسکرول داخلی */
#mini-cart .mini-cart-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 250px; /* 👈 محدودیت ارتفاع */
    overflow-y: auto;  /* اسکرول داخلی */
}

/* اسکرول مخفی و جمع‌وجور */
#mini-cart .mini-cart-list::-webkit-scrollbar {
    width: 6px;
}
#mini-cart .mini-cart-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* اندازه ثابت برای عکس محصولات */
#mini-cart .mini-cart-list li img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-left: 10px;
    flex-shrink: 0;
}


/* Responsive Styles */
@media screen and (max-width: 992px) {
    .search-bar {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        background-color: var(--primary-color);
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
}
