/* Product Modal Styles */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1500;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: white;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 10px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body.dark .modal-content {
    background-color: #1a1a1a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    z-index: 1600;
}

body.dark .close-modal {
    color: #e0e0e0;
}

.modal-body {
    padding: 25px;
}

.product-detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.product-detail-image {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    overflow: hidden;
    border-radius: 8px;
}

.product-detail-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

.product-detail-info {
    flex: 1;
    min-width: 300px;
}

.product-detail-info h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #333;
}

body.dark .product-detail-info h2 {
    color: #e0e0e0;
}

.product-detail-price {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

#modalProductPrice {
    color: #3f51b5;
    font-size: 24px;
}

body.dark #modalProductPrice {
    color: #7986cb;
}

#modalProductOriginalPrice {
    text-decoration: line-through;
    color: #888;
    font-size: 18px;
    margin-left: 10px;
}

.product-detail-rating {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.product-detail-rating i {
    color: #ffc107;
    margin-right: 2px;
    font-size: 18px;
}

#modalProductRatingCount {
    margin-left: 8px;
    color: #777;
    font-size: 16px;
}

body.dark #modalProductRatingCount {
    color: #aaa;
}

.product-detail-description {
    margin-bottom: 25px;
    line-height: 1.6;
    color: #555;
    font-size: 16px;
}

body.dark .product-detail-description {
    color: #bbb;
}

.product-detail-buttons {
    margin-top: 30px;
}

.product-detail-buttons button {
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 6px;
    background: linear-gradient(135deg, #3f51b5 0%, #5c6bc0 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-detail-buttons button:hover {
    background: linear-gradient(135deg, #303f9f 0%, #3f51b5 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(63, 81, 181, 0.2);
}

/* Size and Color Selection */
.product-detail-sizes, 
.product-detail-colors {
    margin-top: 25px;
}

.product-detail-sizes h3, 
.product-detail-colors h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

body.dark .product-detail-sizes h3, 
body.dark .product-detail-colors h3 {
    color: #e0e0e0;
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.size-option {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background-color: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body.dark .size-option {
    background-color: #333;
    border-color: #555;
    color: #e0e0e0;
}

.size-option:hover {
    background-color: #e8eaf6;
    border-color: #3f51b5;
}

.size-option.selected,
.size-option.active {
    background-color: #3f51b5;
    border-color: #3f51b5;
    color: white;
    box-shadow: 0 2px 8px rgba(63, 81, 181, 0.3);
}

body.dark .size-option:hover {
    background-color: #444;
    border-color: #5c6bc0;
}

body.dark .size-option.selected,
body.dark .size-option.active {
    background-color: #5c6bc0;
    border-color: #5c6bc0;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #3f51b5;
}

.color-option.selected,
.color-option.active {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px #3f51b5;
}

body.dark .color-option:hover {
    box-shadow: 0 0 0 2px #5c6bc0;
}

body.dark .color-option.selected,
body.dark .color-option.active {
    box-shadow: 0 0 0 3px #5c6bc0;
}

.color-option.selected::after,
.color-option.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Product Reviews Section */
.product-reviews-section {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

body.dark .product-reviews-section {
    border-color: #333;
}

.product-reviews-section h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

body.dark .product-reviews-section h3 {
    color: #e0e0e0;
}

.review-form-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

body.dark .review-form-container {
    background-color: #2a2a2a;
}

.review-form-container h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

body.dark .review-form-container h4 {
    color: #e0e0e0;
}

.rating-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.rating-input span {
    font-size: 16px;
    color: #555;
}

body.dark .rating-input span {
    color: #bbb;
}

.star-rating-input {
    display: flex;
}

.star-rating-input i {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    margin-right: 3px;
}

.star-rating-input i.fas {
    color: #ffc107;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
    color: #555;
}

body.dark .form-group label {
    color: #bbb;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: white;
    color: #333;
}

body.dark .form-group input,
body.dark .form-group textarea {
    background-color: #333;
    border-color: #555;
    color: #e0e0e0;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #3f51b5;
    outline: none;
}

button.submit-review {
    background: linear-gradient(135deg, #3f51b5 0%, #5c6bc0 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button.submit-review:hover {
    background: linear-gradient(135deg, #303f9f 0%, #3f51b5 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(63, 81, 181, 0.2);
}

/* Optional field styling */
.optional {
    font-size: 14px;
    color: #888;
    font-weight: normal;
    font-style: italic;
}

body.dark .optional {
    color: #aaa;
}

/* Reviews List */
.reviews-list {
    margin-top: 20px;
}

.review-item {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

body.dark .review-item {
    border-color: #333;
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.reviewer-info h4 {
    font-size: 18px;
    margin-bottom: 5px;
    color: #333;
}

body.dark .reviewer-info h4 {
    color: #e0e0e0;
}

.reviewer-info .review-date {
    font-size: 14px;
    color: #999;
}

.review-rating {
    display: flex;
}

.review-rating i {
    color: #ffc107;
    margin-right: 2px;
}

.review-content {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-top: 10px;
}

body.dark .review-content {
    color: #bbb;
}

/* Custom Scrollbar Styling - Adjusted to match the reference image */
.modal-content::-webkit-scrollbar,
textarea::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 6px; /* Thinner scrollbar width */
}

.modal-content::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: #f1f1f1; /* Light background */
}

.modal-content::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #673ab7 0%, #9c27b0 100%);
    border-radius: 3px; /* Less rounded corners */
}

.modal-content::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #5e35b1 0%, #8e24aa 100%);
}

body.dark .modal-content::-webkit-scrollbar-track,
body.dark textarea::-webkit-scrollbar-track,
body.dark::-webkit-scrollbar-track {
    background: #2a2a2a;
}

/* Responsive Styles */
@media only screen and (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .product-detail-container {
        flex-direction: column;
    }
    
    .product-detail-image {
        max-width: 100%;
    }
    
    .product-detail-info h2 {
        font-size: 22px;
    }
    
    .product-detail-price {
        font-size: 20px;
    }
    
    .product-reviews-section h3 {
        font-size: 20px;
    }
    
    .review-form-container {
        padding: 15px;
    }
    
    .star-rating-input i {
        font-size: 20px;
    }
}
