/* ===== صفحة المنتجات المتناسقة مع ألوان الموقع ===== */

/* متغيرات CSS متناسقة مع theme.pink-gold.css */
:root {
    /* الألوان الأساسية - متطابقة مع الموقع */
    --pink: #F8C8DC;           /* الوردي الفاتح */
    --gold: #e83e8c;           /* الذهبي/الوردي الأساسي */
    --gold-dark: #B8860B;      /* الذهبي الداكن */
    --white: #ffffff;
    --accent: var(--gold);
    
    /* ألوان إضافية للتصميم */
    --light-pink: #F9E3EC;     /* وردي فاتح جداً للخلفيات */
    --border-color: #F3D0E0;   /* لون الحدود */
    --text-dark: #1a1a1a;      /* النص الداكن */
    --text-muted: #6c757d;     /* النص الثانوي */
    
    /* التدرجات */
    --gradient-hero: linear-gradient(135deg, var(--pink) 0%, var(--gold) 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, var(--light-pink) 100%);
    
    /* الظلال */
    --shadow-sm: 0 2px 8px rgba(232, 62, 140, 0.08);
    --shadow-md: 0 4px 16px rgba(232, 62, 140, 0.12);
    --shadow-lg: 0 8px 32px rgba(232, 62, 140, 0.16);
    
    /* الحدود والانتقالات */
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* ===== إعادة تعيين الأساسيات ===== */
* {
    box-sizing: border-box;
}

/* ===== قسم Hero المتناسق ===== */
.products-hero-consistent {
    background: var(--gradient-hero);
    padding: 4rem 0 3rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.products-hero-consistent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    color: var(--white);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* ===== تخطيط الصفحة الرئيسي ===== */
.products-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* ===== شريط الفلاتر الجانبي ===== */
.filters-sidebar-consistent {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
    border: 1px solid var(--border-color);
}

.filters-title {
    color: var(--gold);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-section h4 {
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* البحث */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--white);
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(232, 62, 140, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 0.9rem;
}

/* الفئات */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 0.5rem;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.category-link:hover,
.category-link.active {
    background: var(--light-pink);
    color: var(--gold);
    text-decoration: none;
}

.category-count {
    background: var(--gold);
    color: var(--white);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

/* شريط تمرير الأسعار */
.price-range-container {
    margin: 1rem 0;
}

.price-inputs {
/*    display: flex;
*/    gap: 0.5rem;
    margin-bottom: 1rem;
}

.price-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
}

.price-slider-container {
    position: relative;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin: 1rem 0;
}

.price-slider {
    position: absolute;
    height: 6px;
    background: var(--gold);
    border-radius: 3px;
}

/* ===== منطقة المنتجات الرئيسية ===== */
.products-main {
    min-height: 600px;
}

/* شريط التحكم العلوي */
.products-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.products-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.products-count strong {
    color: var(--gold);
    font-weight: 600;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-dark);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.sort-select:focus {
    outline: none;
    border-color: var(--gold);
}

.view-toggle {
    display: flex;
    background: var(--light-pink);
    border-radius: 8px;
    padding: 0.25rem;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

.view-btn.active {
    background: var(--gold);
    color: var(--white);
}

/* ===== شبكة المنتجات ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* موبايل: عرض منتجين في الصف الواحد */
@media (max-width: 575.98px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* بطاقة المنتج */
.product-card-consistent {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
}

.product-card-consistent:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--light-pink);
}

.product-image {
    width: 100%;
    height: 100%;
   
    transition: var(--transition);
}

.product-card-consistent:hover .product-image {
    transform: scale(1.05);
}

/* شارات المنتج */
.product-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2;
}

.product-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-sale {
    background: var(--gold);
}

.badge-new {
    background: #28a745;
}

.badge-out-of-stock {
    background: #dc3545;
}

/* أزرار العمل */
.product-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--transition);
}

.product-card-consistent:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--white);
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--gold);
    color: var(--white);
    transform: scale(1.1);
}

.action-btn.favorited {
    background: var(--gold);
    color: var(--white);
}

/* محتوى البطاقة */
.product-content {
    padding: 1.25rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title:hover {
    color: var(--gold);
}

/*.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}*/

.stars {
    display: flex;
    gap: 0.1rem;
}

.star {
    color: #ffc107;
    font-size: 0.85rem;
}

.star.empty {
    color: var(--border-color);
}

.rating-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
}

.original-price {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.discount-percent {
    background: var(--gold);
    color: var(--white);
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

/* زر إضافة للسلة */
.add-to-cart-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background: var(--gold);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart-btn:hover {
    background: var(--gold-dark);
    transform: translateY(-1px);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.add-to-cart-btn.added {
    background: #28a745;
}

/* ===== التجاوب للهاتف المحمول ===== */
@media (max-width: 768px) {
    .products-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filters-sidebar-consistent {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .filters-sidebar-consistent.show {
        left: 0;
    }
    
    .mobile-filter-btn {
        display: block;
        width: 100%;
        padding: 0.75rem;
        background: var(--gold);
        color: var(--white);
        border: none;
        border-radius: var(--border-radius);
        font-weight: 600;
        margin-bottom: 1rem;
        cursor: pointer;
    }
    
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    
    .mobile-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .stat-item {
        min-width: 200px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .products-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .controls-right {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .products-container {
        padding: 0 0.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-stats {
        gap: 0.75rem;
    }
    
    .stat-item {
        min-width: 150px;
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* ===== إشعارات Toast ===== */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-notification {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    transform: translateX(100%);
    animation: slideInToast 0.3s ease forwards;
}

.toast-notification.success {
    border-left: 4px solid #28a745;
}

.toast-notification.error {
    border-left: 4px solid #dc3545;
}

.toast-notification.info {
    border-left: 4px solid var(--gold);
}

@keyframes slideInToast {
    to {
        transform: translateX(0);
    }
}

/* ===== تحسينات إضافية ===== */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* تأثيرات التحميل */
.skeleton {
    background: linear-gradient(90deg, var(--light-pink) 25%, var(--border-color) 50%, var(--light-pink) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* تحسينات الوصولية */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* تركيز لوحة المفاتيح */
.product-card-consistent:focus-within,
.action-btn:focus,
.add-to-cart-btn:focus,
.search-input:focus,
.sort-select:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* تحسينات الطباعة */
@media print {
    .filters-sidebar-consistent,
    .mobile-filter-btn,
    .product-actions,
    .toast-container {
        display: none !important;
    }
    
    .products-layout {
        grid-template-columns: 1fr;
    }
    
    .product-card-consistent {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}