/**
 * Single Product Page Styles
 *
 * Custom styling for WooCommerce single product pages
 *
 * @package LifeVibe
 */

/* Product Gallery */
.woocommerce-product-gallery {
    position: relative;
}

.woocommerce-product-gallery__wrapper {
    margin: 0;
}

.woocommerce-product-gallery__image {
    width: 100%;
}

.woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    display: block;
    mix-blend-mode: multiply;
}

/* Thumbnail Navigation */
.product-thumbnails .thumbnail-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-thumbnails .thumbnail-item:hover {
    opacity: 1 !important;
    border-color: #9ca3af;
}

.product-thumbnails .thumbnail-item.active {
    opacity: 1 !important;
    border-color: #15803d !important;
    border-width: 2px;
}

/* Product Variations */
.variation-option {
    cursor: pointer;
    transition: all 0.3s ease;
}

.variation-option:hover {
    border-color: #15803d;
    background-color: #f0fdf4;
}

.variation-option.selected,
.variation-option.active {
    border-color: #15803d !important;
    background-color: #f0fdf4 !important;
}

/* Cross-sell Items */
.crosssell-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.crosssell-item:hover {
    opacity: 1 !important;
}

.crosssell-item.active .w-16 {
    border-width: 2px;
    border-color: #15803d;
}

/* Pot Filters */
.pot-filter {
    cursor: pointer;
    transition: all 0.3s ease;
    padding-bottom: 0.5rem;
    margin-bottom: -0.625rem;
}

.pot-filter.active {
    color: #2B3C26;
    border-bottom: 2px solid #2B3C26;
}

/* Upsell Checkboxes */
.upsell-checkbox {
    cursor: pointer;
    border-radius: 0.25rem;
}

.upsell-checkbox:checked {
    background-color: #15803d;
    border-color: #15803d;
}

.upsell-item:hover {
    background-color: #f9fafb;
}

/* Sticky Cart Box */
#sticky-cart-box {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.total-price {
    transition: opacity 0.2s ease;
}

/* Add to Cart Button */
.single_add_to_cart_button {
    transition: all 0.3s ease;
}

.single_add_to_cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(224, 121, 40, 0.3), 0 4px 6px -2px rgba(224, 121, 40, 0.2);
}

.single_add_to_cart_button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.single_add_to_cart_button.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Product Description */
.prose {
    max-width: none;
}

.prose h2 {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.prose p {
    font-size: 1.125rem;
    line-height: 1.75;
    color: #4b5563;
    margin-bottom: 1rem;
}

/* Care Icons */
.care-icon {
    transition: transform 0.3s ease;
}

.care-icon:hover {
    transform: scale(1.1);
}

/* Specifications Box */
.specifications-box {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* App Promo Box */
.app-promo-box {
    background-color: #2B3C26;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

.app-promo-box:hover svg {
    transform: scale(1.1);
}

/* Reviews */
.review-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Review Form */
#review_form_wrapper {
    background-color: #f9fafb;
    padding: 2rem;
    border-radius: 0.75rem;
}

#review_form input[type="text"],
#review_form input[type="email"],
#review_form textarea,
#review_form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#review_form input[type="text"]:focus,
#review_form input[type="email"]:focus,
#review_form textarea:focus,
#review_form select:focus {
    outline: none;
    border-color: #15803d;
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1);
}

/* WooCommerce Overrides */
.woocommerce-product-rating {
    margin-bottom: 1rem;
}

.woocommerce-product-rating .star-rating {
    color: #E07928;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .product-thumbnails {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
        width: 100%;
        margin-bottom: 1rem;
    }

    .product-thumbnails .thumbnail-item {
        width: 4rem;
        height: 4rem;
        flex-shrink: 0;
    }

    #sticky-cart-box {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06);
    }

    .review-card {
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    .product-thumbnails,
    #sticky-cart-box,
    .single_add_to_cart_button,
    #review_form_wrapper {
        display: none;
    }
}

/* Accessibility */
.variation-option:focus,
.crosssell-item:focus,
.pot-filter:focus {
    outline: 2px solid #15803d;
    outline-offset: 2px;
}

/* Loading States */
.variation-loading,
.price-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Success Animation */
@keyframes successPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.added-to-cart-success {
    animation: successPulse 0.5s ease-in-out;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Cross-sells */
.crosssells-container::-webkit-scrollbar {
    height: 6px;
}

.crosssells-container::-webkit-scrollbar-track {
    background: transparent;
}

.crosssells-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.crosssells-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
