/**
 * Side Cart / Cart Drawer Styles
 * Based on Shopify Rebuy Cart design
 */

/* ===== OVERLAY ===== */
.ss-side-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ss-side-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== SIDE CART CONTAINER ===== */
.ss-side-cart {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 550px;
    background: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-radius: 15px 0 0 15px;
    overflow: hidden;
    margin: 2rem 0;
    max-height: calc(100vh - 4rem);
}

.ss-side-cart.active {
    transform: translateX(0);
}

@media (max-width: 767px) {
    .ss-side-cart {
        max-width: calc(100% - 16px);
        margin: 1rem;
        border-radius: 12px;
        max-height: calc(100vh - 2rem);
    }
}

@media (max-width: 480px) {
    .ss-side-cart {
        max-width: 100%;
        margin: 0;
        border-radius: 12px 12px 0 0;
        top: auto;
        bottom: 0;
        max-height: 90vh;
        transform: translateY(100%);
    }

    .ss-side-cart.active {
        transform: translateY(0);
    }
}

/* ===== HEADER ===== */
.ss-side-cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: #fff;
    flex-shrink: 0;
}

.ss-side-cart__title {
    font-size: 1.9rem;
    font-weight: 400;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.3;
}

.ss-side-cart__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.ss-side-cart__close:hover {
    opacity: 0.7;
}

/* ===== BODY ===== */
.ss-side-cart__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

/* ===== PROGRESS BAR ===== */
.ss-side-cart__progress {
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
    margin: 0 1.5rem;
    padding-left: 0;
    padding-right: 0;
}

.ss-side-cart__progress-bar {
    position: relative;
    display: flex;
    align-items: center;
    height: 4px;
    gap: 6px;
}

.ss-side-cart__progress-segment {
    height: 100%;
    background: #ddd;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.ss-side-cart__progress-segment--shipping {
    flex: 0 0 calc(71.4% - 4px);
    border-radius: 6px;
}

.ss-side-cart__progress-segment--gift {
    flex: 0 0 calc(28.6% - 4px);
    border-radius: 6px;
}

.ss-side-cart__progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #000;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.ss-side-cart__progress-separator {
    width: 8px;
    height: 4px;
    background: #fff;
    flex-shrink: 0;
}

.ss-side-cart__progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.ss-side-cart__progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ss-side-cart__progress-step:first-child {
    flex: 0.714;
    align-items: center;
}

.ss-side-cart__progress-step:last-child {
    flex: 0.286;
    align-items: center;
}

.ss-side-cart__progress-label {
    font-size: 1.2rem;
    line-height: 1.35;
    color: #666;
}

.ss-side-cart__progress-step.complete .ss-side-cart__progress-label {
    color: #000;
}

.ss-side-cart__progress-message {
    font-size: 1.2rem;
    color: #666;
    margin-top: 0.5rem;
    text-align: center;
}

.ss-side-cart__progress-message--complete {
    color: #000;
    font-weight: 500;
}

/* ===== CONTENT / ITEMS ===== */
.ss-side-cart__content {
    flex: 1;
    overflow-y: auto;
    padding-top: 0.875rem;
}

.ss-side-cart__content::-webkit-scrollbar {
    width: 3px;
}

.ss-side-cart__content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 100px;
}

.ss-side-cart__items {
    list-style: none;
    margin: 0;
    padding: 0 1.5rem 1rem;
}

.ss-side-cart__item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
}

.ss-side-cart__item-media {
    position: relative;
    flex-shrink: 0;
    width: 84px;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: visible;
}

@media (min-width: 768px) {
    .ss-side-cart__item-media {
        width: 124px;
    }
}

.ss-side-cart__item-media a {
    display: block;
    border-radius: 12px;
    overflow: hidden;
}

.ss-side-cart__item-media img,
.ss-side-cart__item-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.ss-side-cart__item-remove {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #fff;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    transition: transform 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.ss-side-cart__item-remove:hover {
    transform: scale(1.1);
}

.ss-side-cart__item-remove svg {
    width: 22px;
    height: 22px;
}

@media (max-width: 767px) {
    .ss-side-cart__item-remove {
        width: 20px;
        height: 20px;
        top: -5px;
        left: -5px;
    }

    .ss-side-cart__item-remove svg {
        width: 20px;
        height: 20px;
    }
}

.ss-side-cart__item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-left: 0.5rem;
}

.ss-side-cart__item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.ss-side-cart__item-title {
    font-size: 1.3rem;
    font-weight: 400;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .ss-side-cart__item-title {
        font-size: 1.7rem;
    }
}

.ss-side-cart__item-title:hover {
    text-decoration: underline;
}

.ss-side-cart__item-price {
    font-size: 1.6rem;
    font-weight: 400;
    white-space: nowrap;
}

.ss-side-cart__item-variant {
    font-size: 1rem;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.48px;
    margin-top: 0.25rem;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .ss-side-cart__item-variant {
        font-size: 1rem;
        letter-spacing: 0.6px;
        margin-top: 5px;
    }
}

.ss-side-cart__item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* ===== QUANTITY SELECTOR ===== */
.ss-side-cart__quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid #000;
    border-radius: 6px;
    overflow: hidden;
}

.ss-side-cart__quantity-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.ss-side-cart__quantity-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.ss-side-cart__quantity-btn svg {
    width: 10px;
    height: 7px;
}

.ss-side-cart__quantity-value {
    min-width: 20px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 32px;
}

/* ===== UPSELL ===== */
.ss-side-cart__upsell {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border-radius: 12px;
    margin: 0 1.5rem 1.5rem;
    padding-left: 6px;
    padding-right: 20px;
}

.ss-side-cart__upsell-media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ss-side-cart__upsell-img {
    max-width: 60px;
    height: auto;
}

.ss-side-cart__upsell-info {
    text-transform: uppercase;
    line-height: 1;
}

.ss-side-cart__upsell-info p {
    margin: 0;
    font-size: 1.4rem;
}

.ss-side-cart__upsell-add {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    transition: transform 0.2s;
}

.ss-side-cart__upsell-add:hover {
    transform: scale(1.1);
}

/* ===== SUBTOTAL ===== */
.ss-side-cart__subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin: 0 1.5rem;
    border-top: 1px solid #ddd;
    font-size: 1.3rem;
    font-weight: 400;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .ss-side-cart__subtotal {
        font-size: 1.6rem;
    }
}

.ss-side-cart__subtotal-amount {
    font-weight: 500;
}

/* ===== EMPTY CART ===== */
.ss-side-cart__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 3rem;
    background: #f5f5f5;
    margin: 1.5rem;
    border-radius: 12px;
}

.ss-side-cart__empty-content {
    text-align: center;
}

.ss-side-cart__empty-title {
    font-size: 2.4rem;
    margin: 0 0 1rem;
    line-height: 1.3;
}

.ss-side-cart__empty-link {
    font-size: 1.2rem;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.04rem;
    text-decoration: underline;
}

.ss-side-cart__empty-link:hover {
    opacity: 0.7;
}

/* ===== FOOTER ===== */
.ss-side-cart__footer {
    flex-shrink: 0;
    padding: 0 0 1.5rem;
    background: #fff;
}

/* ===== RECOMMENDATIONS ===== */
.ss-side-cart__recommendations {
    background: #f5f5f5;
    padding: 1rem 0 1rem 1.5rem;
}

.ss-side-cart__recommendations-title {
    font-size: 1.9rem;
    font-weight: 400;
    text-transform: uppercase;
    margin: 0 0 0.5rem;
    text-align: left;
}

@media (min-width: 768px) {
    .ss-side-cart__recommendations-title {
        font-size: 1.9rem;
    }
}

.ss-side-cart__recommendations-carousel {
    position: relative;
}

.ss-side-cart__recommendations-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 1.5rem;
}

.ss-side-cart__recommendations-track::-webkit-scrollbar {
    display: none;
}

.ss-side-cart__recommendation {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-shrink: 0;
    width: calc(100% - 2rem);
    max-width: 350px;
    padding: 1rem 0;
}

.ss-side-cart__recommendation-media {
    width: 84px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .ss-side-cart__recommendation-media {
        width: 100px;
    }
}

.ss-side-cart__recommendation-media img {
    width: 100%;
    height: auto;
    display: block;
}

.ss-side-cart__recommendation-info {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    justify-content: space-between;
    padding-right: 1rem;
}

.ss-side-cart__recommendation-title {
    font-size: 1.3rem;
    font-weight: 400;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .ss-side-cart__recommendation-title {
        font-size: 1.7rem;
        line-height: 1.4;
    }
}

.ss-side-cart__recommendation-title:hover {
    text-decoration: underline;
}

.ss-side-cart__recommendation-variant {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.48px;
    margin-top: 4px;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .ss-side-cart__recommendation-variant {
        font-size: 1.2rem;
        letter-spacing: 0.72px;
        margin-top: 5px;
    }
}

.ss-side-cart__recommendation-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: transparent;
    border: 1px solid #000;
    border-radius: 17px;
    color: #000;
    font-size: 1rem;
    letter-spacing: 0.72px;
    text-transform: uppercase;
    padding: 8px 10px;
    margin-top: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    min-width: 110px;
    width: fit-content;
}

@media (min-width: 768px) {
    .ss-side-cart__recommendation-add {
        font-size: 1.2rem;
        min-width: 120px;
    }
}

.ss-side-cart__recommendation-add:hover {
    background: #000;
    color: #fff;
}

.ss-side-cart__recommendation-separator {
    margin: 0 2px;
}

.ss-side-cart__recommendation-price {
    font-weight: 400;
}

.ss-side-cart__recommendations-nav {
    position: absolute;
    top: -28px;
    right: 1.5rem;
    display: flex;
    gap: 8px;
}

@media (min-width: 768px) {
    .ss-side-cart__recommendations-nav {
        top: -32px;
    }
}

.ss-side-cart__recommendations-prev,
.ss-side-cart__recommendations-next {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    transition: opacity 0.2s;
}

.ss-side-cart__recommendations-prev:hover,
.ss-side-cart__recommendations-next:hover {
    opacity: 0.7;
}

.ss-side-cart__recommendations-prev:disabled,
.ss-side-cart__recommendations-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ss-side-cart__recommendations-prev svg,
.ss-side-cart__recommendations-next svg {
    width: 24px;
    height: 24px;
}

/* ===== MEMBERSHIP ===== */
.ss-side-cart__membership {
    padding: 1rem 1.5rem;
    text-align: center;
}

.ss-side-cart__membership p {
    font-size: 1.1rem;
    line-height: 1.3;
    margin: 0;
}

.ss-side-cart__membership a {
    color: #000;
    text-decoration: underline;
}

.ss-side-cart__membership a:hover {
    opacity: 0.7;
}

/* ===== CHECKOUT BUTTON ===== */
.ss-side-cart__checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 3rem);
    margin: 0 1.5rem;
    padding: 18px 15px;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.66px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

@media (min-width: 768px) {
    .ss-side-cart__checkout {
        font-size: 1.2rem;
        letter-spacing: 0.72px;
    }
}

.ss-side-cart__checkout:hover {
    background: #333;
}

/* ===== LOADING STATE ===== */
.ss-side-cart__item.loading {
    opacity: 0.5;
    pointer-events: none;
}

.ss-side-cart__loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ss-side-cart__item.loading .ss-side-cart__loading {
    display: block;
}

/* ===== BODY SCROLL LOCK ===== */
body.ss-side-cart-open {
    overflow: hidden;
}