/**
 * Product Page Premium Enhancements
 * Perfume Premium Theme - Immersive Design
 */

/* Hide scrollbar utility */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Product Editorial Layout */
.product-editorial {
    overflow-x: hidden;
}

.product-editorial h1 {
    letter-spacing: -0.03em;
}

/* Fix for Alpine x-cloak */
[x-cloak] {
    display: none !important;
}

/* Split screen on desktop */
@media (min-width: 1024px) {
    .product-editorial .lg\:grid-cols-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* Sticky gallery panel */
.product-editorial .lg\:sticky {
    position: sticky;
    top: 0;
    height: 100vh;
}

/* Gallery image transitions */
.product-editorial img {
    transition: transform 2s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.5s ease;
    will-change: transform;
}

/* Smooth scale on hover */
.product-editorial .group:hover img.scale-105 {
    transform: scale(1.05);
}

/* Gallery frame */
.product-editorial .rounded-2xl {
    box-shadow: 
        0 0 0 1px rgba(255,255,255,0.05),
        0 20px 50px -10px rgba(0,0,0,0.5),
        inset 0 0 100px rgba(0,0,0,0.3);
}

/* Thumbnail active state pulse */
.product-editorial button.ring-white {
    animation: thumbnailPulse 2s ease-in-out infinite;
}

@keyframes thumbnailPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
    50% { box-shadow: 0 0 0 4px rgba(255,255,255,0); }
}

/* Price override */
.product-editorial .woocommerce-Price-amount {
    font-family: inherit;
    font-weight: inherit;
}

/* Tab underline animation */
.product-editorial button[style*="border-bottom"] {
    border-bottom: 1px solid white !important;
}

/* Content paragraphs */
.product-editorial .space-y-4 > p {
    margin-bottom: 1rem;
}

/* Mobile adjustments */
@media (max-width: 1023px) {
    .product-editorial .lg\:sticky {
        position: relative;
        height: auto;
        min-height: 70vh;
    }
    
    .product-editorial .max-h-\[85vh\] {
        max-height: 70vh;
    }
}

/* Hide default WooCommerce quantity input styling */
.woocommerce div.product form.cart div.quantity input.qty {
    background: transparent !important;
    border: none !important;
    text-align: center !important;
    color: white !important;
    font-family: var(--font-serif, serif) !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    width: 100% !important;
    padding: 0 !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

.woocommerce div.product form.cart div.quantity input.qty::-webkit-outer-spin-button,
.woocommerce div.product form.cart div.quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.woocommerce div.product form.cart div.quantity input.qty:focus {
    outline: none !important;
}

/* Product Gallery Enhancements */
.luxury-product-page .woocommerce-product-gallery {
    opacity: 1 !important;
}

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

/* Product Page Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Premium Hover Effects */
.product-layout-luxury .group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

/* Custom Scrollbar for Product Page */
.luxury-product-page::-webkit-scrollbar {
    width: 8px;
}

.luxury-product-page::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.luxury-product-page::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 4px;
}

.luxury-product-page::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* Mobile Optimizations */
@media (max-width: 1024px) {
    .luxury-product-page .sticky {
        position: relative !important;
        top: auto !important;
    }
}

/* Loading State for Add to Cart */
.woocommerce div.product form.cart button.single_add_to_cart_button.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Product Meta Styling */
.woocommerce div.product .product_meta {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 30px;
}

.woocommerce div.product .product_meta>span {
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.woocommerce div.product .product_meta a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
}

.woocommerce div.product .product_meta a:hover {
    color: #d4af37;
}

/* Related Products - Carousel Design */
.woocommerce .related.products {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.woocommerce .related.products > h2 {
    display: none !important;
}

/* Carousel Styles */
.related-carousel {
    position: relative;
}

/* Smooth slide transitions */
.related-carousel .transition-transform {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card hover effects */
.related-carousel .group:hover {
    transform: translateY(-4px);
}

/* Navigation button hover */
.related-carousel button:not(:disabled):hover {
    transform: translateY(-50%) scale(1.05);
}

/* Toast inside product card */
.single-product .woocommerce-notices-wrapper {
    display: none;
}

.single-product .wc-toast .woocommerce-notices-wrapper {
    display: block;
    margin: 0;
}

.single-product .wc-toast .woocommerce-message,
.single-product .wc-toast .woocommerce-error,
.single-product .wc-toast .woocommerce-info {
    background: linear-gradient(135deg, rgba(18,18,18,0.95), rgba(30,30,30,0.95));
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
    font-size: 13px;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.single-product .wc-toast .woocommerce-message::before {
    content: '✓';
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #10b981;
    color: #0b0b0b;
    font-weight: 700;
    font-size: 12px;
}

.single-product .wc-toast .woocommerce-error::before {
    content: '!';
    background: #ef4444;
    color: #0b0b0b;
}

.single-product .wc-toast .woocommerce-info::before {
    content: 'i';
    background: #f59e0b;
    color: #0b0b0b;
}

/* Hide scrollbar */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Line clamp */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Truncate text */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Line clamp utility for product titles */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Product Gallery Grid - Dynamic columns */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Ensure product images display correctly */
.product-redesign img {
    max-width: 100%;
    height: auto;
}

/* Main gallery image container */
.product-redesign .aspect-\[4\/5\] {
    aspect-ratio: 4/5;
}

/* Thumbnail active state */
.product-redesign button[class*="ring-gold"] img {
    transform: scale(1.05);
}

/* Product Tabs (if enabled) */
.woocommerce div.product .woocommerce-tabs {
    margin-top: 60px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    display: flex;
    gap: 20px;
    border: none;
    padding: 0;
    margin-bottom: 40px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 0;
    margin: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 700;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #d4af37;
}

.woocommerce div.product .woocommerce-tabs .panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 32px;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
}

/* Ensure images maintain aspect ratio */
.luxury-product-page img {
    max-width: 100%;
    height: auto;
}

/* Premium Focus States */
.luxury-product-page button:focus,
.luxury-product-page input:focus,
.luxury-product-page select:focus {
    outline: 2px solid rgba(212, 175, 55, 0.5);
    outline-offset: 2px;
}

/* Accessibility Improvements */
.luxury-product-page *:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 4px;
}