/* === TEMP FIX FOR ADD TO CART BUTTON (TEST ONLY) === */

/* خود دکمه */
.product-add {
    position: relative !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 20 !important;
}

/* وقتی دکمه disabled یا added می‌شود */
.product-add:disabled,
.product-add.added {
    display: inline-flex !important;
    opacity: 0.8 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* کارت محصول */
.product-card,
.product-item {
    position: relative !important;
    overflow: visible !important;
}

/* لینک‌هایی که کل کارت رو می‌پوشونن (مشکل رایج Home) */
.product-card a,
.product-item a {
    pointer-events: auto !important;
}

/* pseudo-element های تم که کلیک رو می‌دزدن */
.product-card::before,
.product-card::after,
.product-item::before,
.product-item::after {
    pointer-events: none !important;
}
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    border-bottom: 1px solid #f0f0f0;
}

.category-item:last-child {
    border-bottom: none;
}

.category-header-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    transition: background 0.2s ease;
}

.category-header-item:hover {
    background: #f8f9fa;
}

.category-link {
    display: flex;
    align-items: center;
    flex: 1;
    color: #333;
    text-decoration: none;
    gap: 12px;
}

.category-link:hover {
    color: #4CAF50;
}

.category-link i {
    font-size: 20px;
    color: #4CAF50;
    width: 28px;
    text-align: center;
}

.category-name {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

.dropdown-arrow {
    font-size: 14px;
    color: #999;
    transition: transform 0.3s ease;
    cursor: pointer;
    padding: 10px;
    margin-left: -10px;
}

.dropdown-arrow:hover {
    color: #4CAF50;
}

.subcategory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fafafa;
}

.category-item.active .subcategory-list {
    border-top: 1px solid #e9ecef;
}

.subcategory-item {
    border-bottom: 1px solid #f0f0f0;
}

.subcategory-item:last-child {
    border-bottom: none;
}

.subcategory-link {
    display: flex;
    align-items: center;
    padding: 12px 20px 12px 50px;
    color: #666;
    text-decoration: none;
    gap: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.subcategory-link:hover {
    background: #f0f0f0;
    color: #4CAF50;
    padding-right: 55px;
}

.subcategory-link i {
    font-size: 12px;
    color: #999;
}

.category-list .text-center {
    padding: 30px 20px;
    color: #666;
    font-size: 14px;
}

.category-list .fa-spinner {
    font-size: 24px;
    color: #4CAF50;
}

.empty-state,
.error-state {
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
}

.empty-state {
    color: #999;
}

.error-state {
    color: #dc3545;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-item.active .subcategory-list {
    animation: slideDown 0.3s ease;
}

@media (max-width: 768px) {
    .category-header-item {
        padding: 12px 15px;
    }

    .category-name {
        font-size: 14px;
    }

    .subcategory-link {
        padding: 10px 15px 10px 40px;
        font-size: 13px;
    }
}


/* Search Wrapper */
.search-wrapper {
    position: relative;
    width: 100%;
}

/* Dropdown Container */
.search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 450px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-dropdown.show {
    display: block;
}

/* نتایج جستجو */
.search-results {
    padding: 8px;
}

/* هر آیتم محصول */
.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.search-item:hover {
    background: #f5f5f5;
}

/* تصویر محصول */
.search-item-img {
    width: 55px;
    height: 55px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.search-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* اطلاعات محصول */
.search-item-info {
    flex: 1;
}

.search-item-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #333;
}

/* متای محصول */
.search-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* قیمت */
.search-item-price {
    display: flex;
    gap: 6px;
}

.original-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.final-price {
    font-size: 14px;
    font-weight: 700;
    color: #28a745;
}

/* وضعیت موجودی */
.search-item-stock {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.search-item-stock.available {
    background: #d4edda;
    color: #155724;
}

.search-item-stock.unavailable {
    background: #f8d7da;
    color: #721c24;
}

/* Toast Notification */
.search-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 10px;
    min-width: 250px;
}

.search-toast.show {
    display: flex;
    animation: slideDown 0.3s ease;
}

.search-toast.error {
    border-right: 4px solid #dc3545;
}

.search-toast.info {
    border-right: 4px solid #17a2b8;
}

.search-toast i {
    font-size: 18px;
}

.search-toast.error i {
    color: #dc3545;
}

.search-toast.info i {
    color: #17a2b8;
}

.search-toast p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .search-item-img {
        width: 50px;
        height: 50px;
    }
}

