:root {
    --primary-black: #000000;
    --primary-white: #ffffff;
    --primary-gold: #D4AF37;
    --secondary-gold: #F4E4C1;
    --dark-gray: #1a1a1a;
    --light-gray: #f5f5f5;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #333;
    --text-secondary: #666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--primary-white);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body.dark-mode {
    --primary-white: #1a1a1a;
    --primary-black: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --light-gray: #2a2a2a;
    background: var(--primary-black);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 4px;
}

/* Header */
.header {
    background: var(--primary-white);
    backdrop-filter: blur(10px);
    padding: clamp(0.75rem, 2vw, 1rem) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--glass-border);
}

body.dark-mode .header {
    background: var(--dark-gray);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 900;
    color: var(--primary-gold);
    text-decoration: none;
}

.logo img {
    width: clamp(35px, 5vw, 50px);
    height: clamp(35px, 5vw, 50px);
    border-radius: 50%;
}

.logo h1 {
    color: var(--primary-gold);
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 900;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2rem);
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: clamp(0.5rem, 1.5vw, 0.5rem) clamp(1rem, 3vw, 1rem);
    min-width: clamp(200px, 40vw, 300px);
    backdrop-filter: blur(10px);
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-primary);
    flex: 1;
    outline: none;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.cart-btn {
    background: var(--primary-gold);
    color: var(--primary-black);
    border: none;
    padding: clamp(0.6rem, 1.5vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
}

.cart-btn:hover {
    background: var(--secondary-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.cart-count {
    background: var(--primary-black);
    color: var(--primary-gold);
    border-radius: 50%;
    width: clamp(18px, 3vw, 20px);
    height: clamp(18px, 3vw, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    font-weight: 700;
}

body.dark-mode .cart-count {
    background: var(--primary-white);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem);
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
    position: relative;
    overflow: hidden;
    min-height: clamp(200px, 40vh, 300px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.hero h2 {
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    margin-bottom: clamp(0.5rem, 2vw, 1.5rem);
    color: var(--primary-white);
    font-weight: 900;
    position: relative;
    z-index: 2;
    line-height: 1.2;
}

.hero p {
    font-size: clamp(0.9rem, 3vw, 1.3rem);
    margin-bottom: clamp(1rem, 3vw, 2rem);
    color: var(--primary-white);
    opacity: 0.9;
    position: relative;
    z-index: 2;
    font-weight: 500;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Filters */
.filters-section {
    max-width: 1400px;
    margin: clamp(2rem, 5vw, 3rem) auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

.filters {
    display: flex;
    gap: clamp(0.5rem, 2vw, 1rem);
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(1rem, 3vw, 2rem);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-gold);
    color: var(--primary-black);
    border-color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

/* Products Grid */
.products-section {
    max-width: 1400px;
    margin: clamp(1.5rem, 4vw, 2rem) auto;
    padding: 0 clamp(1rem, 4vw, 2rem) clamp(2rem, 6vw, 4rem);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(250px, 30vw, 320px), 1fr));
    gap: clamp(1rem, 3vw, 2rem);
    margin-top: clamp(2rem, 5vw, 3rem);
}

.product-card {
    background: var(--primary-white);
    border: 1px solid var(--glass-border);
    border-radius: clamp(1rem, 3vw, 20px);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: clamp(300px, 40vw, 400px);
    margin: 0 auto;
}

body.dark-mode .product-card {
    background: var(--dark-gray);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.2);
    border-color: var(--primary-gold);
}

.product-image {
    width: 100%;
    height: clamp(180px, 25vw, 220px);
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
}

.product-info {
    padding: clamp(1rem, 3vw, 1.5rem);
}

.product-category {
    color: var(--primary-gold);
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-title {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: clamp(0.5rem, 2vw, 0.75rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    min-height: clamp(2rem, 6vw, 2.6rem);
}

.product-description {
    opacity: 0.8;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    margin-bottom: clamp(1rem, 3vw, 1.25rem);
    line-height: 1.5;
    color: var(--text-secondary);
    min-height: clamp(2.5rem, 7vw, 3rem);
}

.product-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-type-badge.digital {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.product-type-badge.physical {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.product-type-badge i {
    font-size: 0.9rem;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(0.5rem, 2vw, 0.75rem);
}

.product-price {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    color: var(--primary-gold);
    font-weight: 900;
    flex: 1;
}

.add-to-cart-btn {
    background: var(--primary-gold);
    color: var(--primary-black);
    border: none;
    padding: clamp(0.5rem, 1.5vw, 0.6rem) clamp(1rem, 3vw, 1.2rem);
    border-radius: clamp(1rem, 3vw, 20px);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    white-space: nowrap;
}

.add-to-cart-btn:hover {
    background: var(--secondary-gold);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

/* Loading */
.loading {
    text-align: center;
    padding: 4rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(212, 175, 55, 0.3);
    border-top: 4px solid var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--primary-white);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

body.dark-mode .modal-content {
    background: var(--dark-gray);
}

.modal-header {
    padding: 2.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.8rem;
    color: var(--primary-gold);
    font-weight: 900;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary-gold);
    background: var(--glass-bg);
}

.modal-body {
    padding: 2.5rem;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100%;
    background: var(--primary-white);
    border-left: 1px solid var(--glass-border);
    z-index: 2001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

body.dark-mode .cart-sidebar {
    background: var(--dark-gray);
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 2.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 1.5rem;
    color: var(--primary-gold);
    font-weight: 900;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    border-radius: 15px;
    margin-bottom: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.cart-item-price {
    color: var(--primary-gold);
    font-weight: 600;
    font-size: 1rem;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:hover {
    background: rgba(255, 68, 68, 0.1);
    transform: scale(1.1);
}

.cart-footer {
    padding: 2.5rem;
    border-top: 1px solid var(--glass-border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 1.4rem;
    font-weight: 700;
}

.cart-total span:last-child {
    color: var(--primary-gold);
}

.checkout-btn {
    width: 100%;
    background: var(--primary-gold);
    color: var(--primary-black);
    border: none;
    padding: 1.25rem;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background: var(--secondary-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

/* Responsive */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .header-content {
        padding: 0 1.5rem;
    }
    
    .products-section {
        padding: 0 1.5rem 3rem;
    }
}

@media (max-width: 992px) {
    .hero h2 {
        font-size: 2.8rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .filters {
        gap: 0.75rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .search-bar {
        min-width: 100%;
        max-width: 400px;
    }

    .hero {
        padding: 4rem 1rem;
    }
    
    .hero h2 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
    }
    
    .products-section {
        padding: 0 1rem 2rem;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
    
    .filters-section {
        padding: 0 1rem;
    }
    
    .filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .product-card {
        max-width: none;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1rem;
        min-height: 2.2rem;
    }
    
    .product-description {
        font-size: 0.85rem;
        min-height: 2.5rem;
    }
    
    .product-price {
        font-size: 1.2rem;
    }
    
    .add-to-cart-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .cart-sidebar {
        width: 100%;
    }
    
    .cart-header,
    .cart-footer {
        padding: 1.5rem;
    }
    
    .cart-items {
        padding: 1rem;
    }
    
    .cart-item {
        padding: 1rem;
        gap: 1rem;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .filters {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

@media (max-width: 400px) {
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .cart-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .cart-count {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.empty-state {
    text-align: center;
    padding: 4rem;
    opacity: 0.7;
}

.empty-state i {
    font-size: 5rem;
    color: var(--primary-gold);
    margin-bottom: 2rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}
