/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Typography */
body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f2f2f2;
    color: #333;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background-color: #00695c !important;
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* توضيح لون نص الأقسام في النافبار */
.navbar .nav-link.dropdown-toggle {
    color: #222 !important; /* لون داكن وواضح */
    font-weight: 600;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: bold;
    color: white !important;
}

/* تكبير حجم الشعار في النافبار للحجم المثالي */
.navbar-brand img {
    height: 80px !important; /* تكبير الشعار بشكل أكبر */
    max-height: 90px;
    width: auto;
}

/* Search Bar */
form[role="search"] input[type="search"] {
    border-radius: 25px;
    padding: 0.6rem 1rem;
    border: 1px solid #ccc;
    transition: all 0.3s ease-in-out;
    font-size: 0.9rem;
}

form[role="search"] input[type="search"]:focus {
    border-color: #00695c;
    box-shadow: 0 0 8px rgba(0, 105, 92, 0.2);
    outline: none;
}

/* Dropdown Menu */
.dropdown-menu {
    text-align: right;
    background: #ffffff !important;
    direction: rtl; /* Ensure RTL direction */
    float: none; /* Reset float */
    padding-right: 10px; /* Add padding to align text to the right */
}

/* Cards */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 0 !important; /* إزالة الحواف الدائرية */
    overflow: hidden;
    background-color: white;
    height: 162px; /* 180px - 10% */
    margin: 0.1rem !important; /* تقليل المسافة بين البطاقات */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.card-img-top {
    height: 180px; /* 200px - 10% */
    object-fit: cover;
    object-position: center;
    border-radius: 0 !important; /* إزالة الحواف الدائرية للصورة أيضاً */
}

.card-img-top,
.product-img {
    width: 250px !important;
    height: 250px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 12px !important;
    margin: auto;
    display: block;
}

.card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem !important;
    text-align: right; /* Align text to the right for RTL */
    direction: rtl; /* Set text direction to RTL */
}

.card-title {
    font-size: 0.855rem; /* 0.95rem - 10% */
    font-weight: bold;
    color: #212121;
    text-align: right; /* Align text to the right for RTL */
    direction: rtl; /* Set text direction to RTL */
}

.price {
    color: #009688;
    font-weight: bold;
    font-size: 0.765rem; /* 0.85rem - 10% */
    margin-top: 0.5rem;
    text-align: right; /* Align text to the right for RTL */
    direction: rtl; /* Set text direction to RTL */
    margin-bottom: 0.2rem; /* Reduce the margin below the price */
}

.card-text {
    text-align: right; /* Align text to the right for RTL */
    direction: rtl; /* Set text direction to RTL */
    font-size: 0.765rem; /* 0.85rem - 10% */
}

/* WhatsApp Button */
.btn-whatsapp {
    background-color: white;
    color: black !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 5px;
    padding: 0.36rem 0.9rem;
    transition: all 0.3s ease-in-out;
    font-size: 0.72rem; /* 0.8rem - 10% */
    width: 100%; /* Make the button take the full width of the specifications section */
    max-width: none; /* Remove the maximum width restriction */
    margin-top: 0.2rem; /* Reduce the margin above the button */
    border-color: #25D366 !important; /* WhatsApp green border */
}

.btn-whatsapp:hover {
    background-color: #f8f9fa !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-whatsapp i {
    color: black !important;
    margin-left: 5px;
    color: #25D366 !important; /* WhatsApp green icon */
}

/* Details Button */
.btn-outline-primary {
    width: 100%; /* Match the width of the "Purchase" button */
    border-radius: 5%; /* Set border radius to 5% */
}

/* زر تحميل المزيد: تصغير الحجم، خلفية بيضاء، توسيط */
#loadMoreBtn {
    font-size: 0.9rem;
    padding: 0.4rem 1.2rem;
    background-color: #fff !important;
    color: #198754 !important;
    border: 1px solid #198754 !important;
    border-radius: 6px;
    display: inline-block;
    margin: 0 auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: background 0.2s, color 0.2s;
}
#loadMoreBtn:hover {
    background-color: #198754 !important;
    color: #fff !important;
}
.text-center.mt-4 {
    text-align: center !important;
}

/* Footer */
footer {
    background-color: #00695c;
    color: white;
    padding: 1rem 0;
    text-align: center;
    margin-top: 2rem;
}

footer p {
    font-size: 0.85rem;
}

/* تصغير حجم أيقونات التواصل الاجتماعي وإزالة الخلفية الخضراء */
.social-footer-icon {
    font-size: 1.1rem;
    width: 26px;
    height: 26px;
    line-height: 26px;
    background: none !important;
    color: #fff !important;
    border-radius: 50%;
    text-align: center;
    transition: color 0.2s;
    padding: 0;
}
.social-footer-icon i {
    font-size: 1.1rem;
    vertical-align: middle;
}
.social-footer-icon:hover {
    color: #198754 !important;
    background: none !important;
}

/* Mobile Responsive */
@media (max-width: 767.98px) {
    .card {
        flex-direction: row !important; /* Change to row to align image on the right */
        margin-bottom: 1rem;
        align-items: stretch;
        margin: 0.02rem !important; /* تقليل المسافة أكثر في الجوال */
        height: auto !important;
    }

    .card-img-top {
        width: 40% !important;
        height: 180px !important;
        border-radius: 0 !important; /* إزالة الحواف الدائرية للصورة أيضاً */
    }

    .card-body {
        width: 60% !important;
        padding: 15px !important;
        text-align: left;
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* اجعل العناصر متقاربة من الأعلى */
        gap: 0.3rem; /* تقليل المسافة بين العناصر داخل التفاصيل */
    }

    .btn-whatsapp {
        align-self: flex-start;
        margin-left: 0;
        border-radius: 5px !important;
        font-size: 0.675rem !important;
        padding: 5.4px 10.8px !important;
    }

    .btn-outline-primary {
        align-self: flex-start; /* Align like the "Purchase" button */
        margin-left: 0; /* Match the margin of the "Purchase" button */
        border-radius: 5px !important; /* Match the border radius of the "Purchase" button */
    }

    .navbar-brand {
        font-size: 1rem !important; /* Reduce the store name size */
        display: block !important; /* Re-display the site name on mobile view */
    }

    .navbar-collapse {
        justify-content: space-between; /* Adjust alignment for search bar and categories */
    }

    form[role="search"] {
        display: block !important; /* Ensure the search bar is visible */
        width: 100%; /* Make the search bar take full width */
        margin-top: 0.5rem; /* Add some spacing */
    }

    form[role="search"] input[type="search"] {
        width: 100%; /* Ensure the input field takes full width */
    }

    .navbar-nav {
        margin-top: 0.5rem; /* Add spacing for categories */
    }

    .card-title {
        font-size: 0.81rem !important;
    }

    .price {
        font-size: 0.72rem !important;
        margin-bottom: 3%; /* تقليل الفراغ أسفل السعر إلى 3% */
    }

    .card-img-top,
    .product-img {
        width: 100% !important;
        min-width: 120px !important;
        max-width: 180px !important;
        height: auto !important;
        max-height: 180px !important;
        object-fit: contain !important;
        object-position: center !important;
        border-radius: 12px !important;
        margin: 0 !important;
        display: block;
        background: #fff;
    }
    .card {
        flex-direction: row !important;
        margin-bottom: 1rem;
        align-items: stretch;
        margin: 0.02rem !important;
        height: auto !important;
    }
    .card-body {
        width: 60% !important;
        padding: 15px !important;
        text-align: left;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Zoomable Image Styles */
.zoomable {
    cursor: zoom-in;
    transition: transform 0.3s;
}

.zoomable:hover {
    transform: scale(1.1);
}

.modal-body img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
}

/* Modal Image Zoom */
.modal-image-zoom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    cursor: zoom-out;
}

.modal-image-zoom img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.1rem !important;
    }

    form[role="search"] input[type="search"] {
        font-size: 0.8rem;
    }

    .card-title {
        font-size: 0.81rem !important;
    }

    .price {
        font-size: 0.72rem !important;
    }

    .btn-whatsapp {
        font-size: 0.675rem !important;
        padding: 5.4px 10.8px !important;
    }
}
