/* =================== THEME & ROOT VARIABLES =================== */
:root {
    --primary-pink: #e91e63;
    --dark-purple: #5d2248;
    --light-bg: #f5f5f7; /* A soft, premium light background */
    --text-color-primary: #1a1a1a;
    --text-color-secondary: #555;
    --border-color: #e0e0e0;

    --dark-color: #1a1a1a;
    --light-gray: #f8f9fa;
    --text-color: #333;
    --font-family: "Tajawal", sans-serif;
}
div,
p {
    color: var(--dark-color);
}
/* =================== ENHANCED PRODUCT DETAIL PAGE STYLES =================== */
.product-detail-page {
    background-color: var(--light-bg); /* Use the soft background */
}

.product-slider .swiper-button-next,
.product-slider .swiper-button-prev {
    color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}
.product-slider .swiper-button-next::after,
.product-slider .swiper-button-prev::after {
    font-size: 1rem;
    font-weight: 700;
}
.product-slider .swiper-button-prev {
    left: 0;
}
.product-slider .swiper-button-next {
    left: 15px;
}
/* --- Enhanced Gallery --- */
.main-image-container {
    overflow: hidden;
    border-radius: 16px; /* Larger radius for modern look */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
#main-product-image {
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
    max-height: 600px;
}
.main-image-container:hover #main-product-image {
    transform: scale(1.1); /* More pronounced zoom */
}
.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-top: 11px;
}
.thumbnail.active,
.thumbnail:hover {
    border-color: var(--primary-purple);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* --- Enhanced Product Details --- */
.product-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color-primary);
}
.product-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark-purple);
}
.product-features-list {
    list-style: none;
    padding: 0;
    color: var(--text-color-secondary);
}
.product-features-list li {
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
}
.product-features-list .fa-check-circle {
    margin-inline-end: 10px;
    color: #2ecc71; /* A brighter green */
}

/* --- Enhanced Option Selectors (Color/Size) --- */
.option-selector label {
    position: relative;
}
.option-selector input[type="radio"] {
    opacity: 0;
    position: absolute;
}
.color-swatch {
    display: inline-flex; /* Use flex to center the icon */
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease-in-out;
}
.color-swatch::after {
    /* The checkmark icon */
    content: "\f00c"; /* Font Awesome check icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 14px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease-in-out;
}
.size-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background-color: white;
    font-weight: bold;
    color: var(--text-color-secondary);
    transition: all 0.2s ease-in-out;
}
/* Active state for both color and size */
.option-selector input:checked + span {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 2px var(--primary-purple);
    color: var(--primary-purple); /* For size swatch text */
}
.option-selector input:checked + .color-swatch {
    transform: scale(1.1);
}
/* Show the checkmark on selected color */
.option-selector input:checked + .color-swatch::after {
    opacity: 1;
    transform: scale(1);
}

/* --- Enhanced Meta & Share --- */
.product-meta p {
    margin-bottom: 0.5rem;
}
.product-meta a {
    text-decoration: none;
    color: var(--primary-purple);
    font-weight: 500;
}
.social-share a {
    font-size: 1.2rem;
    color: #aaa;
    margin-inline-start: 10px;
    transition: all 0.3s;
}
.social-share a:hover {
    color: var(--primary-purple);
    transform: scale(1.2);
}

/* --- Enhanced Buy Box & Quick Order --- */
.buy-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px; /* Make it sticky on scroll */
    padding: 1.5rem;
}
.quick-order-box {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}
/* Enhanced Quantity Selector */
.quantity-selector {
    display: flex;
}
.quantity-selector .btn {
    border: 1px solid var(--border-color);
    background-color: white;
    color: var(--text-color-primary);
}
.quantity-selector input {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.quantity-selector .btn-minus {
    border-radius: 0 8px 8px 0;
}
.quantity-selector .btn-plus {
    border-radius: 8px 0 0 8px;
}

/* Buttons */
.btn-purple,
.btn-dark-purple {
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(93, 34, 72, 0.1);
}
.btn-purple:hover,
.btn-dark-purple:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(93, 34, 72, 0.2);
}

/* --- Enhanced Product Tabs --- */
.product-tabs-section {
    background-color: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
}
.product-tabs-section .nav-tabs {
    border-bottom: 2px solid var(--border-color);
}
.product-tabs-section .nav-tabs .nav-link {
    color: var(--text-color-secondary);
    font-weight: 600;
    border: 0 !important; /* Override bootstrap borders */
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px;
}
.product-tabs-section .nav-tabs .nav-link.active {
    color: var(--primary-purple);
    border-color: var(--primary-purple) !important;
    background-color: transparent;
}
.product-tabs-section .tab-content {
    border: 0; /* remove border around content */
    padding-top: 1.5rem;
}

/* --- Enhanced Reviews --- */
.review-item {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    background-color: white;
    text-align: center;
    transition: box-shadow 0.3s ease;
}
.product-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.product-image {
    position: relative;
}
.product-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 6 / 7;
    object-fit: cover;
}
.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: var(--text-color);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.wishlist-btn:hover {
    background-color: white;
    transform: scale(1.1);
}
.wishlist-btn.active {
    color: #e74c3c;
}
.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
}
.product-info {
    padding: 1rem;
}
.star-rating {
    color: #f39c12;
    margin-bottom: 0.5rem;
}
.star-rating .fa-regular {
    color: #ccc;
}
.product-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}
.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.btn-style {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.btn-style:hover,
.btn-style:focus {
    background-color: #6d1b51;
    color: white;
    border-color: #6d1b51;
}
/* ======================================= */
/* ==   REFINED PRODUCT DETAIL PAGE     == */
/* ======================================= */
.product-detail-page {
    background-color: #fff;
}

/* --- Breadcrumb --- */
.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}
.breadcrumb-item a:hover {
    color: var(--primary-color, #6a1b9a);
}

/* --- Gallery --- */
.product-images-gallery .main-image-container {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
}
.thumbnail-images .thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}
.thumbnail-images .thumbnail.active,
.thumbnail-images .thumbnail:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- Product Details --- */
.product-details h1.product-title {
    font-size: 2rem;
    font-weight: 800;
}
.product-details .product-vendor-link {
    color: #6c757d;
    text-decoration: none;
}
.product-details .product-price {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-color);
}
.product-features-list {
    list-style-type: none;
    padding-right: 0;
}
.product-features-list li {
    margin-bottom: 0.5rem;
}

/* --- Buy Box --- */
.buy-box {
    background-color: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    position: sticky;
    top: 20px;
    border: 1px solid #eee;
}
.quantity-selector .btn {
    border-color: #ccc;
}

/* --- Tabs --- */
.product-tabs-section .nav-tabs .nav-link {
    font-weight: 600;
    color: #6c757d;
}
.product-tabs-section .nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-color: var(--primary-color) !important;
}

/* --- Reviews --- */
.review-item {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}
.review-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.review-item .star-rating {
    color: #ffc107;
}
.product-detail-page {
    background-color: #fff;
}
.breadcrumb-item a {
    text-decoration: none;
    color: #6c757d;
}

/* --- Gallery --- */
.thumbnails-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
}
.thumbnail {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #eee;
    transition: all 0.3s;
}
.thumbnail.active,
.thumbnail:hover {
    border-color: var(--primary-color);
}
.main-image-container img {
    border-radius: 12px;
    width: 100%;
}

/* --- Details --- */

.product-vendor a {
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
}
.price-box .current-price {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-color);
}
.buy-box {
    background: #f9fafb;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 1.5rem;
    position: sticky;
    top: 20px;
}
/* ======================================= */
/* ==       PRODUCT REVIEWS STYLES      == */
/* ======================================= */

.add-review-form {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    background-color: #f9fafb;
    margin-top: 2rem;
}

/* --- Rating Stars --- */
.rating-stars {
    direction: ltr; /* نجعل النجوم تبدأ من اليسار لليمين */
    display: inline-block;
}

.rating-stars i.fa-star {
    font-size: 1.75rem;
    color: #e5e7eb; /* لون النجمة الفارغة */
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    margin: 0 2px;
}

.rating-stars i.fas {
    color: #ffc107; /* لون النجمة الممتلئة (الأصفر) */
}

/* تأثير عند تمرير الماوس */
.rating-stars:hover i.fa-star {
    color: #ffc107 !important;
}
.rating-stars i.fa-star:hover ~ i.fa-star {
    color: #e5e7eb !important;
}

.rating-stars i.fa-star:active {
    transform: scale(0.9);
}
/* --- Styling for existing reviews --- */
.reviews-list {
    margin-top: 2rem;
}
.review-item {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}
.review-item:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.review-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
}
.review-author {
    font-weight: 600;
    color: #333;
}
.review-date {
    font-size: 0.8rem;
}
.review-stars {
    color: #ffc107; /* لون النجوم (أصفر) */
}
.review-comment {
    color: #555;
    line-height: 1.7;
}
.btn-purple {
    background-color: #882266;
    color: #fff;
}
.product-rating-review {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.product-rating-review .star-rating {
    color: #f59e0b; /* A nice amber color */
    font-size: 1rem;
}
.product-rating-review .reviews-count a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px dashed var(--border-color);
}
.product-rating-review .reviews-count a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Stock Status */
.stock-status {
    font-weight: 600;
    font-size: 0.9rem;
}
.stock-status.in-stock {
    color: #16a34a; /* Green */
}
.stock-status.out-of-stock {
    color: #dc2626; /* Red */
}
.stock-status i {
    margin-inline-end: 0.5rem;
}

/* Product Meta Info */
.product-meta-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1.5rem;
}
.product-meta-info div {
    margin-bottom: 0.5rem;
}
.product-meta-info strong {
    color: var(--text-primary);
}
.product-meta-info a {
    color: var(--primary-color);
    text-decoration: none;
}
.product-meta-info a:hover {
    text-decoration: underline;
}
@media (max-width: 768px) {
    .thumbnails-col{
        flex-direction: row;
    }
}