/*------------------- Imported Fonts -------------------*/
@font-face {
    font-family: 'Elms-Sans';
    src: url('../../fonts/Elms_Sans/ElmsSans-VariableFont_wght.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/*------------------- Main Content -------------------*/

/*---------- Products Title ----------*/
.products-title-container {
    background-color: rgb(12, 39, 60);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.products-hero-logo img {
    width: 50%;
    height: auto;
    padding: 30px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/*--------------- Desktop Main Content ---------------*/
.product-profile {
    position: relative;
    color: rgb(204, 191, 146);
}

/*----- Products Images -----*/
.product-image-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.products-hero-logo img.animate {
    opacity: 1;
    transform: scale(1);
}

.product-image-stock,
.product-image-edited {
    width: 100%;
    height: auto;
    display: block;
}

.product-image-edited {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

/*---------- Awards ----------*/
.awards-container {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 30px;
}

.awards-grid {
    display: grid;
    grid-auto-rows: min-content;
    justify-items: center;
    align-items: center;
    max-height: 100%;
    gap: 30px;
}

.awards-grid img {
    width: auto;
    height: 100%;
    max-height: clamp(40px, 8vh, 100px);
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

/*---------- Product Description ----------*/
.product-description-container {
    position: absolute;
    top: 50%;
    right: 0;
    width: 60%;
    max-width: 450px;
    max-height: 100%;
    padding: 20px;
    display: grid;
    grid-auto-rows: min-content;
    row-gap: 40px;
    color: rgb(204, 191, 146);
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    transform: translateY(-50%);
}

.products-image-title {
    font-family: "Times New Roman", Times, serif;
    font-size: clamp(1.5rem, 2vw, 2.5rem);
    font-weight: bold;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    justify-self: center;
    align-self: center;
    text-align: center;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.products-image-text {
    color: rgb(252, 252, 252);
    font-size: 1rem;
    line-height: 1.4;
    max-height: 100%;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.products-meta {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
}

.products-image-content-text {
    color: rgb(252, 252, 252);
    font-size: clamp(0.8rem, 1vw, 1rem);
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.buy-button {
    width: 1in;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    color: rgb(204, 191, 146);
    background: rgb(25, 93, 105);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, opacity 0.8s ease-in-out;
    opacity: 0;
    justify-self: center;
    align-self: center;
}

/* Hover effects */
.product-profile:hover .product-image-edited {
    opacity: 1;
}

.product-profile:hover .product-description-container {
    opacity: 1;
}

.product-profile:hover .products-image-title {
    opacity: 1;
    transition-delay: 0.3s;
}

.product-profile:hover .products-image-text {
    opacity: 1;
    transition-delay: 0.5s;
}

.product-profile:hover .products-image-content-text {
    opacity: 1;
    transition-delay: 0.5s;
}

.product-profile:hover .awards-grid img {
    opacity: 1;
}

/* Buy button reveal */
.product-image-container:hover .buy-button {
    animation: buy-reveal 0.8s ease-in-out 0.5s forwards;
}

@keyframes buy-reveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.buy-button:hover {
    background: rgb(12, 39, 60);
    transform: translateY(-2px);
}

/* Awards stagger */
.product-profile:hover .awards-grid img:nth-child(1) { transition-delay: 0.8s; }
.product-profile:hover .awards-grid img:nth-child(2) { transition-delay: 0.9s; }
.product-profile:hover .awards-grid img:nth-child(3) { transition-delay: 1s; }
.product-profile:hover .awards-grid img:nth-child(4) { transition-delay: 1.1s; }
.product-profile:hover .awards-grid img:nth-child(5) { transition-delay: 1.2s; }

/*--------------- Desktop Individual Adjustments ---------------*/
#mountain-summit .product-description-container { max-width: 400px; }
#distilled-data .product-description-container { max-width: 500px; }
#high-mountain-distilled .product-description-container { max-width: 370px; }
#high-mountain-barrel-rested .product-description-container { left: 0; max-width: 450px; }
#high-mountain-barrel-rested .awards-container { left: auto; right: 0; }
#patriots-creed-vodka .product-description-container { left: 0; max-width: 350px; }
#patriots-creed-vodka .awards-container { left: auto; right: 0; }
#patriots-creed-pueblo-chile .product-description-container { max-width: 400px; }
#perky-cowgirl .product-description-container { left: 0; max-width: 350px; }
#perky-cowgirl .awards-container { left: auto; right: 0; }
#perky-cowgirl-holiday-spice .product-description-container { left: 0; max-width: 380px; }
#perky-cowgirl-holiday-spice .awards-container { left: auto; right: 0; }

/*--------------- Mobile Main Content ---------------*/
.mbl-product-profile {
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mbl-product-image-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: auto;
    overflow: hidden;
}

.mbl-product-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
}

.mbl-product-title {
    font-size: 1.5em;
    font-family: "Times New Roman", Times, serif;
    margin-bottom: 10px;
    text-align: center;
    color: rgb(25, 93, 105);
}

.mbl-product-description {
    color: rgb(92,92,92);
    text-align: left;
    max-width: 90%;
    margin: 0 auto;
    animation: fadeInText 1s ease forwards;
    animation-delay: 0.3s;
    font-size: 0.95em;
    margin-bottom: 10px;
}

.mbl-lower-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.mbl-lowtext-left {
    text-align: left;
    max-width: 90%;
    margin: 0 auto;
    animation: fadeInText 1s ease forwards;
    animation-delay: 0.3s;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.mbl-lowtext-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.mbl-product-specs {
    color: rgb(92,92,92);
}

.mbl-buy-button {
    width: 30vw;
    height: 5vh;
    text-align: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: rgb(204, 191, 146);
    background: rgb(25, 93, 105);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.mbl-buy-button:hover {
    background-color: rgb(12, 39, 60);
    color: rgb(204, 191, 146);
}

.mbl-award-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    animation: fadeInAwards 1s ease forwards;
    animation-delay: 0.6s;
    padding: 10px;
}

.mbl-award-grid img {
    width: 60px;
    height: auto;
}

@keyframes fadeInText {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInAwards {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/*--------------- Desktop > Mobile Transition ---------------*/

/* Layer setup */
.desktop-products-container,
.mobile-products-container {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out;
}

/* Desktop active */
@media (min-width: 901px) {
    .desktop-products-container {
        opacity: 1;
        pointer-events: auto;
        position: relative; /* ACTIVE layer contributes to height */
    }
    .mobile-products-container {
        position: absolute; /* INACTIVE layer removed from flow */
        top: 0;
        left: 0;
        margin-top: -2300px;
    }
}

/* Mobile active */
@media (max-width: 900px) {
    .mobile-products-container {
        opacity: 1;
        pointer-events: auto;
        position: relative; /* ACTIVE layer contributes to height */
    }
    .desktop-products-container {
        position: absolute; /* INACTIVE layer removed from flow */
        top: 0;
        left: 0;
    }

    .the-goods-container {
        background-image: none;
    }
}
