/* Modern Minimalist Product Detail - Premium E-Commerce */

/* Product Detail Layout */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    margin: 4rem 0;
    align-items: start;
    animation: fadeIn 0.8s ease-out;
}

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

/* Product Gallery */
.product-gallery {
    position: sticky;
    top: 2rem;
    animation: fadeInLeft 0.6s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-main-image {
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    position: relative;
    background: #f5f5f5;
}

.product-main-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26,26,26,0.02), rgba(26,26,26,0));
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.product-main-image:hover::before {
    opacity: 1;
}

.product-main-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    filter: grayscale(0.05);
}

.product-main-image:hover img {
    transform: scale(1.03);
    filter: grayscale(0);
}

.product-video {
    margin-top: 2rem;
}

.product-video h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #1a1a1a;
    margin-bottom: 1.25rem;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.product-video video {
    width: 100%;
    border-radius: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Product Info */
.product-info {
    padding: 0;
    animation: fadeInRight 0.6s ease-out;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    font-weight: 300;
    letter-spacing: -0.03em;
}

/* Price Section */
.product-price-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e8e8e8;
}

.dynamic-price {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.original-price {
    font-size: 1.3rem;
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
}

/* Product Meta Grid */
.product-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: #fafafa;
    border-radius: 0;
    border: 1px solid #e8e8e8;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.5rem;
}

.meta-value {
    font-size: 1.05rem;
    color: #1a1a1a;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Variant Selection */
.variant-selection {
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: #1a1a1a;
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f5f5f5;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.variant-option {
    flex: 0 0 calc(33.333% - 1rem);
    padding: 1.25rem 1.5rem;
    border: 2px solid #e8e8e8;
    border-radius: 0;
    cursor: pointer;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    position: relative;
    overflow: hidden;
}

.variant-option::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(26,26,26,0.05);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.variant-option:hover:not(.out-of-stock)::before {
    width: 300px;
    height: 300px;
}

.variant-option:hover:not(.out-of-stock) {
    border-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.variant-option.selected {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 26, 26, 0.2);
}

.variant-option.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    background: #fafafa;
}

.variant-size {
    font-weight: 600;
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

.variant-stock {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    z-index: 1;
}

.selected-variant-display {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    padding: 1.75rem;
    border-radius: 0;
    margin-bottom: 1.75rem;
    border-left: 3px solid #1a1a1a;
    display: none;
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-variant-info {
    font-weight: 500;
    color: #1a1a1a;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

/* Quantity Selector */
.quantity-section {
    margin-bottom: 3rem;
}

.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 2px solid #e8e8e8;
    border-radius: 0;
    overflow: hidden;
    background: white;
    transition: border-color 0.3s ease;
}

.quantity-selector:hover {
    border-color: #bbb;
}

.quantity-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: #fafafa;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 500;
    color: #1a1a1a;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 60px;
    font-family: 'Inter', sans-serif;
}

.quantity-btn:hover:not(:disabled) {
    background: #1a1a1a;
    color: white;
}

.quantity-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quantity-input {
    width: 90px;
    text-align: center;
    padding: 1rem;
    border: none;
    border-left: 1px solid #e8e8e8;
    border-right: 1px solid #e8e8e8;
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a1a;
    background: white;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.01em;
}

.stock-info {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Add to Cart Button */
.add-to-cart-section {
    margin-bottom: 3.5rem;
}

.add-to-cart-btn {
    width: 100%;
    padding: 1.5rem 2.5rem;
    background: #999;
    color: white;
    border: none;
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.add-to-cart-btn:hover::before {
    width: 400px;
    height: 400px;
}

.add-to-cart-btn:enabled {
    background: #1a1a1a;
    box-shadow: 0 4px 16px rgba(26, 26, 26, 0.2);
}

.add-to-cart-btn:enabled:hover {
    background: #000;
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(26, 26, 26, 0.3);
}

/* Product Description */
.product-description {
    margin-bottom: 3.5rem;
}

.product-description h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: #1a1a1a;
    margin-bottom: 1.25rem;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.description-content {
    line-height: 1.8;
    color: #555;
    font-size: 1.05rem;
    font-weight: 300;
}

/* Additional Details */
.additional-details {
    background: #fafafa;
    padding: 2.5rem;
    border-radius: 0;
    margin-bottom: 3.5rem;
    border: 1px solid #e8e8e8;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Related Products */
.related-products {
    margin-top: 5rem;
    padding-top: 4rem;
    border-top: 1px solid #e8e8e8;
}

.related-products .section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: none;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.related-products .section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #1a1a1a, transparent);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.related-product-card {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f5f5f5;
    cursor: pointer;
    position: relative;
}

.related-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26,26,26,0.02), rgba(26,26,26,0));
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.related-product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
    border-color: transparent;
}

.related-product-card:hover::before {
    opacity: 1;
}

.related-product-image {
    height: 280px;
    overflow: hidden;
    background: #f8f8f8;
}

.related-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    filter: grayscale(0.1);
}

.related-product-card:hover .related-product-image img {
    transform: scale(1.08);
    filter: grayscale(0);
}

.related-product-info {
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.related-product-name {
    font-size: 1.15rem;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.related-product-card:hover .related-product-name {
    color: #666;
}

.related-product-price {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

/* Popup Styles */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.cart-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 3rem;
    border-radius: 0;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    z-index: 1002;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: popupIn 0.4s ease-out;
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.cart-popup h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.cart-popup p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.popup-product-info {
    background: #fafafa;
    padding: 2rem;
    border-radius: 0;
    margin-bottom: 2.5rem;
    border-left: 3px solid #1a1a1a;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    text-align: left;
}

.popup-product-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.popup-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.popup-product-name {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.popup-product-info > div {
    color: #666;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.popup-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.popup-product-details > div {
    color: #666;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.popup-btn {
    padding: 1rem 2rem;
    border: 2px solid #1a1a1a;
    border-radius: 0;
    background: white;
    color: #1a1a1a;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
}

.popup-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(26,26,26,0.1);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.popup-btn:hover::before {
    width: 300px;
    height: 300px;
}

.popup-btn.primary {
    background: #1a1a1a;
    color: white;
}

.popup-btn.primary::before {
    background: rgba(255,255,255,0.15);
}

.popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Alert Messages */
.alert {
    padding: 1.25rem 1.75rem;
    margin-bottom: 2rem;
    border-radius: 0;
    border-left: 4px solid;
    animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

/* Placeholder Image */
.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}



/* Responsive Design */
@media (max-width: 1400px) {
    .product-detail {
        gap: 4rem;
    }
}

@media (max-width: 1200px) {
    .product-detail {
        gap: 3rem;
    }
    
    .product-title {
        font-size: 2.5rem;
    }
    
    .dynamic-price {
        font-size: 2.2rem;
    }
}

@media (max-width: 992px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 3rem;
        margin: 3rem 0;
    }
    
    .product-gallery {
        position: static;
    }
    
    .product-title {
        font-size: 2.2rem;
    }
    
    .dynamic-price {
        font-size: 2rem;
    }
    
    .variant-option {
        flex: 0 0 calc(50% - 1rem);
    }
    
    .related-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .product-detail {
        margin: 2rem 0;
        gap: 2rem;
    }
    
    .product-title {
        font-size: 2rem;
    }
    
    .dynamic-price {
        font-size: 1.8rem;
    }
    
    .product-meta-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1.25rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .additional-details {
        padding: 2rem;
    }
    
    .popup-actions {
        flex-direction: column;
    }
    
    .popup-btn {
        width: 100%;
    }
    
    .related-products {
        margin-top: 4rem;
        padding-top: 3rem;
    }
    
    .related-products .section-title {
        font-size: 2rem;
    }
    
    .related-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 576px) {
    .product-title {
        font-size: 1.8rem;
    }
    
    .dynamic-price {
        font-size: 1.6rem;
    }
    
    .original-price {
        font-size: 1.1rem;
    }
    
    .variant-option {
        flex: 0 0 100%;
        padding: 1rem 1.25rem;
    }
    
    .variant-size {
        font-size: 1.05rem;
    }
    
    .quantity-selector {
        width: 100%;
        justify-content: center;
    }
    
    .quantity-btn {
        padding: 0.875rem 1.25rem;
        min-width: 50px;
    }
    
    .quantity-input {
        width: 80px;
    }
    
    .add-to-cart-btn {
        padding: 1.25rem 2rem;
        font-size: 0.85rem;
    }
    
    .cart-popup {
        padding: 2rem 1.5rem;
    }
    
    .cart-popup h3 {
        font-size: 1.6rem;
    }
    
     .popup-product-info {
        flex-direction: row;
        text-align: left;
        gap: 1.5rem;
        align-items: center;
    }
    
     .popup-product-details {
        justify-content: flex-start;
    }
    
      .popup-product-image {
        width: 120px;
        height: 120px;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .related-product-image {
        height: 240px;
    }
    
    .related-products .section-title {
        font-size: 1.8rem;
    }
}

/* Performance Optimizations */
.product-main-image img,
.related-product-image img {
    will-change: transform;
}

.product-card,
.related-product-card {
    will-change: transform;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Thumbnail Gallery */
.thumbnail-gallery {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border: 2px solid #e8e8e8;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.thumbnail:hover {
    border-color: #bbb;
}

.thumbnail.active {
    border-color: #1a1a1a;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #999;
    text-align: center;
    padding: 5px;
}

.video-thumbnail {
    position: relative;
}

.video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1a1a1a;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.placeholder-thumbnail {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.video-modal.active {
    display: flex;
}

.video-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    width: 800px;
}

.close-video {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10001;
}

#modal-video {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Responsive Gallery */
@media (max-width: 768px) {
    .thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .video-modal-content {
        max-width: 95%;
    }
}


/* Fix footer collision for product detail page */
.main .container:last-child {
    padding-bottom: 6rem;
}

/* Specific fix for View More Products button */
.main .container > div:last-child {
    margin-bottom: 4rem !important;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .main .container:last-child {
        padding-bottom: 4rem;
    }
    
    .main .container > div:last-child {
        margin-bottom: 3rem !important;
    }
}

@media (max-width: 576px) {
    .main .container:last-child {
        padding-bottom: 3rem;
    }
    
    .main .container > div:last-child {
        margin-bottom: 2rem !important;
    }
}