@import url("./Variables.css");

/* 
    Semantic adds a pusher class which includes a overflow: hidden; this causes the sticky rule to not work.
    We disabled it here. 
*/
.pusher {
    overflow: unset !important;
}

.product {
    font-size: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25em;
    width: 100%;
}

/* Image selector */
.image-container-outer {

}

.image-container-inner {
    position: relative;
    display: grid;
    align-items: center;
}

.image-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    .image-container {
        scroll-behavior: auto;
    }
}

.image-container__image {
    scroll-snap-align: start;
    /* max-width: 100vw; */
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-container__navigation-button-container {
    position: absolute;
}

.image-container__navigation-button {
    background: var(--text-gray);
    border-radius: 100%;
    padding: .5em .4em .5em .6em;

    display: grid;
    place-items: center;
}

.image-container__navigation-button--next {
    right: 1em;
}

.image-container__navigation-button--previous {
    left: 1em;
    transform: rotate(180deg);
}

.image-container__navigation-button img {
    width: 1em;
    height: 1em;
}

@media (min-width: 768px) {
    .product {
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        align-items: start;
        gap: 1.25em;
        width: 100%;
        padding: 0 2em;
    }
    .image-container-outer {
        position: sticky;
        top: 1em;
    }
}

/* Overview */
.overview {
    margin-top: 1.5em;
    padding: 0 1em;
}

.overview__options {
    padding-top: 1em;
}

.overview__options-heading {
    border-bottom: 0;
}

.name-and-brand__brand {
    font-family: var(--sans-font);
    text-transform: uppercase;
    font-weight: 600;
    color: var(--stalands-gray);
    font-size: .9375em;
    line-height: 1.2em;;
}

.name-and-brand__name {
    padding: 0;
    margin: 0;
    font-family: var(--serif-font);
    font-size: 1.5em;
    line-height: 1.25em;
}

.overview__price-and-stock-container {
    margin-top: 1.5em;
}

.overview__price-label {
    font-size: 0.875em;
    color: var(--stalands-gray);
}

.overview__price-value {
    font-size: 1.25em;
    font-weight: 700;
}

.overview__price-value--discount {
    color: var(--text-red);
}

.overview__price-value--prev {
    font-size: .9375em;
    text-decoration: line-through;
    color: var(--stalands-gray);
    font-weight: 400;
}

.overview__stock-container {
    margin-top: 1em;
}

.overview__stock-container .stock-status {
    font-size: .875em;
}

.overview__add-to-cart-container {
    margin-top: 1.5em;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5em;
    width: 100%;
    padding-bottom: 1em;
}

.overview__usp-container {
    padding: .7em;
    margin-top: .5em;
}

.overview__usp {
    font-weight: 600;
    line-height: 1.25em;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5em;
    margin-bottom: .5em;
}

.overview__description-container {
    margin-top: 2em;
}

.overview__text {
    font-weight: 400;
    line-height: 1.5em;
    color: var(--stalands-gray);
}

.overview__specs-container {
    margin-top: 2em;
}

.overview__specs {
    width: 100%;
    display: grid;
    gap: .25em;
}

.overview__spec-entry {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    width: 100%;
    justify-content: space-around;
}

.overview__download-container {
    margin-top: 2em;
}

.overview__download-entry {
    margin-bottom: .5em;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5em;
}

.description__content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.description__content--collapsed {
    max-height: 100px; /* Approximately 6 lines of text */
    position: relative;
}

.description__content--collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(transparent, white);
}

.description__toggle {
    margin-top: 1rem;
    text-decoration: underline;
    padding: 0;
    font-weight: 400;
    color: var(--stalands-gray);
}

.overview__lowest-price-container {
    margin-top: 4.5em;
}

@media (min-width: 768px) {
    .name-and-brand__name {
        font-size: 2em;
    }
}

/* Add these styles at the end of the file */

.lightbox {
    width: 100%;
    height: 100%;
    max-height: none;
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

/* Remove backdrop */
.lightbox::backdrop {
    background: none;
}

.lightbox__close {
    margin-left: auto;
    margin-right: 1em;
    display: block;
    position: sticky;
}

.lightbox__content {
    background: var(--white);
    height: 100%;
    padding-top: 1em;
}

.lightbox__image-container {
    margin-top: 1em;
    overflow-y: auto;
    max-height: 90%;
    width: 100%;
}

.lightbox__image-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
}

.lightbox__image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

@media (min-width: 768px) {
    .lightbox__content {
        padding: 2em;
        margin: 2em;
        height: 95%;
    }
    .lightbox__close {
        margin-right: 0;
    }
}

.overview__price .price-display__value--previous {
    font-size: .9375em;
}
