.product-container {
    opacity: 0;
    animation: fadeInSmooth 0.6s ease-out 0.1s forwards;
}

/* Fragrance Description Box */
.fragrance-description {
    margin-top: 20px;
    background-color: #faf8f5;
    border-radius: 5px;
    padding: 15px;
    border: 1px solid #d9d2c7;
    box-shadow: none;
    opacity: 0;
    animation: fadeInSmooth 0.6s ease-out 0.35s forwards;
}

.fragrance-description h3 {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #4a403a;
    font-weight: 300;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fragrance-description h3 i {
    font-size: 1em;
    opacity: 0.7;
}

.fragrance-description p {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1em;
    line-height: 1.5;
    color: #333;
    text-align: left;
}

.product-image {
    opacity: 0;
    animation: fadeInScale 0.7s ease-out 0.2s forwards;
}

.product-details-wrapper {
    opacity: 0;
    animation: fadeInSmooth 0.6s ease-out 0.3s forwards;
}

.main-accords {
    opacity: 0;
    animation: fadeInSmooth 0.6s ease-out 0.4s forwards;
}

.perfume-pyramid {
    opacity: 0;
    animation: fadeInSmooth 0.6s ease-out 0.5s forwards;
}

.pyramid-section {
    opacity: 0;
    animation: fadeInSmooth 0.5s ease-out forwards;
}

.pyramid-section:nth-child(2) { animation-delay: 0.6s; }
.pyramid-section:nth-child(3) { animation-delay: 0.7s; }
.pyramid-section:nth-child(4) { animation-delay: 0.8s; }

/* Related Products Carousel */
.related-section {
    background: linear-gradient(to bottom, #faf8f5 0%, #f6f3ef 100%);
    position: relative;
    overflow: hidden;
}

.related-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(180, 160, 130, 0.45) 50%, transparent 100%);
}

.related-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    color: #2f261b;
    margin-bottom: 1.35rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.2s;
    margin-left: 0.5rem;
}

.related-carousel-container {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.4s;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.related-carousel-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.35rem 0.5rem 1.15rem 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(140, 120, 90, 0.95) transparent;
    gap: 0.95rem;
}

.related-carousel-track::-webkit-scrollbar {
    height: 8px;
}

.related-carousel-track::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.related-carousel-track::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #867459 0%, #6e5e47 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14);
    transition: all 0.3s ease;
}

.related-carousel-track::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #6e5e47 0%, #5a4d3c 100%);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.related-carousel-item {
    min-width: 210px;
    max-width: 210px;
    background: rgba(255, 254, 252, 0.96);
    border-radius: 12px;
    padding: 0.85rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(200, 190, 175, 0.22);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 328px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: slideInStagger 0.6s ease-out forwards;
    /* Default delay so items without explicit nth-child rules don't appear instantly */
    animation-delay: 0.6s;
}

.related-carousel-item:nth-child(1) { animation-delay: 0.6s; }
.related-carousel-item:nth-child(2) { animation-delay: 0.7s; }
.related-carousel-item:nth-child(3) { animation-delay: 0.8s; }
.related-carousel-item:nth-child(4) { animation-delay: 0.9s; }
.related-carousel-item:nth-child(5) { animation-delay: 1.0s; }
.related-carousel-item:nth-child(6) { animation-delay: 1.1s; }
.related-carousel-item:nth-child(7) { animation-delay: 1.2s; }
.related-carousel-item:nth-child(8) { animation-delay: 1.3s; }
.related-carousel-item:nth-child(9) { animation-delay: 1.4s; }
.related-carousel-item:nth-child(10) { animation-delay: 1.5s; }
.related-carousel-item:nth-child(11) { animation-delay: 1.6s; }
.related-carousel-item:nth-child(12) { animation-delay: 1.7s; }
.related-carousel-item:nth-child(13) { animation-delay: 1.8s; }
.related-carousel-item:nth-child(14) { animation-delay: 1.9s; }
.related-carousel-item:nth-child(15) { animation-delay: 2.0s; }
.related-carousel-item:nth-child(16) { animation-delay: 2.1s; }
.related-carousel-item:nth-child(17) { animation-delay: 2.2s; }
.related-carousel-item:nth-child(18) { animation-delay: 2.3s; }
.related-carousel-item:nth-child(19) { animation-delay: 2.4s; }
.related-carousel-item:nth-child(20) { animation-delay: 2.5s; }

.related-carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(255,255,255,0.45), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    pointer-events: none;
}

.related-carousel-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(140, 120, 90, 0.35);
}

.related-carousel-item:hover::before {
    opacity: 1;
}

.related-carousel-item:active {
    transform: translateY(-4px) scale(1.01);
}

.related-item-image {
    width: 100%;
    height: 170px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    transition: all 0.4s ease;
    filter: brightness(1) saturate(1);
    background: #fff;
}

.related-carousel-item:hover .related-item-image {
    filter: brightness(1.05) saturate(1.1);
    transform: scale(1.02);
}

.related-item-brand {
    font-size: 0.75rem;
    color: #6a5d48;
    margin-bottom: 0.35rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    transition: all 0.3s ease;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 1.3em;
}

.related-carousel-item:hover .related-item-brand {
    color: #444;
    opacity: 1;
}

.related-item-name {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    color: #2f261b;
    margin-bottom: 0.35rem;
    font-weight: 400;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    transition: all 0.3s ease;
    min-height: 2.6em; /* Ensures name block is always at least 2 lines tall for alignment */
    max-height: 2.6em;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-carousel-item:hover .related-item-name {
    color: #1a1a1a;
}

.related-item-concentration {
    font-size: 0.67rem;
    color: #6a5d48;
    display: inline-flex;
    align-self: flex-start;
    width: max-content;
    max-width: 100%;
    padding: 0.24rem 0.65rem;
    background: rgba(234, 228, 218, 0.7);
    border: 1px solid rgba(180, 160, 130, 0.35);
    border-radius: 999px;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.45px;
    margin-bottom: 0.55rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-carousel-item:hover .related-item-concentration {
    background: rgba(222, 214, 201, 0.9);
    color: #594b39;
}

.related-item-view-btn {
    margin-top: auto;
    padding: 0.48rem 0.95rem;
    align-self: stretch;
    background: rgba(252, 250, 246, 0.8);
    color: #5a4d3c;
    text-align: center;
    border-radius: 10px;
    font-size: 0.77rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: all 0.3s ease;
    border: 1.5px solid rgba(90, 77, 60, 0.35);
}

.related-carousel-item:hover .related-item-view-btn {
    background: #6a5d48;
    border-color: #6a5d48;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(106, 93, 72, 0.3);
}

.related-carousel-item:focus-visible {
    outline: 3px solid rgba(140, 120, 90, 0.45);
    outline-offset: 2px;
}

@keyframes slideInStagger {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .related-title {
        font-size: 1.5rem;
    }
    
    .related-carousel-item {
        min-width: 190px;
        max-width: 190px;
        min-height: 310px;
    }
}

@keyframes fadeInSmooth {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Status badges - matching shop home style */
.status-badges {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.status-badge {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 50px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: 'Montserrat', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.status-out-of-stock {
    background-color: #f2dede !important;
    color: #8b4049 !important;
    border: 2px solid #e4c1c4 !important;
}

.status-discontinued {
    background-color: #dfd4c6 !important;
    color: #5f5145 !important;
    border: 2px solid #c9bcab !important;
}

.status-old-formulation {
    background-color: #f5edd8 !important;
    color: #7a6530 !important;
    border: 2px solid #e2d5b5 !important;
}

.main-accords h2, .perfume-pyramid h2 {
    font-size: 1.5em;
    font-weight: 500;
    margin-bottom: 10px;
    color: #000;
    font-family: 'Playfair Display', serif;
}

.main-accords ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.main-accords li {
    padding: 8px 16px;
    font-size: 0.9em;
    color: #333;
    text-align: center;
    border-radius: 10px;
    margin: 5px 0;
    border: 1px solid transparent; 
}

.perfume-pyramid h3 {
    font-size: 1.2em; 
    margin-top: 15px;
    color: #4a403a; 
    font-weight: 300;
    text-transform: uppercase;
}

.perfume-pyramid p {
    margin: 10px 0;
    font-size: 1em;
    color: #333; 
    background-color: #faf8f5; 
    padding: 15px; 
    border: 1px solid #d9d2c7; 
    border-radius: 5px;
    line-height: 1.5; 
    font-family: 'Montserrat', sans-serif;
}


/* Fade overlays at horizontal edges of related carousel to hint at scroll */
.related-carousel-container {
    position: relative; /* container for overlays */
}

.related-carousel-container::before,
.related-carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4rem;
    pointer-events: none;
    z-index: 20;
    opacity: 0; /* hidden by default */
    transition: opacity 0.25s ease;
}

.related-carousel-container::before {
    left: 0;
    background: linear-gradient(90deg, rgba(250, 248, 245, 1) 0%, rgba(250, 248, 245, 0) 100%);
}

.related-carousel-container::after {
    right: 0;
    background: linear-gradient(270deg, rgba(250, 248, 245, 1) 0%, rgba(250, 248, 245, 0) 100%);
}

/* Only show overlays when the container has the indicating class (added by JS) */
.related-carousel-container.fade-left::before { opacity: 1; }
.related-carousel-container.fade-right::after { opacity: 1; }
.related-carousel-container.fade-both::before,
.related-carousel-container.fade-both::after { opacity: 1; }

@media (max-width: 768px) {
    .related-carousel-container::before,
    .related-carousel-container::after {
        width: 2rem;
    }
}
