.sidepanel {
    position: fixed;
    top: 0;
    display: flex;
    flex-direction: column;
    right: 0;
    width: 100%;
    height: 100vh; /* Fallback */
    height: 100dvh;
    overflow: hidden;
    transition: transform 0.3s ease;
    transform: translateX(100%) scaleX(0);
    transform-origin: right center;
    background-color: white;
    z-index: 9999;
}

.sidepanel.opened {
    transform: translateX(0%) scaleX(1);
}

.sidepanel__overlay {
    display: unset;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);

    z-index: 1000;
}

.sidepanel__header {
    position: sticky;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    padding: 1.5rem;
    border-bottom: 1px solid var(--grey-200);
    background-color: white;
}

.sidepanel__content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.sidepanel__actions {
    position: sticky;
    bottom: 0;
    padding: 1.5rem;
    z-index: 1;
    border-top: 1px solid var(--grey-200);
    background-color: white;
}

.sidepanel__title {
    font-size: var(--text-base);
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.sidepanel__description {
    color: var(--grey-700);
    line-height: 1.5;
    font-size: var(--text-sm);
}

.sidepanel__icon {
    all: unset;
    cursor: pointer;
}

@media (min-width: 768px) {
    .sidepanel {
        width: 60%;
    }
}

@media only screen and (min-width: 993px) {
    .sidepanel {
        width: 40%;
        min-width: 35rem;
    }
}

@media only screen and (min-width: 1400px) {
    .sidepanel {
        width: 33%;
        max-width: 40rem;
    }
}

/* Add Item
   component/item/add.php
================================================== */
.sp-item-add {
    height: 100vh; /* Fallback */
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

.sp-item-add__container {
    display: flex;
    flex-direction: column;
    position: relative;
    flex-grow: 1;
    justify-content: space-between;
    background-color: var(--grey-50);
}

.sp-item-add__item {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
    width: 100%;
    align-items: flex-start;
}

.sp-item-add__img-container {
    flex-basis: 30%;
    height: auto;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--grey-200);
    background-color: white;
}

.sp-item-add__img {
    width: 70%;
    aspect-ratio: 1/1;
    object-fit: contain;
}

.sp-item-add__item-details {
    flex-basis: 70%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sp-item-add__item-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
    font-size: var(--text-sm);
}

.sp-item-add__item-description {
    font-size: var(--text-sm);
    color: var(--slate-700);
    line-height: 1.3;
}

.sp-item-add__item-price {
    font-weight: bold;
    margin-top: 1rem;
    padding-right: 1rem;
    font-size: var(--text-base);
    text-align: right;
}

@media (min-width: 768px) {
    .sp-item-add__item {
        flex-wrap: nowrap;
    }

    .sp-item-add__img-container {
        flex-basis: 20%;
    }

    .sp-item-add__item-details {
        flex-basis: 80%;
    }

    .sp-item-add__item-price {
        font-size: var(--text-lg);
    }
}

@media only screen and (min-width: 993px) {
    .sp-item-add__img-container {
        flex-basis: 25%;
    }

    .sp-item-add__item-details {
        flex-basis: 75%;
    }
}

/* Add Item Warranty
   /lib/component/warranty.php
================================================== */
.sp-item-add__warranty {
    margin: 1rem 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
    width: 100%;
    align-items: flex-start;
    padding: 1.5rem 0;
    background-color: var(--primary-50);
    border-radius: 4px;
    border: 1px solid var(--primary-200);
}

.sp-item-add__warranty--added {
    background-color: var(--green-50);
    border: 1px solid var(--green-200);
}

.sp-item-add__warranty-img-container {
    flex-basis: 30%;
    height: auto;
    /*display: flex;*/
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    display: none;
}

.sp-item-add__warranty-img {
    width: 70%;
    aspect-ratio: 1/1;
    object-fit: contain;
}

.sp-item-add__warranty-details {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding-left: 1rem;
}

.sp-item-add__warranty-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
    font-size: var(--text-sm);
}

.sp-item-add__warranty-description {
    flex-basis: 70%;
    font-size: var(--text-sm);
    color: var(--slate-700);
    line-height: 1.3;
}

.sp-item-add__warranty-pricing {
    display: flex;
    flex-direction: column-reverse;
    margin-top: 1.5rem;
    font-weight: bold;
    text-align: right;
    padding-right: 1rem;
    gap: 1rem;
}

@media (min-width: 768px) {
    .sp-item-add__warranty {
        margin: 1.5rem 0;
        flex-wrap: nowrap;
    }

    .sp-item-add__warranty-img-container {
        flex-basis: 20%;
        display: flex;
    }

    .sp-item-add__warranty-details {
        flex-basis: 80%;

        padding-left: unset;
    }

    .sp-item-add__warranty-pricing {
        font-size: var(--text-lg);
        flex-direction: row;
        flex-wrap: wrap-reverse;
        justify-content: space-between;
        align-items: center;
        padding-right: 1rem;
    }

    .sp-item-add__warranty-pricing--added {
        justify-content: flex-end;
    }

    .sp-item-add__warranty-img {
        width: 60%;
    }
}

@media only screen and (min-width: 993px) {
    .sp-item-add__warranty-img-container {
        flex-basis: 25%;
    }

    .sp-item-add__warranty-img {
        width: 50%;
    }

    .sp-item-add__warranty-details {
        flex-basis: 75%;
    }
}

/* Warranty Form - display_form()
   /lib/component/warranty.php
================================================== */
.sp-warranty-add {
    /* background-color: var(--grey-50); */
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.sp-warranty-add__item {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    align-items: flex-start;
    padding: 1.5rem 0;
}

.sp-warranty-add__fields {
    width: 100%;
    padding: 1.5rem 0;
}

.sp-warranty-add__img-container {
    flex-basis: 30%;
    height: auto;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--grey-200);
    background-color: white;
    border-radius: 4px;
    position: relative;
}

.sp-warranty-add__img {
    width: 55%;
    aspect-ratio: 1/1;
    object-fit: contain;
}

.sp-warranty-add__img-warranty {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 25%;
}

.sp-warranty-add__details {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sp-warranty-add__title {
    font-weight: bold;
    margin-bottom: 0.25rem;
    font-size: var(--text-sm);
}

.sp-warranty-add__description {
    flex-basis: 70%;
    font-size: var(--text-sm);
    color: var(--slate-700);
    line-height: 1.3;
}

.sp-warranty-add__pricing {
    font-weight: bold;
    margin-top: 1rem;
    padding-right: 1rem;
    font-size: var(--text-base);
    text-align: right;
}

.sp-warranty-add__form {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sp-warranty-add__legend {
    color: var(--slate-700);
    text-align: center;
}

.sp-warranty-add__actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sp-warranty-add__input-container {
    margin-bottom: 0.875rem;
    width: 100%;
}

@media (min-width: 768px) {
    .sp-warranty-add__img-container {
        flex-basis: 20%;
    }

    .sp-warranty-add__details {
        flex-basis: 80%;
    }

    .sp-warranty-add__pricing {
        font-size: var(--text-lg);
    }

    .sp-warranty-add__item {
        flex-wrap: nowrap;
    }

    .sp-warranty-add__img {
        width: 60%;
    }
}

@media only screen and (min-width: 993px) {
    .sp-warranty-add__img-container {
        flex-basis: 30%;
    }

    .sp-warranty-add__img {
        width: 60%;
    }

    .sp-warranty-add__details {
        flex-basis: 70%;
    }

    .sp-warranty-add__pricing {
        font-size: var(--text-xl);
    }
}


/* Add Item Subtotal - display_sub_panel();
   /lib/component/order.php
================================================== */
.sp-item-add__subtotal {
    /*
    position: absolute;
    bottom: 0;
     */
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /*background-color: var(--grey-50);*/
}

.sp-item-add__subtotal-lines {
    color: var(--slate-700);
}

.sp-item-add__subtotal-amount-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-weight: bold;
}

.sp-item-add__subtotal-amount {
    font-size: var(--text-lg);
}



