﻿/* تنسيق السلايدر */
#slider {
    width: 100%;
    height: auto;
    overflow: hidden;
    max-height: 300px;
}

    #slider .slider-img {
        width: 100%;
        height: auto;
        object-fit: contain;
        object-position: center;
    }

    #slider .carousel-caption {
        background: rgba(0, 0, 0, 0.6);
        padding: 10px;
        border-radius: 5px;
        text-align: center;
        color: #fff;
        max-width: 80%;
        margin: 0 auto;
    }

@media (min-width: 992px) {
    #slider .slider-img {
        width: auto;
        max-width: 100%;
        height: auto;
    }

    #slider {
        max-height: none;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: mintcream;
    }
}

/* تنسيق الأقسام */
/* قبل كان padding: 0 10px; */
#categories {
    text-align: center;
    margin-bottom: 30px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0;
}

    #categories .row {
        --bs-gutter-x: 0;
        margin-left: 0;
        margin-right: 0;
    }

    #categories .col-auto {
        padding-left: 0;
        padding-right: 0;
    }


    #categories .section-title {
        font-size: 22px;
        font-weight: bold;
        margin-bottom: 20px;
        color: #ff6600;
        text-align: right;
        padding: 0 10px;
    }

.category-card {
    width: 90px;
    height: auto;
    margin: 0 5px;
    text-align: center;
    display: inline-block;
    transition: transform 0.3s ease;
}

    .category-card .category-image {
        width: 70px;
        height: 70px;
        object-fit: cover;
        border-radius: 50%;
        margin: 0 auto;
        display: block;
    }

    .category-card .category-name {
        margin-top: 6px;
        font-size: 12px;
        font-weight: bold;
        color: #333;
        text-align: center;
    }

.category-link {
    text-decoration: none;
    color: inherit;
}

    .category-link:hover .category-card {
        transform: scale(1.1);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    }

/* ✅ أحدث الأقسام */
#latest-category-products .fw-bold {
    color: #ff6600;
    font-size: 20px;
    font-weight: 800;
}

#latest-category-products .btn-sm.text-primary {
    color: #007bff;
    font-weight: bold;
    border: 1px solid #007bff;
    padding: 2px 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
    font-size: 13px;
    background-color: white;
}

    #latest-category-products .btn-sm.text-primary:hover {
        color: white;
        background-color: #007bff;
        transform: scale(1.05);
    }

/* عرض الكل */
.view-all {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    background-color: #ff6600;
    box-shadow: 0 3px 10px rgba(255, 102, 0, 0.3);
}

    .view-all:hover {
        background-color: #cc5200;
        transform: translateX(-3px);
    }

/* بطاقات المنتجات */
.image-container {
    width: 100%;
    aspect-ratio: 1 / 1; /* يحافظ على الشكل المربّع */
    overflow: hidden;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 5px;
    background-color: #f8f9fa; /* يعطي خلفية خفيفة حتى الصورة تبين واضحة */
}



.card {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #000;
/*    white-space: nowrap;
*/    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.card-price {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 16px;
    gap: 5px;
}

    .card-price .old-price {
        text-decoration: line-through;
        color: gray;
        font-size: 14px;
    }

    .card-price .new-price {
        color: red;
        font-weight: bold;
        font-size: 16px;
    }

    .card-price .arrow {
        color: green;
        font-size: 16px;
    }

.card:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}


.card .btn-primary {
    background-color: #ff6600;
    color: #000;
    border: none;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
}

    .card .btn-primary:hover {
        background-color: #cc5200;
        color: #fff;
        transform: scale(1.05);
    }

/* شاشات صغيرة */
@media (max-width: 768px) {
    #latest-category-products .col-6,
    #recent-products .col-6 {
        flex: 0 0 48%;
        max-width: 48%;
    }
    .category-card {
        width: 75px;
    }

        .category-card .category-image {
            width: 60px;
            height: 60px;
        }

    .card {
        padding: 6px;
        font-size: 13px;
    }

    .card-title {
        font-size: 13px;
    }

    .card-price {
        flex-direction: column;
    }

        .card-price .arrow {
            display: none;
        }

    #latest-category-products .col-6 {
        flex: 0 0 48%;
        max-width: 48%;
    }
}

/* سلايدر المنتج */
.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

    .carousel-controls .btn {
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 5px;
        background-color: #000;
        color: white;
        border: none;
        transition: all 0.3s ease;
    }

        .carousel-controls .btn:hover {
            background-color: #cc5200;
            color: #fff;
        }


.section-header {
    color: #ff6600;
    font-size: 22px;
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
}

    .section-header i {
        color: #ff6600;
    }
/* شارة المخزون */
.stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: .35rem .6rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: .8rem;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,.15);
    z-index: 3;
}

    .stock-badge.success {
        background: linear-gradient(90deg,#2E7D32,#66BB6A);
    }

    .stock-badge.warning {
        background: linear-gradient(90deg,#FFA000,#FFD54F);
        color: #222;
    }

    .stock-badge.danger {
        background: linear-gradient(90deg,#E53935,#FF7043);
    }

/* شريط المتبقي */
.stock-bar {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 74px;
    height: 6px;
    border-radius: 999px;
    background: rgba(0,0,0,.08);
    overflow: hidden;
    z-index: 2;
}

    .stock-bar > span {
        display: block;
        height: 100%;
    }

/* شريط "غير متوفر" القطري */
.ribbon-oos {
    position: absolute;
    top: 12px;
    left: -32px;
    z-index: 4;
    width: 170px;
    height: 30px;
    transform: rotate(-45deg);
    background: linear-gradient(90deg,#E53935,#FF7043);
    box-shadow: 0 3px 6px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .ribbon-oos span {
        color: #fff;
        font-weight: 800;
        font-size: .8rem;
        letter-spacing: .5px;
        transform: translate(-6px,2px); /* ينزّل النص بصريًا لمنتصف الشريط */
    }

/* لتعطيل الكارد عند النفاد */
.card.disabled {
    pointer-events: none;
    filter: grayscale(0);
}

    .card.disabled .image-container::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: .75rem .75rem 0 0;
        background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.10));
    }
@media (max-width: 768px) {
    .stock-badge {
        top: 8px;
        right: 8px;
        bottom: auto;
        left: auto;
        font-size: 0.75rem;
        padding: 3px 7px;
        border-radius: 12px;
        z-index: 5;
    }
}


@media (max-width: 576px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    /* بس الأقسام الهورزنتال نخليها صفر */
    #categories .container-fluid,
    #latest-category-products .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

}

/* شد المسافة بين السلايدر والأقسام */
#slider {
    margin-bottom: 1.25rem;
}
/* ~ mb-4 */
#categories {
    margin-top: 0;
}

    #categories .section-title {
        margin-bottom: .5rem;
    }

/* إلغاء أي حشوات زائدة في شريط الأقسام على الموبايل */
@media (max-width: 576px) {
    #categories .container-fluid {
        padding-left: 0;
        padding-right: 0;
    }

    #cats-strip {
        padding-left: 8px;
        padding-right: 8px;
    }
    /* خفيف للتماس */
}
/* زر CTA لامع – “الأقسام التي تم تحديثها مؤخراً” */
.btn-cta {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    padding: 10px 18px;
    font-weight: 800;
    letter-spacing: .2px;
    color: #fff;
    background: linear-gradient(135deg,#ff9800,#ff6a00);
    box-shadow: 0 8px 18px rgba(255,122,0,.35);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

    .btn-cta .bi {
        font-size: 1.1rem;
    }

    .btn-cta:hover {
        transform: translateY(-1px);
        box-shadow: 0 12px 22px rgba(255,122,0,.45);
        filter: brightness(1.02);
    }

    .btn-cta:active {
        transform: translateY(0);
        filter: brightness(.95);
    }

    /* لمعة متحركة */
    .btn-cta::after {
        content: '';
        position: absolute;
        inset: 0;
        transform: skewX(-20deg) translateX(-150%);
        background: linear-gradient(120deg,transparent,rgba(255,255,255,.35),transparent);
        animation: mxShine 2.2s linear infinite;
    }

@keyframes mxShine {
    0% {
        transform: skewX(-20deg) translateX(-150%);
    }

    100% {
        transform: skewX(-20deg) translateX(150%);
    }
}

/* حالة التحميل (اختياري: نضيف انميشن سبنر صغيرة) */
.btn-cta.is-loading {
    pointer-events: none;
    opacity: .95;
}

    .btn-cta.is-loading::before {
        content: '';
        display: inline-block;
        width: 1rem;
        height: 1rem;
        margin-inline-end: .4rem;
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,.6);
        border-top-color: #fff;
        animation: mxSpin .8s linear infinite;
        vertical-align: -2px;
    }

@keyframes mxSpin {
    to {
        transform: rotate(360deg);
    }
}


/* الحاوية لا تقصّ الشارة النازلة */
.product-card .image-container {
    position: relative;
    overflow: visible;
    background: #fff;
    border-radius: 12px;
    /* خليها مربعة ونوسّط الصورة بداخلها */
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* الصورة: عرض/ارتفاع 100% وبلا قصّ */
.product-card .product-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 👈 حتى تظهر بكامل أبعادها */
}

/* شارة ماتركس – أصغر بالموبايل وتكبر تدريجياً */
.matrix-badge {
    position: absolute;
    right: 8px; /* أسفل يمين */
    bottom: -10px; /* ينزل جزء منها تحت الصورة */
    width: 42px; /* حجم أصغر للموبايل */
    height: auto; /* يحافظ على الأسبكت */
    z-index: 3;
    pointer-events: none;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
}

/* شاشات ≥ 576px */
@media (min-width: 576px) {
    .matrix-badge {
        width: 48px;
        bottom: -12px;
    }
}

/* شاشات ≥ 768px (تابلت) */
@media (min-width: 768px) {
    .matrix-badge {
        width: 56px;
        bottom: -12px;
    }
}

/* شاشات ≥ 992px (ديسكتوب) */
@media (min-width: 992px) {
    .matrix-badge {
        width: 64px;
        bottom: -14px;
    }
}

/* (اختياري) لو حسّيت الشارة تغطي العنوان شوي */
.product-card.has-matrix-badge .card-body {
    padding-top: 14px;
}

