/* متغیرهای اصلی */
:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray-dark: #1a1a1a;
    --color-gray: #666666;
    --color-gray-light: #f5f5f5;
    --color-accent: #8b0000;
    --font-primary: "Iran Sans", "Vazir", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --font-serif: Georgia, "Times New Roman", serif;
}

/* ریست استایل‌ها */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--color-black);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
    text-align: right;
    background-color: var(--color-white);
    overflow-y: auto;
}

/* هدر */
.header {
    background-color: var(--color-black);
    color: var(--color-white);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.1rem 3rem;
    position: relative;
    background-color: #ffcb05;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-white);
    width:150px;
}

.logo-text {
    font-size: 1.25rem;
    letter-spacing: 0;
    font-weight: 300;
}

.hamburger {
    position: absolute;
    right: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

    .hamburger span {
        width: 25px;
        height: 2px;
        background-color: var(--color-white);
        transition: all 0.3s ease;
        display: block;
    }

    .hamburger:hover span {
        background-color: rgba(255, 255, 255, 0.7);
    }

/* استایل‌های مخصوص صفحه فروشگاه */
.shop-container {
    padding-top: 25px !important;
    background-color: var(--color-white);
    min-height: 100vh;
}

/* بخش جستجو */
.shop-search {
    background-color: darkgrey;
    padding: 1rem 1rem 0rem 0rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.search-container {
    max-width: 1400px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    max-width: 500px;
    position: relative;
    margin-bottom: 1rem;
}
/* Price line-through style */
.line-through {
    text-decoration: line-through;
    opacity: 0.7;
    font-size: 0.9em;
}

/* Product image container for discount badge */
.product-image-container {
    position: relative;
    overflow: hidden;
}

/* Discount badge on image */
.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #d32f2f;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Remove old discount style under prices */
.price .discount {
    display: none;
}

/* Price styling adjustments */
.sale-price {
    color: #d32f2f;
    font-weight: bold;
    font-size: 1.1em;
}

.regular-price {
    color: var(--color-gray);
    margin-right: 8px;
    font-size: 0.95em;
}

/* Mobile responsive adjustments for discount badge */
@media (max-width: 768px) {
    .discount-badge {
        top: 5px;
        right: 5px;
        font-size: 10px;
        padding: 3px 6px;
    }

    .product-card img {
        position: relative;
    }
}
.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 1rem;
    background-color: var(--color-white);
    transition: border-color 0.3s;
}

    .search-input:focus {
        outline: none;
        border-color: var(--color-black);
    }

.search-btn {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-gray);
    transition: color 0.3s;
}

    .search-btn:hover {
        color: var(--color-black);
    }

.search-filters {
    display: flex;
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .filter-group label {
        font-size: 0.875rem;
        color: var(--color-gray);
    }

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);

    background-color: var(--color-white);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

/* بخش اصلی فروشگاه */
.shop-main {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 3rem;
    gap: 3rem;
    position: relative;
}

/* سایدبار - Desktop */
.shop-sidebar {
    flex: 0 0 280px;
    background: var(--color-white);
    display: block;
}

.sidebar-section {
    margin-bottom: 2px;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--color-black);
}

.sidebar-list {
    list-style: none;
}

    .sidebar-list li {
        margin-bottom: 0.75rem;
    }

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-gray);
    transition: color 0.3s;
 
}

    .checkbox-label:hover {
        color: var(--color-black);
    }

.filter-checkbox {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #666666;
    
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
}

.filter-checkbox:checked + .checkmark {
    background-color: #ffcb05;
    border-color: #666666
}

    .filter-checkbox:checked + .checkmark::after {
        content: "✓";
        color: var(--color-white);
        font-size: 12px;
        font-weight: bold;
    }

.btn-secondary {
    background-color: transparent;
    color: var(--color-black);
    border: 1px solid var(--color-black);
    padding: 1rem 2rem;
    font-size: 0.875rem;
    letter-spacing: 0;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'vazir';
    width: 100%;
    margin-top: 1rem;
}

    .btn-secondary:hover {
        background-color: #ffcb05;
        color: var(--color-white);
    }

/* بخش محصولات */
.shop-products {
    flex: 1;
}

.products-header {
    margin-bottom: 2rem;
}

.products-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.products-count {
    color: var(--color-gray);
    font-size: 0.875rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.product-card {
    background: #fff;
    border: 1px solid #ddd;
    

    text-align: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 14px rgba(0,0,0,0.1);
    }

    .product-card img {
        width: 100%;
        height: 230px;
        object-fit: contain;
        border-bottom: 1px solid #eee;
        background: #fff;
        padding: 10px;
    }

.product-info {
    padding: 15px;
    text-align: center;
}

.product-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    height: 50px;
    overflow: hidden;
}

.rating {
    color: #fbc02d;
    font-size: 13px;
    margin-top: 5px;
}

.price {
    font-size: 15px;
    color: slategrey;
    font-weight: bold;
    margin-top: 8px;
    font-family:var(--font-primary);
}

.discount {
    background-color: #d32f2f;
    color: white;
    font-size: 12px;
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 5px;
    font-family: var(--font-primary);
}

.product-add {
    width: 100%;
}

/* صفحه‌بندی */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: var(--color-white);
    color: var(--color-black);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    font-family: var(--font-primary);
}

    .pagination-btn:hover:not(:disabled) {
        background-color: var(--color-black);
        color: var(--color-white);
    }

    .pagination-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
}

.pagination-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: var(--color-white);
    color: var(--color-black);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    font-family: var(--font-primary);
}

    .pagination-number.active,
    .pagination-number:hover {
        background-color: var(--color-black);
        color: var(--color-white);
    }

/* Mobile Filter Header - Hidden by default */
.mobile-filter-header {
    display: none;
}

.mobile-filter-toggle {
    display: none;
}

/* Mobile Sidebar Overlay - Hidden by default */
.mobile-sidebar-overlay {
    display: none;
}

/* ریسپانسیو */
@media (max-width: 1024px) {
    .shop-main {
        flex-direction: column;
    }

    .shop-sidebar {
        flex: 1;
        width: 100%;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-group {
        max-width: 100%;
    }

    .search-filters {
        justify-content: space-between;
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .shop-container {
        padding-top: 70px;
    }

    .shop-search,
    .shop-main {
        padding: 1.5rem 1rem;
    }

    .search-filters {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        justify-content: space-between;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }



    .hamburger {
        left: 1rem;
    }

    /* Mobile Filter Toggle - Only show on mobile */
    .mobile-filter-header {
        display: block;
        margin-bottom: 1rem;
        padding: 0;
    }

    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: #ffcb05;
        color: var(--color-white);
        border: none;
        padding: 1rem 1.5rem;
        border-radius: 8px;
        cursor: pointer;
        font-family: var(--font-primary);
        font-size: 1rem;
        transition: all 0.3s ease;
        width: 100%;
        justify-content: center;
    }

        .mobile-filter-toggle:hover {
            background: var(--color-gray-dark);
        }

    /* Hide sidebar by default on mobile */
    .shop-sidebar {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background: var(--color-white);
        z-index: 1100;
        padding: 2rem 1rem;
        overflow-y: auto;
        transition: right 0.3s ease-in-out;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    }

        .shop-sidebar.mobile-active {
            display: block;
            right: 0;
        }

    /* Mobile overlay */
    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1050;
    }

        .mobile-sidebar-overlay.active {
            display: block;
        }

    .product-card {
        flex-direction: row;
        text-align: right;
        align-items: center;
        height: auto;
    }

        .product-card img {
            width: 90%;
            height: auto;
            border: none;
            border-left: 1px solid #eee;
            margin: 0;
            padding: 10px;
        }

    .product-info {
        width: 65%;
        text-align: right;
        padding: 10px 15px;
    }

    .product-name {
        height: auto;
        margin: 0;
    }

    .rating, .price, .discount {
        display: inline-block;
        margin: 5px 10px 0 0;
    }
}
/* Search Section Layout */
.search-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 100%;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    
}

.search-input-group {
    display: flex;
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: var(--font-primary);
    font-size: 1rem;
    background-color: var(--color-white);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

    .search-input:focus {
        outline: none;
        border-color: var(--color-black);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }

.search-btn {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-gray);
    transition: color 0.3s;
    z-index: 2;
}

    .search-btn:hover {
        color: var(--color-black);
    }

.search-clear {
    position: absolute;
    left: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-gray);
    transition: color 0.3s;
    z-index: 2;
}

    .search-clear:hover {
        color: var(--color-black);
    }

.search-filters {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.filter-group {
    display: contents;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

    .filter-group label {
        font-size: 0.875rem;
        color: var(--color-gray);
        font-weight: 500;
    }

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
   
    background-color: var(--color-white);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

    .filter-select:focus {
        outline: none;
        border-color: var(--color-black);
    }

/* Autocomplete Styles */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 0.5rem;
    max-height: 400px; /* Increased height for desktop */
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.autocomplete-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--color-gray-light);
    border-radius: 12px 12px 0 0;
}

.autocomplete-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-dark);
    letter-spacing: -0.2px;
}

.autocomplete-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    color: var(--color-gray);
    transition: all 0.3s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .autocomplete-close:hover {
        background: rgba(0, 0, 0, 0.05);
        color: var(--color-black);
    }

.autocomplete-content {
    padding: 0.5rem 0;
}

.autocomplete-item {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
}

    .autocomplete-item:hover {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        transform: translateX(-4px);
    }

    .autocomplete-item:last-child {
        border-bottom: none;
    }

.autocomplete-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .autocomplete-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
.autocomplete-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.autocomplete-item:hover .autocomplete-image img {
    transform: scale(1.05);
}
.autocomplete-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-black);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.autocomplete-category {
    font-size: 0.75rem;
    color: var(--color-white);
    background: var(--color-gray);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
    letter-spacing: -0.1px;
}

.autocomplete-price {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 600;
    letter-spacing: -0.1px;
}
.autocomplete-sku {
    font-size: 0.7rem;
    color: var(--color-gray);
    background: rgba(0, 0, 0, 0.04);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    letter-spacing: -0.1px;
}
.autocomplete-loading,
.autocomplete-no-results,
.autocomplete-error {
    padding: 2rem 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.autocomplete-loading {
    color: var(--color-gray);
}
.autocomplete-no-results {
    color: var(--color-gray);
}
    .autocomplete-no-results::before {
        content: "🔍";
        font-size: 1.5rem;
        opacity: 0.7;
    }
.autocomplete-loading::before {
    content: "";
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top: 2px solid var(--color-black);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.autocomplete-error {
    color: #dc3545;
}

    .autocomplete-error::before {
        content: "⚠️";
        font-size: 1.5rem;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
/* Desktop-specific improvements */
@media (min-width: 1025px) {
    .autocomplete-results {
        max-height: 480px; /* Even taller for desktop */
        min-width: 450px; /* Minimum width for better appearance */
    }

    .autocomplete-item {
        padding: 1rem 1.5rem;
    }

    .autocomplete-image {
        width: 60px;
        height: 60px;
    }

    .autocomplete-name {
        font-size: 1rem;
    }
}
@media (max-width: 1024px) and (min-width: 769px) {
    .autocomplete-results {
        max-height: 420px;
        min-width: 400px;
    }
}
/* Responsive Design */
@media (max-width: 1024px) {
    .search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }

    .search-input-wrapper {
        max-width: 100%;
    }

    .search-filters {
        justify-content: space-between;
        width: 100%;
    }

    .filter-group {
        flex: 1;
        min-width: auto;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .autocomplete-results {
        max-height: 350px;
        position: fixed;
        left: 1rem;
        right: 1rem;
        top: 120px;
        margin-top: 0;
        z-index: 1100;
    }

    .autocomplete-item {
        padding: 0.75rem 1rem;
    }

    .autocomplete-image {
        width: 45px;
        height: 45px;
    }

    .autocomplete-name {
        font-size: 0.9rem;
    }

    .autocomplete-details {
        gap: 0.5rem;
    }

    .autocomplete-category {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }

    .autocomplete-price {
        font-size: 0.8rem;
    }
}

/* Scrollbar styling for autocomplete */
.autocomplete-results::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-results::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0 12px 12px 0;
}

.autocomplete-results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

    .autocomplete-results::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }
