/**
 * سمة سوق الإمارات المحسنة - خفيفة وسريعة
 * Emirates Souq Optimized Theme - Light & Fast
 */

:root {
    /* الألوان الأساسية */
    --gold-primary: #D4AF37;
    --gold-light: #F4E4BC;
    --emerald-green: #50C878;
    --text-primary: #2C1810;
    --text-secondary: #6B4E3D;
    --bg-primary: #FEFEFE;
    --bg-card: #FFFFFF;
    --shadow-light: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-gold: 0 8px 25px rgba(212,175,55,0.3);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gold-light);
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold-primary);
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.02);
    color: var(--gold-primary);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-list a {
    padding: 0.7rem 1.2rem;
    background: var(--gold-primary);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

.nav-list a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
    background: var(--emerald-green);
    color: white;
}

/* Hero Section */
.hero-section {
    padding: 120px 0 60px;
    text-align: center;
    background: linear-gradient(135deg, #FEFEFE 0%, #F4E4BC 100%);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gold-primary);
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 25px;
    box-shadow: var(--shadow-light);
    overflow: hidden;
    border: 2px solid var(--gold-light);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
}

.search-btn {
    padding: 1rem 1.5rem;
    background: var(--gold-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--emerald-green);
}

/* Sections */
.section {
    padding: 60px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--gold-primary);
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--gold-light);
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-gold);
    border-color: var(--gold-primary);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.category-count {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Products */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 1rem 2rem;
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--gold-light);
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--gold-primary);
    color: white;
    border-color: var(--gold-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--gold-light);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    overflow: hidden;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-gold);
    border-color: var(--gold-primary);
}

.product-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.discount-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #FF6B6B;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 2;
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold-primary);
}

.original-price {
    color: var(--text-secondary);
    text-decoration: line-through;
    font-size: 1rem;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.feature {
    background: rgba(80,200,120,0.1);
    color: var(--emerald-green);
    padding: 0.3rem 0.7rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.btn {
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-family: inherit;
}

.whatsapp-btn {
    background: #25D366;
    color: white;
}

.whatsapp-btn:hover {
    background: #22C55E;
    transform: translateY(-2px);
    color: white;
}

.view-details {
    background: var(--gold-primary);
    color: white;
}

.view-details:hover {
    background: #B8860B;
    transform: translateY(-2px);
    color: white;
}

.add-to-cart {
    background: var(--emerald-green);
    color: white;
}

.add-to-cart:hover {
    background: #3CB371;
    transform: translateY(-2px);
    color: white;
}

/* Floating Buttons */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: var(--shadow-gold);
    color: white;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--gold-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.footer-section a:hover {
    color: var(--gold-primary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gold-light);
    border-top: 3px solid var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 0.8rem 0;
    }
    
    .nav-list {
        gap: 0.3rem;
        justify-content: center;
    }
    
    .nav-list a {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .hero-section {
        padding: 100px 0 40px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .categories-grid,
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-actions {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .tabs-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        width: 100%;
    }
}

/* Cart System - Minimal */
.cart-float {
    position: fixed;
    bottom: 90px;
    left: 20px;
    z-index: 1000;
    background: var(--gold-primary);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    font-size: 24px;
}

.cart-float:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: var(--shadow-gold);
    background: var(--emerald-green);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF6B6B;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transform: scale(0);
    transition: var(--transition);
}

.cart-count.show {
    transform: scale(1);
}

.cart-sidebar {
    position: fixed;
    top: 0;
    left: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: 8px 0 25px rgba(0,0,0,0.2);
    z-index: 10000;
    transition: left 0.4s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    left: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    padding: 2rem;
    background: var(--gold-primary);
    color: white;
    position: relative;
}

.cart-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.cart-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--gold-light);
    border-radius: 15px;
    margin-bottom: 1rem;
    background: white;
    transition: var(--transition);
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
    border-color: var(--gold-primary);
}

.cart-item-image {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.cart-item-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-primary);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 25px;
    height: 25px;
    border: 1px solid var(--gold-primary);
    background: white;
    color: var(--gold-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: var(--transition);
}

.quantity-btn:hover {
    background: var(--gold-primary);
    color: white;
}

.cart-quantity {
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.remove-item {
    background: #FF6B6B;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: var(--transition);
}

.remove-item:hover {
    background: #EE5A24;
    transform: scale(1.1);
}

.cart-footer {
    padding: 1.5rem;
    background: var(--gold-light);
    border-top: 1px solid var(--gold-primary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
}

.cart-total-price {
    color: var(--gold-primary);
    font-size: 1.3rem;
    font-weight: 800;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: var(--emerald-green);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.checkout-btn:hover {
    background: #3CB371;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.checkout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.empty-cart {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-cart-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

/* Filter Bar */
.filter-bar {
    background: var(--gold-light);
    padding: 1rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    text-align: center;
    display: none;
}

.filter-text {
    font-weight: 600;
    color: var(--text-primary);
}

.back-to-categories {
    background: var(--gold-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    margin-left: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
}

.back-to-categories:hover {
    background: var(--emerald-green);
    transform: translateY(-2px);
}

/* Performance optimizations */
* {
    will-change: auto;
}

img {
    loading: lazy;
}

/* Accessibility */
*:focus {
    outline: 2px solid var(--gold-primary);
    outline-offset: 2px;
}

::selection {
    background: rgba(212,175,55,0.3);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--gold-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #B8860B;
}