:root {
    --gold-dark: #C9A100;
    --gold: #FFD700;
    --gold-light: #FFE55C;
    --black: #000000;
    --white: #ffffff;
    --gray-dark: #1a1a1a;
    --gray-light: #f5f5f5;
    --red: #dc2626;
    --green: #22c55e;
    --background-color: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    --border-color: #333;
}

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

html {
    background: #000;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: var(--white);
    direction: rtl;
    min-height: 100vh;
}

/* Header */
.header {
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.5rem 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-search-section {
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
    padding: 0 0 0.5rem 0;
}

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

.store-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 75px;
    padding: 0.5rem 0;
}

.header-search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid var(--gold);
    border-radius: 25px;
    background: rgba(0,0,0,0.8);
    color: var(--white);
    font-size: 1rem;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    backdrop-filter: blur(5px);
    transition: border-color 0.2s ease;
}

.header-search-input:focus {
    outline: none;
    border-color: var(--gold-light);
}

.store-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    border: 3px solid var(--gold);
    padding: 5px;
    background: rgba(255,215,0,0.1);
    box-shadow: 0 0 10px rgba(255,215,0,0.2);
    transition: transform 0.2s ease;
}

.store-logo:hover {
    transform: scale(1.02);
}

.store-name {
    color: var(--gold);
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    text-shadow: 0 0 5px rgba(255,215,0,0.2);
    margin: 0;
}

/* Ensure brand (logo + name) is perfectly centered */
.header .store-brand {
    justify-content: center !important;
    align-items: center !important;
    margin-inline: auto;
    max-width: max-content;
}

/* Search Section */
.search-section {
    background: linear-gradient(135deg, rgba(26,26,26,0.9) 0%, rgba(0,0,0,0.9) 100%);
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,215,0,0.3);
    backdrop-filter: blur(5px);
}

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

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.search-input {
    width: 100%;
    padding: 1.2rem 3rem 1.2rem 1.5rem;
    border: 2px solid var(--gold);
    border-radius: 50px;
    background: rgba(0,0,0,0.8);
    color: var(--white);
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
    backdrop-filter: blur(5px);
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--gold-light);
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 1.3rem;
}

/* Categories */
.categories {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 0.5rem 0.8rem;
    background: rgba(255,215,0,0.1);
    border: 2px solid var(--gold);
    border-radius: 25px;
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    margin: 3px 0;
}

.category-btn:hover {
    background: var(--gold);
    color: var(--black);
    transform: translateY(-1px);
}

.category-btn.active {
    background: var(--gold);
    color: var(--black);
}

/* Products Grid */
.products-section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 10px 1rem 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 10px;
    max-width: 1400px;
    margin: 10px auto 0;
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Product Card - New Design */
.product-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border: 3px solid #FFD700;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.15s ease;
    backdrop-filter: blur(10px);
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    text-align: center;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: #FFE55C;
    box-shadow: 0 6px 20px rgba(255,215,0,0.3), 0 3px 10px rgba(0,0,0,0.3);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px 12px 0 0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.15s ease;
    background: #333;
    border-radius: 0;
    opacity: 1;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

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

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff3b3b, #ff6b6b) !important;
    color: white !important;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 800;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(255, 59, 59, 0.3);
    transform: rotate(-5deg);
    border: none !important;
    text-decoration: none !important;
    pointer-events: none;
    text-shadow: 0 0 3px rgba(255,255,255,0.3);
}

.product-content {
    padding: 0.5rem 1rem 0.8rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: flex-start;
    gap: 0.1rem;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.1rem;
    margin-top: 0.3rem;
    line-height: 1.3;
    min-height: 2.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Amiri', serif;
}



.product-description {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 0.1rem;
    line-height: 1.4;
    min-height: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-container {
    margin-bottom: 0.3rem;
}

.old-price {
    color: #dc2626;
    text-decoration: line-through;
    font-size: 1rem;
    margin-left: 0.5rem;
    opacity: 0.9;
    font-weight: 600;
}

.new-price {
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: 900;
    font-family: 'Amiri', serif;
    text-shadow: 0 0 5px rgba(255,215,0,0.2);
}

.currency {
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 2px;
}

.stock-status {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 10px;
}

.in-stock {
    background: rgba(34, 197, 94, 0.2);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.out-of-stock {
    background: rgba(220, 38, 38, 0.2);
    color: var(--red);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.order-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--black);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 2px solid var(--gold);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(255,215,0,0.2);
    position: relative;
    overflow: hidden;
}

.order-btn:hover {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    color: var(--black);
    border: 2px solid #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.6), 0 0 15px rgba(0,0,0,0.8);
}

.order-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Info Message Section */
.info-message-section {
    padding: 1.5rem 0;
    background: rgba(0,0,0,0.8);
    border-top: 1px solid var(--gold);
    border-bottom: 1px solid var(--gold);
    margin-bottom: 2rem;
    position: relative;
}

.info-message-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.info-message-text {
    color: #dc2626;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.7;
    margin: 0;
    text-shadow: 0 1px 2px rgba(220, 38, 38, 0.1);
    position: relative;
}

.info-message-text::before {
    content: '💡';
    margin-left: 0.5rem;
    font-size: 1.2rem;
}

.info-message-text::after {
    content: '💡';
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Responsive Design for Info Message */
@media (max-width: 768px) {
    .info-message-section {
        padding: 1rem 0;
        margin-bottom: 1.5rem;
    }
    
    .info-message-container {
        padding: 0 1rem;
    }
    
    .info-message-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .info-message-text::before,
    .info-message-text::after {
        font-size: 1rem;
        margin: 0 0.3rem;
    }
}

@media (max-width: 480px) {
    .info-message-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .info-message-text::before,
    .info-message-text::after {
        font-size: 0.9rem;
        margin: 0 0.2rem;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 1rem 1.5rem;
    background: rgba(255,215,0,0.1);
    border: 2px solid var(--gold);
    border-radius: 12px;
    color: var(--gold);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 600;
}

.page-link:hover,
.page-link.active {
    background: var(--gold);
    color: var(--black);
    transform: translateY(-1px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 1rem;
}

.empty-text {
    color: #ccc;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-search-section {
        padding: 0 0 0.25rem 0;
    }

    .header-search {
        max-width: 100%;
        margin: 0;
    }

    .store-logo {
        width: 40px;
        height: 40px;
    }

    .store-name {
        font-size: 1rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .product-card {
        min-height: 500px;
    }

    .product-image-container {
        height: 250px;
    }

    .categories {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .category-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.8rem;
    }
    
    .product-card {
        min-height: 450px;
    }
    
    .product-image-container {
        height: 200px;
    }
    
    .product-card:hover .product-image {
        transform: scale(1.01);
    }

    .search-input {
        font-size: 1rem;
        padding: 1rem 2.5rem 1rem 1rem;
    }
    
    .product-content {
        padding: 1.2rem;
    }

    .product-title {
        font-size: 1.1rem;
        animation: none;
        text-shadow: none;
        color: var(--gold);
    }

    .new-price {
        font-size: 1.4rem;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    .product-card {
        transition: transform 0.1s ease;
    }
    
    .product-card:hover {
        transform: translateY(-1px);
    }
    
    .product-image {
        transition: transform 0.1s ease;
    }
    
    .product-card:hover .product-image {
        transform: scale(1.01);
    }
    
    .order-btn {
        transition: transform 0.1s ease;
    }
    
    .order-btn:hover {
        transform: translateY(0);
    }
    
    .category-btn {
        transition: background-color 0.1s ease, color 0.1s ease;
    }
    
    .category-btn:hover {
        transform: none;
    }
}

/* Disable animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
