/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-color: #ffffff;
}

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

/* Header Styles */
.header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar {
    background: #f7fafc;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.language-selector {
    display: flex;
    justify-content: flex-end;
}

.language-selector select {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #4a5568;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
    padding: 0.5rem 0.75rem;
    min-width: 120px;
    transition: all 0.3s ease;
}

.language-selector select:hover {
    border-color: #4299e1;
}

.language-selector select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

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

/* Brand Styles */
.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.logo-placeholder {
    background: #4299e1;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.company-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Search Styles */
.search-container {
    display: flex;
    align-items: center;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 400px;
    min-width: 250px;
}

.search-container:focus-within {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
}

.search-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: #3182ce;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #4299e1;
    border: 2px solid #4299e1;
}

.btn-outline:hover {
    background: #4299e1;
    color: white;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #4a5568;
    cursor: pointer;
}

/* Navigation Styles */
.nav {
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 0;
}

.nav-list {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #4299e1;
    background: rgba(66, 153, 225, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: #4299e1;
    border-radius: 2px;
}

/* Main Content */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
}

/* Products Section */
.products-section {
    margin-bottom: 3rem;
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Product Card Styles */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

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

.product-image svg {
    width: 100%;
    height: auto;
    display: block;
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #e53e3e;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-prices {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.price-original {
    color: #a0aec0;
    text-decoration: line-through;
    font-size: 0.95rem;
}

.price-offer {
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 700;
}

.product-btn {
    width: 100%;
    justify-content: center;
}

/* Footer Styles */
.footer {
    background: #2d3748;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.footer-section p {
    color: #a0aec0;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #4299e1;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: #a0aec0;
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #4299e1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #4a5568;
    color: #a0aec0;
    font-size: 0.875rem;
}

/* Responsive Design - Mobile First */

/* Tablet styles */
@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-container {
        min-width: 300px;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .search-container {
        min-width: 400px;
    }
}

/* Mobile menu styles */
@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-main {
        flex-wrap: wrap;
    }
    
    .brand {
        order: 1;
    }
    
    .mobile-menu-toggle {
        order: 2;
    }
    
    .search-container {
        order: 3;
        width: 100%;
        max-width: none;
        min-width: auto;
        margin-top: 1rem;
    }
    
    .auth-buttons {
        order: 4;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .nav {
        display: none;
    }
    
    .nav.active {
        display: block;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-link {
        display: block;
        text-align: center;
        padding: 1rem;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .company-name {
        font-size: 1rem;
    }
    
    .logo-placeholder {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .products-grid {
        gap: 1.5rem;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn {
        width: 100%;
    }
}

/* Animations and transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }

/* Focus styles for accessibility */
.btn:focus,
.search-input:focus,
.nav-link:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid #2d3748;
    }
    
    .btn-outline {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .product-card {
        animation: none;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] .header-main {
    flex-direction: row-reverse;
}

[dir="rtl"] .brand {
    flex-direction: row-reverse;
}

[dir="rtl"] .search-container {
    direction: ltr; /* Keep search input LTR for better UX */
}

[dir="rtl"] .auth-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-list {
    direction: rtl;
}

[dir="rtl"] .footer-content {
    direction: rtl;
}

[dir="rtl"] .social-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .product-badge {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .language-selector {
    justify-content: flex-start;
}

/* Language selector improvements */
.language-selector select option {
    padding: 0.5rem;
    font-size: 0.875rem;
}
