/* ===================================
   Frontend CSS - واجهة العملاء
   =================================== */

/* تنسيقات عامة */
:root {
    /* اللون الأساسي */
    --primary-color: #E30613;
    --primary-dark: #B8000A;
    --primary-light: #FF1A2A;

    /* الأسود */
    --secondary-color: #000000;
    --dark-color: #0B0B0B;
    --dark-light: #151515;
    --dark-card: #1C1C1C;

    /* الخلفيات */
    --light-color: #F5F5F5;
    --white-color: #FFFFFF;

    /* النصوص */
    --text-color: #222222;
    --text-light: #FFFFFF;
    --muted-color: #777777;

    /* الحدود */
    --border-color: #DDDDDD;

    /* الحالات */
    --success-color: #28A745;
    --danger-color: #E30613;
    --warning-color: #FFC107;
}


/* ===================================
   تنسيقات عامة
   =================================== */

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

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


/* ===================================
   Navbar
   =================================== */

.navbar {
    background-color: var(--secondary-color);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.25);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color) !important;
}

.nav-link {
    color: var(--white-color) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 700;
}


/* خط أحمر تحت الرابط النشط */

.nav-link.active::after {
    content: '';
    display: block;
    width: 35px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px auto 0;
    border-radius: 5px;
}


/* ===================================
   Cart Badge
   =================================== */

.cart-badge {
    position: relative;
}

.cart-badge .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
}


/* ===================================
   Hero Section / Slider
   =================================== */

.hero-slider {
    height: 500px;
    background:
        linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.95),
            rgba(20, 20, 20, 0.85),
            rgba(227, 6, 19, 0.8)
        );
}

.carousel-item {
    height: 500px;
}

.carousel-item img {
    object-fit: cover;
    height: 100%;
    width: 100%;
}


/* طبقة داكنة فوق الصور */

.carousel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.75),
        rgba(0, 0, 0, 0.25),
        rgba(0, 0, 0, 0.7)
    );
    z-index: 1;
}

.carousel-caption {
    background: transparent;
    padding: 0;
    border-radius: 0;
    z-index: 2;
}

.carousel-caption h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--white-color);
}

.carousel-caption h1 span {
    color: var(--primary-color);
}

.carousel-caption p {
    font-size: 1.1rem;
    color: var(--white-color);
}


/* ===================================
   زر تسوق الآن
   =================================== */

.btn-shop-now {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-shop-now:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(227, 6, 19, 0.35);
}


/* ===================================
   Categories Section
   =================================== */

.categories-section {
    padding: 4rem 0;
    background-color: var(--light-color);
}

.category-card {
    background: var(--white-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    height: 100%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.category-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card h4 {
    color: var(--dark-color);
    font-weight: 600;
}

.category-card:hover h4 {
    color: var(--primary-color);
}


/* ===================================
   Products Section
   =================================== */

.products-section {
    padding: 4rem 0;
    background-color: var(--white-color);
}


/* ===================================
   Section Title
   =================================== */

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--dark-color);
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 5px;
}


/* ===================================
   Product Card
   =================================== */

.product-card {
    background: var(--white-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
    cursor: pointer;
    border: 1px solid #eeeeee;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    border-color: rgba(227, 6, 19, 0.25);
}


/* ===================================
   Product Image
   =================================== */

.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
    background-color: #fafafa;
}

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

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


/* ===================================
   Product Badge
   =================================== */

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.product-badge.new {
    background-color: var(--secondary-color);
    color: white;
}

.product-badge.sale {
    background-color: var(--primary-color);
    color: white;
}


/* ===================================
   Product Actions
   =================================== */

.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.action-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}


/* ===================================
   Product Info
   =================================== */

.product-info {
    padding: 1.5rem;
}

.product-category {
    color: var(--muted-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    min-height: 50px;
}

.product-title:hover {
    color: var(--primary-color);
}


/* ===================================
   Product Rating
   =================================== */

.product-rating {
    color: #F59E0B;
    margin-bottom: 0.5rem;
}

.product-rating i {
    font-size: 0.9rem;
}

.product-rating span {
    color: var(--muted-color);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}


/* ===================================
   Product Price
   =================================== */

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

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

.old-price {
    font-size: 1.1rem;
    color: #888;
    text-decoration: line-through;
}


/* ===================================
   Add Cart Button
   =================================== */

.btn-add-cart {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-add-cart:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(227, 6, 19, 0.25);
}


/* ===================================
   Filters Section
   =================================== */

.filters-section {
    background-color: var(--white-color);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.price-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-range input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.price-range input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(227, 6, 19, 0.1);
}


/* ===================================
   Cart Page
   =================================== */

.cart-section {
    padding: 4rem 0;
}

.cart-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.cart-table table {
    width: 100%;
}

.cart-table th {
    background-color: var(--dark-color);
    color: white;
    padding: 1rem;
    font-weight: 600;
}

.cart-table td {
    padding: 1.5rem 1rem;
    vertical-align: middle;
}

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


/* ===================================
   Quantity Control
   =================================== */

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.quantity-control button:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quantity-control input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 5px;
}

.quantity-control input:focus {
    outline: none;
    border-color: var(--primary-color);
}


/* ===================================
   Remove Item
   =================================== */

.remove-item {
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.remove-item:hover {
    transform: scale(1.2);
    color: var(--primary-dark);
}


/* ===================================
   Cart Summary
   =================================== */

.cart-summary {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.cart-summary h4 {
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
    font-size: 1.3rem;
    font-weight: bold;
    border-bottom: none;
    color: var(--primary-color);
}


/* ===================================
   Checkout Button
   =================================== */

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

.btn-checkout:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(227, 6, 19, 0.25);
}


/* ===================================
   Footer
   =================================== */

.footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer h5 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.footer ul {
    list-style: none;
    padding: 0;
}

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

.footer ul li a {
    color: #CCCCCC;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer ul li a:hover {
    color: var(--primary-color);
}


/* ===================================
   Social Links
   =================================== */

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}


/* ===================================
   Footer Bottom
   =================================== */

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
    color: #888888;
}


/* ===================================
   Buttons - General
   =================================== */

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}


/* ===================================
   Links
   =================================== */

a {
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}


/* ===================================
   Form Controls
   =================================== */

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(227, 6, 19, 0.15);
}


/* ===================================
   Loading Animation
   =================================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ===================================
   Success Message
   =================================== */

.alert-custom {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}


/* ===================================
   Responsive
   =================================== */

@media (max-width: 768px) {

    .carousel-caption h1 {
        font-size: 2rem;
    }

    .carousel-caption p {
        font-size: 1rem;
    }

    .hero-slider,
    .carousel-item {
        height: 300px;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    .cart-table {
        overflow-x: auto;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .product-image {
        height: 220px;
    }
}