/**
 * NVL Product Upsells Modal — Plugin styles.
 *
 * Sections:
 *   1) :root fallback CSS variables (Nikon-specific only; --fs-color-* come from Flatsome)
 *   2) .nvl-add-ellipsis utilities (used by content-product-small template)
 *   3) .nvl-up-sells / .nvl-up-sells-selector / .nvl-up-sells-menu / .nvl-up-sells-item
 *   4) .nvl-off-canvas-modal (overlay, content, close, --active/--no-scroll states)
 */

/* ----- 1) CSS variables fallbacks (Nikon-specific) ----- */
:root {
    --nvl-bg--light: #F2F2F2;
    --nvl-bg--grey: #DCDCDC;
    --nvl-padding-in-boxes: 20px;
    --nvl-border-radius--small: 10px;
    --nvl-border-radius--full: 9999px;
}

/* ----- 2) Ellipsis utilities ----- */
.nvl-add-ellipsis {
    display: -webkit-box !important;
    max-height: 1lh;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.nvl-add-ellipsis--2 {
    max-height: 2lh;
    -webkit-line-clamp: 2;
}

.nvl-add-ellipsis--3 {
    max-height: 3lh;
    -webkit-line-clamp: 3;
}

.nvl-add-ellipsis--4 {
    max-height: 4lh;
    -webkit-line-clamp: 4;
}

/* ----- 3) PDP Up-sells selector + menu + items ----- */
.nvl-up-sells {
    position: relative;
}

.nvl-up-sells-selector {
    align-items: flex-start;
    background-color: var(--nvl-bg--light);
    border: solid 1px var(--nvl-bg--light);
    border-radius: 10px;
    color: rgb(10, 2, 3);
    cursor: pointer;
    display: flex;
    font-weight: 300;
    margin-bottom: 30px;
    padding: var(--nvl-padding-in-boxes);
    position: relative;
    text-align: left;
    width: 100%;
}

.nvl-up-sells-selector:hover {
    border-color: var(--fs-color-secondary);
}

.nvl-up-sells-selector__link {
    color: var(--fs-color-primary);
}

.nvl-up-sells-selector__text {
    margin: 0;
}

.nvl-up-sells-selector__text--selected {
    font-weight: normal;
}

.nvl-up-sells-selector:after {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='text-black-100 dark:text-yellow arrow_right' viewBox='0 0 1024 1024' style='display:inline-block;stroke:currentColor;fill:currentColor;width:1.5rem;height:1.5rem'%3E%3Cpath d='M426 726v-428l214 214z'%3E%3C/path%3E%3C/svg%3E");
    display: block;
    height: 24px;
    position: absolute;
    right: calc(var(--nvl-padding-in-boxes) - 8px);
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease-in-out;
    width: 24px;
}

.nvl-up-sells-selector.rotated:after {
    transform: translateY(-50%) rotate(90deg);
}

/* ---- Up-Sells Menu (for off-canvas) ---- */
.nvl-up-sells-menu {
    display: none;
    max-height: 90%;
    overflow-y: auto;
    background-color: var(--nvl-bg--light);
    border: none;
    box-shadow: none;
    margin-top: 30px;
    opacity: 1;
    padding: 0;
    position: relative;
    top: unset;
    visibility: visible;
    transition: opacity 0.5s, visibility 0.5s;
    width: 100%;
    z-index: 100;
}

@media (max-width: 849px) {
    .nvl-up-sells-menu {
        max-height: 80vh;
    }
}

.nvl-up-sells-menu.visible {
    opacity: 1;
    visibility: visible;
}

.nvl-up-sells-menu__title {
    display: none;
}

.nvl-up-sells-menu a {
    color: var(--fs-color-primary);
}

.nvl-up-sells-menu__product-list {
    align-items: flex-start;
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.nvl-up-sells-item__link {
    align-items: center;
    background-color: #FFF;
    border: solid 2px var(--nvl-bg--grey);
    border-radius: var(--nvl-border-radius--small);
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    padding: 10px;
    position: relative;
}

.nvl-up-sells-item:first-child .nvl-up-sells-item__link,
.nvl-up-sells-item__link:hover {
    border-color: var(--fs-color-secondary);
}

.nvl-up-sells-item:first-child .nvl-up-sells-item__link:after {
    background-color: var(--fs-color-secondary);
    border-radius: var(--nvl-border-radius--full);
    color: #FFF;
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' style='stroke:%23FFFFFF; fill:%23FFFFFF;'%3E%3Cpath d='M384 691.2l-179.2-179.2-59.733 59.733 238.933 238.933 512-512-59.733-59.733-452.267 452.267z'%3E%3C/path%3E%3C/svg%3E");
    height: 24px;
    padding: 1px;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 24px;
}

.nvl-up-sells-item {
    list-style: none;
    height: 100%;
    margin: 0 !important;
    text-align: center;
}

.nvl-up-sells-item__image-container {
    align-items: center;
    display: flex;
    height: 200px;
}

@media screen and (max-width: 549px) {
    .nvl-up-sells-item__image-container {
        height: 140px;
    }
}

.nvl-up-sells-item__name {
    font-size: 16px;
    font-weight: 300;
    height: 2lh;
    line-height: 20px;
}

.nvl-up-sells-item__price {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: flex-end;
}

.nvl-up-sells-item__price del {
    font-size: 13px;
    line-height: 1.2;
}

.nvl-up-sells-item__price .pwp-omnibus-price__info {
    display: none;
}

/* ----- 4) Off Canvas Modal ----- */
.nvl-off-canvas-modal__close-button {
    line-height: 10px;
    margin: 0;
    min-height: unset;
    opacity: 0.6;
    padding: 0;
    position: absolute;
    right: 16px;
    top: 16px;
}

.nvl-off-canvas-modal__close-button:hover {
    opacity: 1;
}

.nvl-off-canvas-modal__overlay {
    background: rgba(0, 0, 0, 0.9);
    height: 100%;
    left: 0;
    opacity: 0;
    position: fixed;
    top: 0;
    transition: opacity 0.25s;
    visibility: hidden;
    width: 100%;
    z-index: 1000;
}

.nvl-off-canvas-modal__container {
    height: 100vh;
    overflow-y: auto;
}

.nvl-off-canvas-modal__content {
    background: var(--nvl-bg--light);
    box-shadow: 0 0 10px 0 rgba(0,0,0,.5);
    height: 100%;
    padding-bottom: 0;
    padding-inline: 60px;
    padding-top: 50px;
    position: fixed;
    right: -110%; /* LM: to hide box shadow on mobile devices */
    top: 0;
    transition: right 0.3s;
    z-index: 99999999;
    max-width: 605px;
    width: 100%;
}

@media (max-width: 549px) {
    .nvl-off-canvas-modal__content {
        padding-inline: 20px;
        padding-top: 30px;
    }
}

.nvl-off-canvas-modal__content p {
    margin: 0;
}

.nvl-off-canvas-modal--active .nvl-off-canvas-modal__overlay {
    opacity: 0.6;
    visibility: visible;
}

.nvl-off-canvas-modal--active .nvl-off-canvas-modal__content {
    right: 0;
}

html.nvl-off-canvas-modal--no-scroll {
    overflow-y: hidden;
}
