﻿﻿.product-details-container {
    padding: 2rem 0;
}

.container {
    margin-top: 20px;
}

.product-gallery {
    position: sticky;
    top: 2rem;
}

.main-image-container {
    position: relative;
    border-radius: 15px;
    overflow: visible; /* Changed from hidden to visible */
    margin-bottom: 1rem;
    background: #f8f9fa;
    min-height: 500px; /* Ensure minimum height */
}

/* Enhanced Zoom Functionality */
.image-zoom-wrapper {
    position: relative;
    display: flex;
    gap: 30px; /* Increased gap */
    align-items: flex-start;
    width: 100%;
}

.image-zoom-container {
    position: relative;
    flex: 1;
    border-radius: 15px;
    overflow: hidden;
    cursor: crosshair; /* Better cursor for zoom */
    min-width: 500px; /* Minimum width for main image */
    background: white;
    border: 1px solid #e9ecef;
}

.main-product-image {
    width: 100%;
    height: auto;
    min-height: 500px;
    max-height: 600px;
    object-fit: contain; /* Changed to contain for better display */
    background: white;
    transition: transform 0.3s ease;
    display: block;
}

.zoom-lens {
    position: absolute;
    width: 200px; /* Larger lens for better visibility */
    height: 200px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.zoom-preview {
    position: relative;
    width: 500px; /* Larger preview */
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 15px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    flex-shrink: 0; /* Prevent shrinking */
}

    .zoom-preview.active {
        opacity: 1;
        visibility: visible;
    }

    .zoom-preview img {
        width: 100%;
        height: 100%;
        object-fit: contain; /* Changed to contain */
        transform-origin: 0 0;
        transition: transform 0.1s ease;
    }

.sale-badge-large {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, var(--primary-red), #e74c3c);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 25px;
    font-weight: bold;
    text-align: center;
    animation: pulse 2s infinite;
    z-index: 25; /* Higher z-index to appear above everything */
}

.sale-text {
    display: block;
    font-size: 0.8rem;
}

.discount-percent {
    display: block;
    font-size: 1.1rem;
}

.image-thumbnails {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.thumbnail-container {
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail {
    width: 90px; /* Slightly larger thumbnails */
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    transform: scale(1);
    background: white;
}

    .thumbnail:hover {
        border-color: var(--primary-blue);
        transform: scale(1.08);
    }

    .thumbnail.active {
        border-color: var(--primary-blue);
        transform: scale(1.08);
        box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
    }

.no-image-placeholder {
    width: 100%;
    height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--border-color);
    font-size: 3rem;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px dashed #dee2e6;
}

    .no-image-placeholder p {
        margin-top: 1rem;
        font-size: 1.1rem;
        color: #6c757d;
    }

.product-info {
    padding: 0 2rem;
}

@media (max-width: 1200px) {
    .image-zoom-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .image-zoom-container {
        min-width: 100%;
    }

    .zoom-preview {
        width: 100%;
        height: 400px;
        margin-top: 0;
    }

    .main-product-image {
        min-height: 400px;
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .product-info {
        padding: 0;
        margin-top: 2rem;
    }

    .product-title {
        font-size: 2rem;
    }

    .image-zoom-container {
        cursor: pointer;
        min-width: 100%;
    }

    .zoom-lens {
        display: none;
    }

    .zoom-preview {
        display: none;
    }

    .main-product-image {
        cursor: pointer;
        min-height: 300px;
        max-height: 400px;
    }

    .thumbnail {
        width: 70px;
        height: 70px;
    }

    .cart-actions {
        flex-direction: column;
    }

    .btn-add-to-cart,
    .btn-buy-now {
        width: 100%;
    }

    #imageModal .modal-dialog {
        margin: 0;
    }

    #imageModal .modal-body {
        min-height: 50vh;
    }

    .rating-summary {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .comment-actions {
        flex-direction: column;
    }

    .color-variants-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.75rem;
    }

    .color-variant-image,
    .color-variant-fallback {
        width: 60px;
        height: 60px;
    }

    .color-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .color-variants-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-product-image {
        min-height: 250px;
        max-height: 350px;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }
}

/* Rest of your existing CSS remains the same */
.product-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.product-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.club-badge, .category-badge, .new-badge, .featured-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.club-badge {
    background: var(--primary-red);
}

.category-badge {
    background: var(--primary-blue);
}

.new-badge {
    background: #28a745;
}

.featured-badge {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #856404;
}

.price-section {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.original-price {
    text-decoration: line-through;
    color: darkgray;
    font-size: 1.2rem;
}

.discounted-price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-red);
    margin: 0.25rem 0;
}

.current-price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-blue);
}

.discount-info {
    color: #28a745;
    font-weight: 600;
}


.product-description h4,
.product-variants h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

/* Color Variants - Circular Design Without Boxes */
.color-variants-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem; /* Increased gap since we don't have boxes anymore */
    align-items: center;
}

.color-variant-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0; /* Remove padding */
    border: none; /* Remove border */
    background: transparent; /* Transparent background */
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

    .color-variant-item:hover {
        border: none; /* Remove border on hover */
        transform: translateY(-2px);
        box-shadow: none; /* Remove box shadow */
    }

.color-variant-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #f0f0f0;
    transition: all 0.3s ease;
}

.color-variant-item:hover .color-variant-image {
    border-color: var(--primary-blue);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.color-variant-fallback {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    border: 3px solid #f0f0f0;
    transition: all 0.3s ease;
}

.color-variant-item:hover .color-variant-fallback {
    border-color: var(--primary-blue);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.color-initial {
    text-transform: uppercase;
    filter: brightness(0) invert(1);
}

.color-name {
    font-weight: 600;
    color: var(--dark-text);
    font-size: 0.8rem;
    text-align: center;
    margin-top: 0.25rem;
}

/* Optional: Add a subtle background on hover for better visual feedback */
.color-variant-item:hover .color-name {
    color: var(--primary-blue);
}

/* Responsive design for circular color variants without boxes */
@media (max-width: 768px) {
    .color-variants-grid {
        gap: 1rem;
    }

    .color-variant-image,
    .color-variant-fallback {
        width: 50px;
        height: 50px;
    }

    .color-variant-fallback {
        font-size: 0.9rem;
    }

    .color-name {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .color-variants-grid {
        gap: 0.75rem;
        justify-content: center; /* Center align on mobile */
    }

    .color-variant-image,
    .color-variant-fallback {
        width: 45px;
        height: 45px;
        border-width: 2px; /* Thinner border on mobile */
    }

    .color-variant-fallback {
        font-size: 0.8rem;
    }

    .color-name {
        font-size: 0.7rem;
    }
}


.add-to-cart-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
}

.quantity-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .quantity-btn:hover {
        background: var(--primary-blue);
        color: white;
        border-color: var(--primary-blue);
    }

.quantity-input {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

.cart-actions {
    display: flex;
    gap: 1rem;
}

.btn-add-to-cart {
    background: linear-gradient(45deg, var(--primary-blue), #3498db);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
}

    .btn-add-to-cart:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    }

.btn-buy-now {
    background: linear-gradient(45deg, var(--primary-red), #e74c3c);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
}

    .btn-buy-now:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
    }

/* Modal Styles */
.enlarged-image {
    max-height: 80vh;
    max-width: 100%;
    object-fit: contain;
}

#imageModal .modal-content {
    background: transparent;
    border: none;
}

#imageModal .modal-header {
    border-bottom: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

    #imageModal .modal-header .btn-close {
        background-color: white;
        opacity: 1;
        padding: 0.5rem;
    }

#imageModal .modal-body {
    padding: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

#imageModal .modal-title {
    color: white;
    margin-right: 1rem;
}

/* Reviews Section */
.reviews-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.section-title {
    font-family: var(--font-heading);
    color: var(--primary-blue);
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--primary-red);
    padding-bottom: 0.5rem;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.average-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rating-stars.large {
    font-size: 1.5rem;
}

.rating-stars .fa-star {
    color: #ddd;
}

    .rating-stars .fa-star.active {
        color: #ffc107;
    }

.rating-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-text);
}

.total-reviews {
    color: var(--dark-text);
    opacity: 0.8;
}

.add-review-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
}

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

    .star-rating input {
        display: none;
    }

    .star-rating label {
        font-size: 2rem;
        color: #ddd;
        cursor: pointer;
        transition: color 0.2s;
    }

        .star-rating input:checked ~ label,
        .star-rating label:hover,
        .star-rating label:hover ~ label {
            color: #ffc107;
        }

.btn-submit-review {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-weight: 600;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

    .comment-card:hover {
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .comment-card.highlighted {
        background-color: #fff3cd;
        transition: background-color 2s ease;
    }

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 600;
    color: var(--primary-blue);
}

.comment-rating .fa-star {
    color: #ffc107;
    font-size: 0.9rem;
}

.comment-date {
    color: var(--dark-text);
    opacity: 0.7;
    font-size: 0.9rem;
}

.comment-content {
    margin: 0;
    line-height: 1.6;
}

.comment-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.btn-delete-comment {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-remove-form-featured {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-feature-comment {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.no-comments {
    text-align: center;
    padding: 3rem;
    color: var(--dark-text);
    opacity: 0.7;
}

    .no-comments .fa-comments {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

/* Touch device enhancements */
@media (hover: none) and (pointer: coarse) {
    .image-zoom-container {
        cursor: pointer;
    }

    .zoom-lens {
        display: none;
    }

    .zoom-preview {
        display: none;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(217, 35, 35, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(217, 35, 35, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(217, 35, 35, 0);
    }
}
