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

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

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

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

@keyframes overlayFadeOut {
    from {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
    to {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

@keyframes cart-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.cart-bounce {
    animation: cart-bounce 0.5s ease-in-out;
}

.product-container {
    padding: 2rem;
    margin-top: 2rem;
    display: flex;
    justify-content: center; 
    align-items: flex-start; 
    gap: 2rem;
    font-family: 'Montserrat', sans-serif;
    max-width: 1200px;
    margin-left: auto; 
    margin-right: auto;
    flex-wrap: nowrap;
}

.product-image-container {
    text-align: center;
}

.product-image-container,
.product-details-wrapper {
    flex: 1;
    max-width: 50%; 
    box-sizing: border-box;
}

.product-details-wrapper {
    overflow-y: auto; 
    padding-right: 1rem;
    box-sizing: border-box;
}

@media (max-width: 768px) { 
    .product-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem; 
    }

    .item-page .product-image-container,
    .set-page .product-image-container {
        display: contents;
    }

    .item-page .product-image,
    .set-page .product-image {
        order: 1;
    }

    .item-page .product-details-wrapper,
    .set-page .product-details-wrapper {
        order: 2;
        align-self: stretch;
        width: 100%;
        padding-right: 0;
    }

    .item-page .fragrance-description,
    .set-page .fragrance-description {
        order: 3;
        width: auto;
        max-width: none;
        align-self: stretch;
        box-sizing: border-box;
    }

    .product-image-container,
    .product-details-wrapper {
        max-width: 100%;
        flex: none; 
    }

    .quantity-selector {
        justify-content: space-between; 
        flex-wrap: nowrap; 
    }

    .btn-size {
        width: 100%; 
        max-width: 80px; 
    }
}

.product-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
}

.product-image {
    max-width: 80%;
    border-radius: 10px;
}

.product-details {
    flex: 1;
}

.product-title {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
}

.product-info-container {
    background: linear-gradient(135deg, #fdf9f0 0%, #f8f2e2 100%) !important;
    border: 1.5px solid #c9a02c !important;
    border-radius: 6px !important;
    padding: 20px 28px !important;
    margin: 0 0 1rem 0 !important;
    box-shadow: 0 2px 12px rgba(201, 160, 44, 0.10) !important;
    max-width: none !important;
    width: 100% !important;
    display: block !important;
    position: relative !important;
}

.product-info-name {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 2.4rem !important;
    font-weight: 700 !important;
    color: #2f261b !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
}

.product-info-divider {
    border: none !important;
    border-top: 1px solid #c9a02c !important;
    opacity: 0.4 !important;
    margin: 12px 0 14px !important;
}

.product-info {
    font-size: 1.05rem !important;
    color: #555 !important;
    margin-bottom: 10px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
}

.product-info:last-child {
    margin-bottom: 0 !important;
}

.product-price {
    font-size: 2rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.size-options {
    margin-bottom: 1.5rem;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-size {
    display: inline-block;
    padding: 10px 10px;
    width: 80px;
    margin: 5px;
    border: 1px solid #000000;
    border-radius: 5px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-size:hover {
    background-color: #dfdfdf;
}

.btn-check:checked + .btn-size {
    background-color: black; 
    color: #fff;
    border-color: black;
    transform: scale(1.05);
}

.btn-size:active {
    transform: scale(0.95);
}

.quantity-input {
    text-align: center;
}

.add-to-cart-btn {
    background: linear-gradient(135deg, #5a4526 0%, #6b5220 100%);
    color: white;
    border: none;
    border-radius: 8px;
    transition: background 0.3s;
    margin-left: 10px;
    font-size: 15px;
    padding: 8px;
    width: 200px;
    max-width: 200px;
    flex-shrink: 1;
    align-self: center;
}
@media (max-width: 480px) {
    .add-to-cart-btn {
        width: 150px; 
        max-width: 150px;
        font-size: 0.8em; 
    }
}

.quantity-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    flex-shrink: 1;
    border-radius: 8px;
    border: 1px solid #e0d6c4;
}

.quantity-btn {
    background-color: #f2ece3;
    color: #2f261b;
    border: none; 
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-shrink: 1;
}

.quantity-btn:hover {
    background-color: #2f261b;
    color: white;
}

.quantity-input {
    text-align: center;
    border: none;
    width: 5rem;
    height: 2.5rem;
    font-size: 1rem;
    padding: 0;
    color: #2f261b;
    background-color: #f2ece3;
}

.perfume-additional-info {
    font-family: 'Montserrat', sans-serif;
    margin-top: 20px;
    gap: 200px;
}

.btn-atomizer {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;         /* reduced size */
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1), -2px -2px 5px rgba(255,255,255,0.7);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-check:checked + .btn-atomizer {
    background: linear-gradient(145deg, #555, #333);
    border-color: #222;
    transform: scale(1.1);
    animation: selected-bounce 0.5s ease;
}

.btn-atomizer:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 8px rgba(0,0,0,0.2), -3px -3px 8px rgba(255,255,255,0.8);
}

@keyframes selected-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Atomizer hover tooltip that follows mouse */
.atomizer-hover-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.12s ease;
    background: #faf8f5;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 8px;
    border: 2px solid #c9a02c;
    will-change: transform, opacity;
    margin-bottom: 0;
}

.atomizer-hover-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.atomizer-hover-tooltip img {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

/* Arrow pointing down at cursor (tooltip appears below cursor) */
.atomizer-hover-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #6c757d;
    border-bottom: none;
    width: 0;
    height: 0;
}

/* Remove the old overlay styles */
.atomizer-overlay {
    display: none !important;
}

/* Atomizer popup modal */
.atomizer-popup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    opacity: 0;
    align-items: center;
    justify-content: center;
}

.atomizer-popup-modal.show {
    display: flex;
    animation: overlayFadeIn 0.3s ease forwards;
}

.atomizer-popup-modal.closing {
    display: flex; /* Keep flexbox centering during close */
    animation: overlayFadeOut 0.3s ease forwards;
}

.atomizer-popup-content {
    position: relative;
    background: #faf8f5;
    border-radius: 12px;
    padding: 24px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 0 2px #c9a02c;
    transform: scale(0.7) translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.atomizer-popup-modal.show .atomizer-popup-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.atomizer-popup-modal.closing .atomizer-popup-content {
    transform: scale(0.7) translateY(-20px);
    opacity: 0;
}

.atomizer-popup-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.atomizer-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: #999;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    padding: 0;
}

.atomizer-popup-close:hover {
    color: #2c2c2c;
}

.atomizer-popup-title {
    text-align: center;
    margin-bottom: 18px;
    font-size: 1.35em;
    font-weight: 600;
    color: #2c2c2c;
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.4px;
}

.atomizer-popup-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.atomizer-popup-prev,
.atomizer-popup-next {
    background: none;
    border: none;
    border-bottom: 1.5px solid #c9a02c;
    border-radius: 0;
    width: auto;
    height: auto;
    padding: 2px 10px;
    font-size: 1.3em;
    cursor: pointer;
    color: #c9a02c;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
    line-height: 1;
}

.atomizer-popup-prev:hover,
.atomizer-popup-next:hover {
    color: #b8862b;
    border-color: #b8862b;
}

.atomizer-popup-counter {
    font-size: 0.8em;
    color: #999;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1px;
    min-width: 40px;
    text-align: center;
}

.atomizer-options {
    min-height: 60px; /* Prevent container from collapsing */
    transition: all 0.2s ease; /* Smooth transitions */
}

.atomizer-option {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
    margin-left: 15px;
    opacity: 0;
    animation: fadeInSmooth 0.3s ease-out forwards;
}

.atomizer-option:nth-child(1) { animation-delay: 0.05s; }
.atomizer-option:nth-child(2) { animation-delay: 0.1s; }
.atomizer-option:nth-child(3) { animation-delay: 0.15s; }
.atomizer-option:nth-child(4) { animation-delay: 0.2s; }

.atomizer-name {
    font-size: 0.8rem;
    min-width: 80px; /* Prevent text shifting */
}

.atomizer-price {
    font-size: 0.8rem;
    color: #555;
    margin-left: 5px;
    min-width: 60px; /* Prevent price jumping */
}

.atomizer-view-button {
    cursor: pointer;
    background: #6c757d;
    border: none;
    color: white;
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 20px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.atomizer-view-button:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
} 

/* ==== Small additions: disabled Add To Cart + tooltip/modal fixes ==== */

/* Visually and functionally disable Add To Cart when item is out of stock */
.add-to-cart-btn.add-to-cart-disabled,
.add-to-cart-btn[disabled] {
    background: #d6d6d6 !important;
    color: #7a7a7a !important;
    border-color: #cfcfcf !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.6 !important;
    pointer-events: none !important; /* defensive: prevent clicks */
}

/* Re-enable pointer events when button is enabled */
.add-to-cart-btn:not(.add-to-cart-disabled):not([disabled]) {
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

/* Keep hover styles only for enabled buttons */
.add-to-cart-btn:not([disabled]):hover {
    background: linear-gradient(135deg, #8a6a24 0%, #a5822a 100%);
    color: white;
}

/* Slightly raise tooltip z-index and make transitions GPU-accelerated */
.atomizer-hover-tooltip {
    z-index: 3000;
    transition: opacity 0.18s ease, transform 0.12s ease;
    will-change: transform, opacity;
}

/* Ensure hidden popups/overlays don't capture pointer events */
.atomizer-popup-modal { pointer-events: none; transition: opacity 0.28s ease; }
.atomizer-popup-modal.show { pointer-events: auto; opacity: 1; }
.atomizer-popup-modal.closing { pointer-events: auto; opacity: 0; }

/* small-screen tweaks */
@media (max-width: 480px) {
    .atomizer-hover-tooltip img { max-width: 110px; max-height: 110px; }
    .add-to-cart-btn { width: 150px; max-width: 150px; }
}

/* Out of stock atomizer styles */
.atomizer-option {
    /* Prevent flash of unstyled content - start hidden and fade in */
    animation: fadeInAtomizer 0.2s ease-out forwards;
}

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

.atomizer-option.atomizer-out-of-stock {
    opacity: 0.75;
    position: relative;
    /* Override fade-in animation to show immediately with correct opacity */
    animation: fadeInAtomizerOutOfStock 0.2s ease-out forwards;
}

@keyframes fadeInAtomizerOutOfStock {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.75;
    }
}

.atomizer-option.atomizer-out-of-stock .btn-atomizer {
    background: repeating-linear-gradient(
        45deg,
        #f8f9fa,
        #f8f9fa 10px,
        #efefef 10px,
        #efefef 20px
    ) !important;
    border: 2px dashed #dee2e6 !important;
    cursor: not-allowed;
    position: relative;
    opacity: 0.8;
}

.atomizer-option.atomizer-out-of-stock .btn-atomizer:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c9a02c 20%, #c9a02c 80%, transparent);
    transform: translateY(-50%) rotate(-8deg);
    z-index: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Ensure atomizer option and button have relative positioning for absolute indicator */
.atomizer-option {
    position: relative;
}

.btn-atomizer {
    position: relative;
}

/* Visual out-of-stock indicator */
.out-of-stock-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #c9a02c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(166, 74, 58, 0.4);
    border: 2px solid white;
    line-height: 1;
}

.atomizer-option.atomizer-out-of-stock .atomizer-name {
    color: #495057;
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: #c9a02c;
}

.atomizer-option.atomizer-out-of-stock .atomizer-price {
    color: #6c757d;
    opacity: 0.7;
}

.out-of-stock-text {
    color: #c9a02c;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Atomizer notice styling */
.atomizer-notice {
    border-left: 4px solid #d4b86a;
    background-color: #faf3e0;
    border-color: #d4b86a;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.atomizer-notice .bi-exclamation-triangle-fill {
    color: #b8862b;
}

/* Enhanced disabled state for input radio when atomizer is out of stock */
.atomizer-option.atomizer-out-of-stock input[type="radio"]:disabled {
    cursor: not-allowed;
}

.atomizer-option.atomizer-out-of-stock input[type="radio"]:disabled + .btn-atomizer {
    pointer-events: none;
}
