/* تنسيقات خاصة بصفحة المنتج */

/* تنسيقات معرض الصور */
.product-gallery {
    margin-bottom: 20px;
}

.main-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    height: 280px; /* تقليل الارتفاع */
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-container img {
    max-width: 90%; /* تقليل العرض */
    max-height: 90%; /* تقليل الارتفاع */
    object-fit: contain;
    transition: transform 0.5s ease;
}

.main-image-container img:hover {
    transform: scale(1.03);
}

.thumbnails-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.thumbnail-item {
    width: 55px; /* تقليل عرض الصور المصغرة */
    height: 55px; /* تقليل ارتفاع الصور المصغرة */
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-item.active {
    border-color: #007bff;
}

.thumbnail-item:hover {
    border-color: #28a745;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

/* زر تكبير الصورة */
.zoom-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zoom-icon:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

/* المودال لعرض الصورة بشكل كبير */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-image-content {
    margin: 5% auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.image-modal-close:hover {
    color: #bbb;
}

/* تنسيقات المواصفات */
.product-specifications {
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.product-specifications h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

/* ترتيب المواصفات بشكل أفقي متكاثف */
.specifications-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.specifications-options > .spec-item {
    flex: 0 0 auto;
    width: auto;
}

.spec-item {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

/* شريحة المواصفة */
.spec-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 999px;
    background-color: #fff;
    font-size: 0.9rem;
    line-height: 1.2;
    color: #333;
    white-space: nowrap;
    width: auto;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* حالة التحويم والتحديد */
.spec-item:hover .spec-label {
    background-color: #f8f9fa;
    border-color: #bbb;
}

.spec-item.selected .spec-label {
    background-color: #e8f3ff;
    border-color: #2980b9;
    color: #0d47a1;
}

.spec-item input[type="radio"] {
    display: none;
}

/* فصل بسيط بين اللون والمقاس */
.size-sep {
    color: #999;
}

.color-name {
    font-weight: bold;
}

/* لم تعد معلومات الكمية ضمن النص، تظهر كتلميح (title) */

.product-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.product-price {
    font-size: 1.6rem;
    color: #d35400;
    font-weight: bold;
    margin-bottom: 20px;
}

.product-description {
    font-size: 1rem;
    line-height: 1.7;
    color: #444;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* اجعل الصور داخل وصف المنتج مرنة على الشاشات الصغيرة */
.product-description img {
    max-width: 100%;
    height: auto;
}

.quantity-selector {
    max-width: 200px;
}

.quantity-selector label {
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

.quantity-selector .form-control {
    height: 45px;
    font-size: 1.2rem;
}

.quantity-selector .btn {
    height: 45px;
    width: 45px;
    font-size: 1.2rem;
}

#add-to-cart-btn {
    background-color: #2980b9;
    border-color: #2980b9;
    font-size: 1.1rem;
    padding: 12px 20px;
    transition: all 0.3s;
}

#add-to-cart-btn:hover {
    background-color: #3498db;
    border-color: #3498db;
}

.product-meta {
    font-size: 0.9rem;
    color: #666;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* تنسيقات المنتجات ذات الصلة */
.related-products h3 {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.related-products h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #2980b9;
}

.related-products .card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.related-products .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.related-products .card-img-top {
    height: 200px;
    object-fit: cover;
}

.related-products .price {
    color: #d35400;
    font-weight: bold;
    font-size: 1.1rem;
}

/* تنسيقات متجاوبة */
@media (max-width: 767px) {
    .breadcrumb {
        flex-wrap: wrap;
    }

    .breadcrumb .breadcrumb-item {
        font-size: 0.9rem;
    }

    .main-image-container {
        height: 60vw; /* ارتفاع مرن حسب عرض الشاشة */
        max-height: 360px;
    }

    .product-title {
        margin-top: 15px;
        font-size: 1.5rem;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .product-price {
        font-size: 1.3rem;
    }

    .spec-label {
        padding: 8px 12px;
        font-size: 0.95rem;
    }

    .quantity-selector {
        max-width: 100%;
    }

    .quantity-selector .btn {
        height: 40px;
        width: 40px;
        font-size: 1rem;
    }

    .quantity-selector .form-control {
        height: 40px;
        font-size: 1rem;
    }

    .thumbnails-container {
        gap: 8px;
    }

    .thumbnail-item {
        width: 60px;
        height: 60px;
    }

    .related-products .card-img-top {
        height: 160px;
    }
}
