/* variables */
:root {
    --white: hsl(0, 0%, 100%);
    --WHITE: hsl(0, 0%, 100%);
    --BLACK: hsl(0, 0%, 0%);
    --black-90: hsl(0, 0%, 10%);
    --black-70: hsl(0, 0%, 30%);
    --black-alpha-40: hsla(0, 0%, 0%, 0.4);
    --pink-light: #fff7ef;
    --burgendee: #9c5876;
    --grey: #e2dedc;
    --turquosie-dark: #046276;
    --border-color: hsl(0, 0%, 90%);
    --shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}


/* base */

@font-face {
    font-family: Tajawal;
    src: url('../fonts/Tajawal.ttf')
}

body {
    background-color: var(--pink-light);
    font-family: Tajawal, sans-serif;
    font-size: 18px;
    font-weight: 300;
    color: var(--black-70);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--main-color);
    text-decoration: none;
}

a:hover {
    color: var(--black-70);
}

img {
    max-width: 100%;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 1em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--black-90);
    line-height: 1.3;
}

.box {
    background-color: var(--white);
    border-radius: 5px;
    box-shadow: var(--shadow);
    padding: 30px;
}

.section-padding {
    padding: 60px 0;
}

.section-title {
    margin-top: 100px;
    margin-bottom: 50px;
}

.section-title .title {
    margin-top: 30px;
    font-size: 30px;
    font-weight: 600;
    color: var(--turquosie-dark);
    text-align: center;

}

::selection {
    color: var(--grey);
    background-color: var(--turquosie-dark);
}

/* header */
.header-main .logo {
    width: 100px;
    height: 100px;
    display: inline-block;
    position: relative;
}

.header {
    transition: top .4s ease-in-out;
    background-color: var(--pink-light);
}

.header .menu-item {
    display: inline-block;
    margin-left: 40px;
    position: relative;
}

.header .menu-item>a {
    display: block;
    padding: 24px 0;
    font-weight: 600;
    color: var(--burgendee);
    transition: color 0.3s ease;
}

.header .menu-item:hover>a {
    color: var(--main-color)
}

.header-backdrop,
.header-close-btn,
.header-hamburger-btn {
    display: none;
}

.float-icon {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 100
}

.float-icon i {
    font-size: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 0 1px 1px #0bdf0b;
    color: #fff;
    background-color: #1ac81a;
    padding: 7px 0;
    text-align: center
}

/* slides section */
.slides-section {
    width: 100%;
    height: auto;
    margin: 0;

}

.slides-section img {
    width: 100%;
    object-fit: cover;
}

.slides-section .carousel-inner {
    margin-right: 50px;
}

/* products section*/
.carousel-container {
    display: flex;
    align-items: center;
    width: 90%;
    margin: auto;
    max-width: 1200px;
}

.carousel {
    width: 90%;
    margin: auto;
    overflow: hidden;
    flex-grow: 1;
}

.carousel-inner-2 {
    display: flex;
    width: max-content;
    animation: slide 15s linear infinite;
}

@keyframes slide {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.carousel-inner-2 .product-card {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    width: 200px;
    margin: 10px;
}

.carousel-inner-2 .product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}


/* anemation keyframes */

@keyframes loader {
    0% {
        transform: rotate(0deg);
    }

    25%,
    50% {
        transform: rotate(180deg);
    }

    75%,
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loaderIn {

    0%,
    25%,
    100% {
        height: 0%;
    }

    50%,
    75% {
        height: 100%;
    }
}

/* services section  */
div.category {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
}

div.category-item {
    margin: 5px;
    border: 1px solid #ccc;
    width: 400px;
}

div.category-item img {
    width: 100%;
    height: auto;
}

/* contact section */
.map {
    float: right;
    width: 350px;
    height: 230px;
}

.map iframe {
    border: 1px solid var(--white);
    border-radius: 5px;

}

.mobile-map {
    visibility: hidden;
}

.contact-item {
    text-align: right;
    position: relative;
    padding-right: 55px;
    margin-bottom: 40px;
}

.contact-item .icon-box {
    position: absolute;
    height: 40px;
    width: 40px;
    background-color: var(--burgendee);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    right: 0;
    top: 0;
    color: var(--WHITE);
}

.contact-form {
    background-color: var(--pink-light);
}

.form-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 30px;
    color: var(--turquosie-dark);
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-control::placeholder {
    text-align: right;
    color: var(--black-70);
}

.form-control {
    height: 48px;
    border-color: var(--turquosie-dark);
    color: var(--black-90);
    background-color: transparent;
}

.form-control:focus {
    background-color: transparent;
    border-color: var(--black-70);
    color: var(--black-90);
    box-shadow: none;
}

.select-icon {
    position: absolute;
    right: 15px;
    top: 50px;
    transform: translateY(-50);
    pointer-events: none;
    font-size: 13px;
}

select.form-control:focus option {
    background-color: var(--black-70);
}

textarea.form-control {
    height: 120px;
    resize: none
}

/* about-section */

.about-section .img-box img {
    height: 380px;
    width: 680px;
}

.about-section .text-box {
    direction: rtl;
    text-align: right;
    padding-top: 60px;
}

.about-section .text-box p {
    margin: 0 10px 20px 10px;
}

.about-section .text-box .title {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--turquosie-dark);
}

/* products section */
.products-section {
    margin-bottom: 30px;
    position: relative;
    text-align: center;
}

.products-section .container {
    display: block;
}

/* تنسيق قسم الفلاتر */

.filters-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    z-index: 1100;
    overflow: auto;
    padding: 20px;
    background-color: white;
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.filters-sidebar.open {
    transform: translateX(0);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 15px;
    background: none;
    border: none;
    cursor: pointer;
}

.filter-group {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.filters-sidebar label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    direction: rtl;
    float: right;
}

.filters-sidebar h2 {
    margin-top: 20px;
    margin-bottom: 25px;
}

.filters-sidebar input[type="text"],
.filters-sidebar select {
    width: 100%;
    padding: 8px 5px;
    margin-top: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    direction: rtl;
}

.filters-sidebar input[type="range"] {
    width: 100%;
    padding: 0;
    margin-top: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    direction: rtl;
}

.filters-sidebar button {
    width: 100%;
    padding: 10px;
    background-color: var(--turquosie-dark);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
}

.filter-toggle-btn {
    background-color: var(--turquosie-dark);
    color: white;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    float: right;
}

/* تنسيق قائمة المنتجات */
.product-list {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 20px;
    padding: 0 20px;
}

.product-list .product-card {
    display: flex;
    flex-direction: column;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    margin: 10px 0;
    height: 100%;
}

.product-card h4 {
    font-size: 1.1em;
    line-height: 26px;
    color: var(--burgendee);
    font-weight: bold;
    margin: 5px 0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.product-list .product-card img {
    width: 90%;
    height: 70%;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.product-list .product-card a {
    color: inherit;
    display: block;
    /* لجعل الرابط يملأ المساحة */
    flex-grow: 1;
}

.product-card .price-and-cart {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
}

.price-and-cart .price {
    font-size: 18px;
    font-weight: bold;
    color: var(--turquosie-dark);
}

.price-and-cart .add-cart {
    padding: 8px;
    font-size: 18px;
    color: var(--black-70);
    cursor: pointer;
}

#cart-icon {
    position: relative;
    display: flex;
    font-size: 30px;
    cursor: pointer;
    color: var(--black-70);
}

#cart-icon .cart-item-count {
    position: absolute;
    top: -10px;
    right: -12px;
    width: 15px;
    height: 15px;
    background: rgba(238, 218, 218, 0.958);
    border-radius: 50%;
    font-size: 18px;
    color: #0c0909;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
}

.cart {
    position: fixed;
    top: 0;
    right: -100%;
    width: 360px;
    height: 100%;
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 65px 20px 40px;
    z-index: 1100;
    overflow: auto;
    transition: 0.5s;
}

.cart.active {
    right: 0;
}

.cart-title {
    text-align: center;
    font-size: 30px;
    color: var(--burgendee);
}

.cart-box {
    display: flex;
    align-items: center;
    margin-top: 20px;
}

.cart-box img {
    width: 100px;
    height: 100px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 20px;
}

.cart-detail {
    display: grid;
    gap: 8px;
    margin-right: auto;
}

.cart-product-title {
    font-size: 16px;
    line-height: 1;
}

.cart-price {
    font-weight: 500;
}

.cart-quantity {
    display: flex;
    width: 100px;
    border: 1px solid #999;
    border-radius: 6px;
}

.cart-quantity button {
    background: transparent;
    width: 30px;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.cart-quantity #decrement {
    color: #999;
}

.cart-quantity .number {
    display: flex;
    justify-content: center;
    width: 40px;
    border-left: 1px solid #999;
    border-right: 1px solid #999;
    cursor: default;
}

.cart-remove {
    font-size: 20px;
    cursor: pointer;
}

.total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid #999;
    margin-top: 20px;
    font-size: 18px;
}

.total-price {
    margin-left: 10px;
    font-weight: 600;
}

.btn-buy {
    display: block;
    padding: 10px 30px;
    background: var(--turquosie-dark);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    color: #fff;
    margin: 20px auto 0;
    cursor: pointer;
}

#cart-close {
    position: absolute;
    top: 20px;
    right: 15px;
    font-size: 15px;
    cursor: pointer;
}

.product-card.sold-out img,
.product-card.sold-out h4,
.product-card.sold-out .price-and-cart {
    opacity: 0.6;
    filter: grayscale(100%);
    pointer-events: none;
}

.sold-out a {
    pointer-events: none;
    cursor: not-allowed;
}

.product-card.sold-out .add-cart {
    pointer-events: none;
    background-color: #888;
    cursor: not-allowed;
    border: none;
}

/*pagination*/

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding: 10px;
}

.pagination-container button,
.page-number {
    padding: 8px 15px;
    margin: 0 5px;
    cursor: pointer;
    border: 1px solid #333;
    background-color: var(--turquosie-dark);
    border-radius: 4px;
    font-size: 16px;
    color: var(--WHITE);
}

.pagination-container button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.page-number.active {
    background-color: var(--WHITE);
    color: var(--turquosie-dark);
    border-color: var(--turquosie-dark);
}

#page-numbers {
    display: flex;
}

/* footer */
footer {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid var(--grey);
}

.footer-item p {
    font-size: 1em;
}

.footer-item .social-icon {
    margin: 10px;
    font-size: 18px;

}

.footer-item .social-icon:hover {
    color: var(--turquosie-dark);
}

/* buttons */

.btn-form {
    height: 48px;
}


/* page loader */
.page-loader {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    z-index: 1001;
    display: flex;
    background-color: var(--white);
}

.page-loader.fade-out {
    opacity: 0;
    transition: all 0.6s ease;
}

.page-loader div {
    margin: auto;
    height: 32px;
    width: 32px;
    border: 4px solid var(--burgendee);
    position: relative;
    animation: loader 2s linear infinite;
}

.page-loader div::before {
    content: '';
    position: absolute;
    height: 100%;
    width: 100%;
    background-color: var(--burgendee);
    left: 0;
    top: 0;
    animation: loaderIn 2s linear infinite;
}


/* ------------------------------------- */
/* تنسيق صفحة تفاصيل المنتج (product_detail.html) */
/* ------------------------------------- */

.product-detail-container {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.product-detail-container .product-card:hover {
    box-shadow: none;
    transform: none;
}

/* تنسيق عنوان المنتج */
#product-name {
    color: var(--turquosie-dark);
    font-size: 2.5em;
    margin-bottom: 20px;
    display: inline-block;
    padding-bottom: 5px;
}

.product-info-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: flex-start;
}

#product-image {
    width: 100%;
    max-width: 300px;
    /* تحديد أقصى عرض للصورة */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    /* لضمان ملء الصورة للمساحة دون تشوه */
}

.product-text {
    direction: rtl;
}

.product-text h3 {
    color: var(--turquosie-dark);
    font-size: 1.4em;
    margin-top: 20px;
}

.product-text .category {
    font-weight: bold;
    color: #555;
    background-color: #e9ecef;
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.price {
    font-size: 1.8em;
    color: #28a745;
    /* لون أخضر للسعر */
    font-weight: bold;
    margin-bottom: 15px;
}

#product-details-list {
    list-style-type: none;
    padding-right: 0;
}

#product-details-list li {
    background-color: #f1f1f1;
    margin-bottom: 8px;
    padding: 10px;
    border-right: 3px solid var(--turquosie-dark);
    border-radius: 4px;
}

.product-text .add-cart {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 30px;
    transition: background-color 0.3s;
}

.product-text .add-cart:hover {
    background-color: #218838;
}

/* تنسيق رسالة عدم العثور */
#not-found {
    margin-top: 10vh;
    text-align: center;
    padding: 50px;
    border: 1px dashed #dc3545;
    background-color: #ffebeb;
    border-radius: 8px;
}

.back-button {
    background: none;
    border: none;
    color: var(--burgendee);
    padding: 10px 0;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 5px;
}

.back-button:hover {
    color: var(--black-70);
}

/* تنسيق قسم المنتجات ذات الصلة */
.related-products-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}


/* تعديل للتحسين على الجوال */
@media (max-width: 768px) {
    .product-list {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* التوقف عند تمرير الماوس (للكمبيوتر) */
.carousel:hover .carousel-inner-2 {
    animation-play-state: paused;
}

/* التوقف عند الضغط المستمر (للموبايل والكمبيوتر) */
.carousel-inner-2:active {
    animation-play-state: paused;
}

/* كلاس إضافي سنستخدمه لجعل الشريط يتوقف عند النقر (للموبايل) */
.carousel-inner-2.stop-animation {
    animation-play-state: paused;
}

/* Breadcrumb جمالي */
.breadcrumb a {
    text-decoration: none;
    color: #555;
}

.breadcrumb a:hover {
    text-decoration: underline;
    color: #000;
}

.breadcrumb {
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 20px;
}

.breadcrumb-rtl .breadcrumb {
    direction: rtl;
}

.breadcrumb-rtl .breadcrumb-item+.breadcrumb-item::before {
    float: right;
    padding-left: 0.5rem;
    padding-right: 0;
}

/* جعل الكرت قابل للضغط */
.product-card {
    cursor: pointer;
}

.product-card.hidden-by-js {
    display: none !important;
    /* نستخدم !important هنا فقط لضمان الإخفاء */
}