/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066cc;
    --secondary-color: #00a8ff;
    --accent-color: #ff6b6b;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #333;
    --border-color: #ddd;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #f8f9fa;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* شريط التنقل */
.navbar {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo i {
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.cart-count {
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    margin-right: 5px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* البانر الرئيسي */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* الأزرار */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* الفئات */
.categories-section {
    padding: 60px 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark-color);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.category-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.1rem;
    color: var(--dark-color);
}

/* المنتجات */
.products-section {
    padding: 60px 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 10;
}

.product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-info {
    padding: 1.5rem;
}

.product-brand {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.product-info h3 {
    margin: 0.5rem 0;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.product-price {
    margin: 1rem 0;
}

.current-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-left: 10px;
}

.old-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.product-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 0.9rem;
}

/* المميزات */
.features-section {
    padding: 60px 0;
    background: var(--light-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
}

.feature-item i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-item h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

/* صفحة المنتجات */
.products-page {
    padding: 40px 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    min-width: 300px;
}

.search-form button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.products-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 5px;
    transition: all 0.3s;
}

.category-list a:hover,
.category-list a.active {
    background: var(--primary-color);
    color: white;
}

.products-main {
    min-height: 500px;
}

.no-products {
    text-align: center;
    padding: 4rem;
    color: #999;
}

.no-products i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* صفحة تفاصيل المنتج */
.product-detail {
    padding: 40px 0;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

.product-image-large {
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-details h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.product-category {
    color: var(--primary-color);
    font-weight: 600;
}

.product-brand-info {
    margin: 1rem 0;
    color: #666;
}

.product-price-large {
    margin: 2rem 0;
}

.product-price-large .current-price {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.product-price-large .old-price {
    font-size: 1.5rem;
    margin-right: 15px;
}

.discount-text {
    display: block;
    color: var(--success-color);
    font-weight: 600;
    margin-top: 5px;
}

.product-description {
    margin: 2rem 0;
}

.product-description h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.product-stock {
    margin: 1rem 0;
    font-weight: 600;
}

.in-stock {
    color: var(--success-color);
}

.out-of-stock {
    color: var(--error-color);
}

.product-actions-large {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.qty-btn {
    padding: 10px 15px;
    border: none;
    background: var(--light-color);
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
}

.quantity-selector input {
    width: 60px;
    padding: 10px;
    border: none;
    text-align: center;
    font-size: 1rem;
}

.related-products {
    margin-top: 3rem;
}

.related-products h2 {
    margin-bottom: 2rem;
    color: var(--dark-color);
}

/* صفحة السلة */
.cart-page {
    padding: 40px 0;
}

.empty-cart {
    text-align: center;
    padding: 4rem;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.empty-cart i {
    font-size: 5rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.cart-items {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr 150px 120px 50px;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 5px;
    background: var(--light-color);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
}

.cart-item-total {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.btn-remove {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}

.cart-summary {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
    border-bottom: none;
    border-top: 2px solid var(--dark-color);
    margin-top: 1rem;
    padding-top: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
}

/* صفحة الدفع */
.checkout-page {
    padding: 40px 0;
}

.checkout-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

.checkout-form-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.checkout-form-section h2 {
    margin: 2rem 0 1rem;
    color: var(--dark-color);
}

.checkout-form-section h2:first-child {
    margin-top: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.payment-methods {
    margin: 1.5rem 0;
}

.payment-option {
    display: block;
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.payment-option input[type="radio"] {
    margin-left: 10px;
}

.checkout-summary {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.order-items-summary {
    margin-bottom: 1.5rem;
}

.order-item-summary {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.order-item-info {
    display: flex;
    justify-content: space-between;
}

.summary-totals {
    margin-top: 1.5rem;
}

.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

/* صفحة النجاح */
.success-page {
    padding: 60px 0;
}

.success-content {
    text-align: center;
    background: white;
    padding: 4rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    font-size: 5rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.success-content h1 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.success-message {
    font-size: 1.2rem;
    margin: 1.5rem 0;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* صفحة الفئات */
.categories-page {
    padding: 40px 0;
}

.categories-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.category-card-large {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.category-card-large:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.category-card-large h2 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.category-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* التذييل */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    color: #ccc;
}

.text-center {
    text-align: center;
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .products-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .product-detail-content {
        grid-template-columns: 1fr;
    }

    .cart-content {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }

    .cart-item-quantity,
    .cart-item-total,
    .cart-item-actions {
        grid-column: 1 / -1;
    }

    .checkout-content {
        grid-template-columns: 1fr;
    }

    .checkout-summary {
        position: static;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}
