/* Variables */
:root {
    --primary-color: #a70a10;
    --primary-hover: #8b0000;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --bg-light: #f8f8f8;
    --white: #ffffff;
    --border-color: #e5e5e5;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Tajawal', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-top {
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 0;
    text-align: center;
    font-size: 14px;
}

.header-main {
    padding: 15px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 5px;
}

.logo img {
    height: 50px;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark);
    transition: color 0.3s;
    padding: 10px 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-form {
    display: flex;
    background: var(--bg-light);
    border-radius: 25px;
    overflow: hidden;
}

.search-input {
    border: none;
    background: none;
    padding: 10px 20px;
    width: 200px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
}

.search-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    color: var(--text-light);
}

.cart-btn {
    position: relative;
    background: none;
    border: none;
    padding: 10px;
}

.cart-count {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary-color);
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-slider {
    position: relative;
    height: 500px;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
}

.slide-content {
    text-align: center;
    color: var(--white);
    padding: 20px;
}

.slide-content h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.slide-content p {
    font-size: 1.3rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.slide-btn {
    display: inline-block;
    background: var(--white);
    color: var(--primary-color);
    padding: 15px 40px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.slide-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.slider-dot.active {
    background: var(--white);
    transform: scale(1.2);
}

/* Products Section */
.products-section {
    padding: 60px 0;
}

.products-section.alt-bg {
    background: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 5;
}

.product-image {
    height: 220px;
    overflow: hidden;
    background: var(--bg-light);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.stars {
    color: #ffc107;
    font-size: 14px;
}

.reviews-count {
    color: var(--text-light);
    font-size: 13px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

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

.old-price {
    font-size: 0.95rem;
    color: var(--text-light);
    text-decoration: line-through;
}

/* Product Buttons */
.product-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.add-to-cart {
    width: 100%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s, transform 0.2s;
}

.add-to-cart:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.quick-buy-btn {
    width: 100%;
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.quick-buy-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Features Section */
.features-section {
    padding: 60px 0;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.feature {
    text-align: center;
    padding: 30px 20px;
}

.feature-icon {
    margin-bottom: 20px;
}

.feature h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.feature p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    height: 50px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.footer-col p {
    color: rgba(255,255,255,0.7);
    line-height: 1.8;
}

.footer-col h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul a {
    color: rgba(255,255,255,0.7);
    transition: color 0.3s;
}

.footer-col ul a:hover {
    color: var(--white);
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
}

.newsletter-form button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s;
}

.newsletter-form button:hover {
    background: var(--primary-hover);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

/* Cart Sidebar */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100%;
    background: var(--white);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
}

.close-cart {
    background: none;
    border: none;
    padding: 5px;
    color: var(--text-light);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-cart svg {
    margin-bottom: 20px;
}

.empty-cart p {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

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

.cart-item-details h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.4;
}

.item-price {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-controls button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s;
}

.qty-controls button:hover {
    background: var(--bg-light);
}

.remove-btn {
    background: none;
    border: none;
    padding: 5px;
    color: var(--text-light);
    transition: color 0.2s;
}

.remove-btn:hover {
    color: var(--primary-color);
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.cart-total-amount {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
}

.checkout-btn {
    width: 100%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    transition: background 0.3s;
}

.checkout-btn:hover {
    background: var(--primary-hover);
}

.continue-shopping {
    width: 100%;
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s;
}

.continue-shopping:hover {
    background: var(--bg-light);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: var(--white);
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 10000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-main {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 80px 30px 30px;
        gap: 0;
        transition: right 0.3s;
        z-index: 1001;
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .nav-link {
        padding: 15px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .search-form {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: 350px;
    }
    
    .slide-content h1 {
        font-size: 2rem;
    }
    
    .slide-content p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
    }
    
    .product-buttons {
        flex-direction: row;
    }
    
    .add-to-cart,
    .quick-buy-btn {
        flex: 1;
        padding: 10px;
        font-size: 13px;
    }
}
