/* Product Page Specific Styles */

/* Product Image Gallery */
.product-image {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
    border-radius: 8px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product detail page wishlist button - different from category pages */
.wishlist-toggle-detail {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    background: #fff !important;
    border: 2px solid #dee2e6 !important;
    color: #6c757d !important;
    transition: all 0.3s ease !important;
}

.wishlist-toggle-detail:hover {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
    background: #fff !important;
}

.wishlist-toggle-detail.active,
.wishlist-toggle-detail.in-wishlist {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
    color: white !important;
}

.wishlist-toggle-detail:not(.active):not(.in-wishlist) {
    background: #fff !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
}

.wishlist-toggle-detail i {
    font-size: 16px !important;
}

/* Enhanced Image Gallery Styles */
.main-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.main-product-image:hover {
    transform: scale(1.05);
}

/* Image zoom modal */
.image-zoom-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    cursor: zoom-out;
}

.image-zoom-modal img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.product-thumbnails {
    margin-top: 15px;
}

.thumbnail {
    width: 100%;
    height: 120px;
    object-fit: contain;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 5px;
}

.thumbnail:hover {
    opacity: 1;
    border-color: #8062d6;
    transform: scale(1.05);
}

.thumbnail.active {
    opacity: 1;
    border-color: #8062d6;
    box-shadow: 0 0 10px rgba(128, 98, 214, 0.3);
}

.product-image:hover::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    opacity: 0.8;
}

.product-image:hover img {
    opacity: 0.8;
}

/* Product Details */
.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #8062d6;
    margin-bottom: 1rem;
}

.original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

.product-description {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Quantity Controls */
.quantity-control {
    display: flex;
    align-items: center;
    width: fit-content;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 0;
    padding: 0.375rem 0.75rem;
}

.quantity-btn {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #212529;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.quantity-btn:hover {
    background-color: #e9ecef;
}

.quantity-minus {
    border-radius: 0.25rem 0 0 0.25rem;
}

.quantity-plus {
    border-radius: 0 0.25rem 0.25rem 0;
}

/* Star Rating */
.rating-container {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.rating-input {
    display: none;
}

.rating-label {
    color: #ced4da;
    font-size: 1.5rem;
    padding: 0 0.1em;
    cursor: pointer;
    transition: color 0.3s ease;
}

.rating-label:hover,
.rating-label:hover ~ .rating-label,
.rating-label.active,
.rating-label.active ~ .rating-label {
    color: #ffc107;
}

.rating-container.is-invalid .rating-label {
    color: #dc3545;
}

/* Review styles */
.review-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

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

.review-rating {
    color: #ffc107;
    margin-bottom: 0.5rem;
}

/* Wishlist button */
.wishlist-toggle {
    background-color: transparent;
    border: none;
    color: #6c757d;
    padding: 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.wishlist-toggle:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(220, 53, 69,0.2);
}

.wishlist-toggle.active,
.wishlist-toggle.in-wishlist {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Wishlist button next to title styling */
.d-flex .wishlist-toggle {
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Mobile responsiveness for title with wishlist button */
@media (max-width: 768px) {
    .d-flex .wishlist-toggle {
        width: 40px;
        height: 40px;
        margin-left: 0.75rem;
    }

    .d-flex h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .d-flex .wishlist-toggle {
        width: 35px;
        height: 35px;
        margin-left: 0.5rem;
    }

    .d-flex h1 {
        font-size: 1.3rem;
    }
}

/* Related products section */
.related-products-title {
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.related-products-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background-color: #8062d6;
}
/* Product card hover effects for related products */
.product-card .product-image:hover .product-overlay {
    opacity: 1 !important;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.product-card .card-img-top {
    transition: transform 0.3s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .quantity-btn {
    background-color: #343a40;
    border-color: #495057;
    color: #e9ecef;
}

[data-bs-theme="dark"] .quantity-btn:hover {
    background-color: #495057;
}

[data-bs-theme="dark"] .quantity-input {
    background-color: #343a40;
    border-color: #495057;
    color: #e9ecef;
}

[data-bs-theme="dark"] .rating-label {
    color: #495057;
}

[data-bs-theme="dark"] .review-item {
    border-color: #495057;
}

/* Zoom modal styles */
.modal-img {
    max-width: 100%;
    max-height: 80vh;
}

.modal-backdrop.show {
    opacity: 0.8;
}

.modal-content.bg-transparent {
    box-shadow: none;
}
.product-thumbnails .thumbnail {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.product-thumbnails .thumbnail.active {
    border-color: #0d6efd;
}

.product-thumbnails .thumbnail:hover {
    opacity: 0.8;
}

.main-product-image {
    transition: all 0.3s ease;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    /* Mobile product details spacing */
    .product-details p,
    .product-details .mb-2,
    .product-details .mb-3 {
        margin-bottom: 1rem !important;
        line-height: 1.6 !important;
    }

    .product-details strong {
        display: block !important;
        margin-bottom: 0.25rem !important;
    }

    /* Specific spacing for category, weights, and shipping */
    .product-category,
    .product-weights,
    .product-shipping {
        margin-bottom: 1.2rem !important;
        padding: 0.5rem 0 !important;
    }

    /* Ensure proper spacing for any paragraphs in product details */
    .product-details .card-body p {
        margin-bottom: 1rem !important;
        line-height: 1.5 !important;
    }

    /* Mobile spacing for accordion details section */
    .accordion-body .row {
        margin-bottom: 1rem !important;
    }

    .accordion-body .row .col-4,
    .accordion-body .row .col-8 {
        padding: 0.5rem 0 !important;
        line-height: 1.6 !important;
    }

    .accordion-body .row .col-4 strong {
        display: block !important;
        margin-bottom: 0.5rem !important;
        color: #333 !important;
        font-weight: 600 !important;
    }

    .accordion-body .row .col-8 {
        padding-left: 1rem !important;
    }

    /* Better mobile layout for details */
    .accordion-body .row {
        flex-direction: column !important;
    }

    .accordion-body .row .col-4,
    .accordion-body .row .col-8 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
    }

    .accordion-body .row .col-8 {
        margin-bottom: 1rem !important;
        padding-top: 0 !important;
    }
}