@font-face {
    font-family: 'El Messiri';
    src: url('https://www.sult4n.com/shop/assets/css/fonts/ElMessiri-Medium.woff2') format('woff2'),
        url('https://www.sult4n.com/shop/assets/css/fonts/ElMessiri-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'El Messiri';
    background: #f5f5f5;
    line-height: 1.8;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 20px 0;
}
a {text-decoration: none;}
/* Header */
header {
    background: #ffffff;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

header h1, header h2 {
    text-align: center;
    color: #222;
    margin-bottom: 10px;
}
h1, h2 {text-align: center; color: #000;}
nav {
    text-align: center;
    margin-top: 10px;
}

nav a {
    margin: 0 10px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

nav a:hover {
    color: #007bff;
}

/* Product Grid */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding-bottom: 50px;
}

.product {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* الجزء العلوي من الكرت */
.product-top {
    flex: 1; /* يتمدّد ليملأ المساحة */
}

/* الأزرار دائمًا أسفل */
.product-actions {
    margin-top: auto;
}


.product img {
    width: 100%;
    height: 200px;
    border-radius: 5px;
    object-fit: cover;
}

.product .price {
    color: #FF0000;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 22px;
}

.product a {
    display: inline-block;
    padding: 10px 15px;
    background: #007bff;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
}

.product a:hover {
    background: #0056b3;
}

/* الاكثر مبيعا */
    .best-seller-badge-index {
    background: #e53935;
    color: #fff;
    width: max-content;
    padding: 6px 12px;
    text-align: center;
    border-radius: 6px;
    margin: 0 auto;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    margin: 5px auto;
}
/* Buttons */
button, .btn {
    font-family: 'El Messiri';
    padding: 12px 18px;
    background: #007bff;
    color: #fff;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.back {
    padding: 12px 18px;
    background: #000;
    color: #fff;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
/* اضافة الى السلة */
button.btn-cart {
    font-family: 'El Messiri';
    padding: 12px 10px;
    background: #FFF;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    color: #000;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    width: 89%;
}
/*.btn-cart:hover {
    background: #27ae60;
    font-weight: 700;
}

button:hover, .btn:hover {
    background: #0056b3;
}*/

.btn-buy {
    font-family: 'El Messiri';
    padding: 12px 18px;
    background: #d3031c;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    color: #fff;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    width: 90%;
}
.btn-buy span, .btn-cart span {
    float: right;
    font-size: 18px;
}
/*.btn-buy:hover {
    background: #e57a00;
    font-weight: 700;
}*/
/* Forms */
input, textarea, select {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* Cart Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
}

th {
    background: #fafafa;
}

/* Footer */
footer {
    background: #222;
    color: #fff;
    text-align: center;
    padding: 15px 0;
    margin-top: 50px;
}
.main {padding: 0 10px;}
.cart-badge {
    background: #ff3b3b;
    color: #fff;
    padding: 2px 8px;
    border-radius: 50%;
    font-size: 14px;
    margin-right: 5px;
}
.main2 {text-align: center;}
/* search */
.search-box {
    margin: 20px auto;
    text-align: center;
}
.search-box input {
    font-family: 'El Messiri';
    padding: 10px;
    width: 60%;
    max-width: 400px;
    border-radius: 8px;
    border: 1px solid #ccc;
}
.search-box button.search {
    font-family: 'El Messiri';
    padding: 10px 10px;
    border: none;
    background: #b7034f;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    width: 85px;
}
.search-box button:hover {
    background: #c96d4a;
}
.product form {margin: 10px 0px;}

    @media (max-width: 768px) {
        .product img {
            width: 100%;
            height: 300px;
            border-radius: 5px;
            object-fit: cover;
        }
    }
    .category-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin: 20px 10px;
        justify-content: center;
    }
    .cat-btn {
        padding: 10px 0;
        border-radius: 10px;
        font-family: 'El Messiri';
        font-size: 15px;
        text-decoration: none;
        transition: .25s;
        text-align: center;
        width: 48%;
        box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    }
    .btn-exterior {
    background: linear-gradient(135deg, #0A3D62, #3C6382);
    color: #fff;
}
.btn-interior {
    background: linear-gradient(135deg, #6A1B9A, #8E24AA);
    color: #fff;
}
.btn-tires {
    background: linear-gradient(135deg, #E65100, #FB8C00);
    color: #fff;
}
.btn-lights {
    background: linear-gradient(135deg, #1B5E20, #43A047);
    color: #fff;
}

    /*.cat-btn:hover {
        background: #2196f3;
        transform: translateY(-3px);
    }*/
    @media (min-width: 768px) {
        .cat-btn {
            width: 15%;
            font-size: 20px;
            padding: 10px 0;
        }
    }

    /* شارة غير متوفر */
    .unavailable-badge {
        background:#ffebeb;
        color:#c00;
        padding:6px;
        text-align:center;
        border-radius:6px;
        margin-bottom:10px;
        font-size:14px;
        font-weight:bold;
        border:1px solid #ffb3b3;
    }

    .btn-disabled {
        background:#ccc !important;
        cursor:not-allowed !important;
        color:#666 !important;
        border-color:#bbb !important;
    }

/* سلايدر التقييمات */
.reviews-wrapper {
    width: 100%;
    overflow: hidden;
    margin: 25px auto;
    max-width: 900px;
    position: relative;
}

.reviews-track {
    display: flex;
    gap: 15px;
    transition: transform 0.5s ease;
    will-change: transform;
}

.review-card {
    flex: 0 0 85%;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    direction: rtl;
    height: 250px; /* ارتفاع ثابت مناسب */
    display: flex;
    flex-direction: column;
}

.comment-box {
    flex: 1;  /* يأخذ المساحة المتوسطة */
    overflow: hidden; 
}

.comment {
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 5px 0;
}

.reviewer {
    font-size: 14px;
    margin: 0;
    color: #555;
    padding-top: 5px;
}

.review-card p {
    overflow: hidden;
    text-overflow: ellipsis;

}
/* قص التعليق فقط */
.review-card .comment {
    font-size: 16px;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 60px;
    margin: 5px 0 10px;
}

@media (min-width: 600px) {
    .review-card { flex: 0 0 45%; }   /* تابلت: كرتين */
}

@media (min-width: 900px) {
    .review-card { flex: 0 0 30%; }   /* كمبيوتر: 3 كروت */
}

.review-card .stars {
    color: #FFC107;
    margin: 5px 0;
}

.review-card .product-title {
    font-size: 16px;
    font-weight: bold;
}

.review-card .btn-product {
    display: block;
    background: #2d6cdf;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    margin-top: 10px;
}