/* Cart page — Figma Desktop 629:28631 / Content 629:28632 */

.cart {
    background-color: var(--bg-secondary);
    min-height: 100vh;
    min-height: 100dvh;
}

.cart__main {
    width: var(--theme-main-width);
    margin-left: var(--theme-main-offset);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

@media (max-width: 767px) {
    .cart__main {
        width: 100%;
        margin-left: 0;
    }
}

.cart__main-content {
    /* Figma: pt 100 / pl 54 / pr 40 / pb 40 + sticky bar scroll-under clearance */
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: var(--shop-header-clearance, 5rem) var(--theme-main-padding-inline, 2.5rem) 7.5rem var(--theme-main-padding-inline-start, 2.5rem);
}

@media (max-width: 767px) {
    .cart__main-content {
        padding: var(--shop-header-clearance, 5rem) 1rem 9rem;
    }
}

.cart__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1.75rem; /* 28px — Figma gap between list and history */
    min-height: 0;
}

/* --------------------------------------------------------------------------
 * Cart list / Basket Card (634:12979)
 * -------------------------------------------------------------------------- */

.cart__main-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* 12px */
}

.cart__main-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 4fr);
    align-items: stretch;
    min-width: 12.875rem; /* 206px */
    min-height: 7.5rem; /* 120px */
    overflow: hidden;
    border: 0.125rem solid var(--border-secondary);
    border-radius: 1.25rem; /* 20px */
    background: var(--bg-primary); /* secondary_alt #fdfdfd */
}

.cart__main-item-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.75rem 0.5rem;
    background: var(--bg-primary-alt);
}

.cart__main-item-image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 5.5rem;
}

.cart__main-item-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 6.75rem; /* ~108px — fit inside min card + padding */
    object-fit: contain;
}

.cart__main-item-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    gap: 0.5rem;
    min-width: 0;
    min-height: 7.5rem;
    height: auto;
    border-left: 0.0625rem solid var(--border-tertiary-solid, var(--border-tertiary));
}

.cart__main-item-top {
    display: flex;
    flex: 0 0 auto;
    gap: 0.75rem;
    align-items: flex-start;
    min-height: 0;
    padding: 0.625rem 0.75rem 0;
}

.cart__main-item-name-link {
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
}

.cart__main-item-info-name {
    display: -webkit-box;
    overflow: hidden;
    color: var(--fg-primary);
    font-family: var(--font-text);
    font-size: var(--text-base); /* 15 */
    font-weight: 500;
    line-height: 1.25rem; /* 20 */
    letter-spacing: 0.01em;
    word-break: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.cart__main-item-button-remove {
    flex: 0 0 auto;
}

.cart__main-item-button-remove svg {
    fill: var(--fg-secondary);
}

.cart__main-item-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0 0.75rem 0.625rem;
}

.cart__main-item-details {
    display: flex;
    flex: 1 1 auto;
    gap: 0.375rem;
    align-items: flex-end;
    min-width: 0;
    padding: 0.375rem 0;
}

.cart__main-item-price {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    max-width: 5.5rem; /* 88px */
    min-width: 0;
}

.cart__main-item-price-discount-row {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    height: 0.9375rem;
}

.cart__main-item-price-old {
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-xs); /* 11 */
    font-weight: 500;
    line-height: 0.875rem;
    letter-spacing: 0.01em;
    text-decoration: line-through;
    white-space: nowrap;
}

.cart__main-item-price-discount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.0625rem 0.25rem;
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 0.875rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border: 0.0625rem solid var(--border-success-primary);
    border-radius: 0.25rem;
    background-color: var(--bg-success-secondary);
}

.cart__main-item-price-current {
    color: var(--fg-primary);
    font-family: var(--font-text);
    font-size: var(--text-sm); /* 13 */
    font-weight: 500;
    line-height: 1.125rem; /* 18 */
    letter-spacing: 0.01em;
}

.cart__main-item-info-type {
    flex: 1 1 auto;
    max-width: 5.5rem;
    min-width: 0;
    overflow: hidden;
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.125rem;
    letter-spacing: 0.01em;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart__main-item-buttons-quantity {
    display: flex;
    flex: 1 1 auto;
    gap: 0.375rem;
    align-items: center;
    max-width: 13.75rem; /* 220px */
    min-width: 10rem; /* 160px */
}

.cart__main-item-buttons-quantity-value {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin: 0;
    text-align: center;
}

.cart__main-item-buttons-quantity-value-number {
    overflow: hidden;
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.125rem;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart__main-item-buttons-quantity-value-text {
    color: var(--fg-primary);
    font-family: var(--font-text);
    font-size: var(--text-lg); /* 17 */
    font-weight: 500;
    line-height: 1.5rem; /* 24 */
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.cart__main-item-buttons-quantity-plus,
.cart__main-item-buttons-quantity-minus {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0.25rem 0.5rem !important;
    border-radius: 0.75rem !important;
}

.cart__main-item-buttons-quantity-plus svg,
.cart__main-item-buttons-quantity-minus svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--fg-primary);
}

.cart__main-item-buttons-quantity-minus--empty {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (max-width: 767px) {
    .cart__main-item {
        grid-template-columns: 5.5rem minmax(0, 1fr);
        min-height: 0;
    }

    .cart__main-item-image a {
        min-height: 0;
    }

    .cart__main-item-image img {
        max-height: 5rem;
    }

    .cart__main-item-body {
        min-height: 0;
    }

    .cart__main-item-actions {
        flex-wrap: wrap;
    }

    .cart__main-item-details {
        flex: 1 1 100%;
    }

    .cart__main-item-buttons-quantity {
        flex: 1 1 100%;
        max-width: none;
        min-width: 0;
        justify-content: flex-end;
    }
}

/* --------------------------------------------------------------------------
 * Empty / shimmer
 * -------------------------------------------------------------------------- */

.cart__empty {
    padding: 2.5rem 1rem;
}

.cart__shimmer {
    border-radius: 0.25rem;
    background: var(--border-secondary);
}

.cart__shimmer--image {
    width: 100%;
    height: 100%;
    min-height: 5.5rem;
    border-radius: 0.75rem;
}

.cart__shimmer--line {
    width: 80%;
    height: 1.25rem;
    margin-bottom: 0.625rem;
}

.cart__shimmer--line-short {
    width: 60%;
    height: 1rem;
    margin-bottom: 0;
}

.cart__main-item--shimmer .cart__main-item-body {
    justify-content: center;
    padding: 0.75rem;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------------
 * Order history card (1049:27165)
 * -------------------------------------------------------------------------- */

.cart__history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart__history-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
    justify-content: center;
    min-width: 12.875rem;
    padding: 0.625rem 0.75rem;
    border: 0.125rem solid var(--border-tertiary-solid, var(--border-tertiary));
    border-radius: 0.75rem; /* 12px */
    background: var(--bg-primary);
}

.cart__history-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.125rem;
    letter-spacing: 0.01em;
}

.cart__history-card-date {
    color: var(--fg-primary);
}

.cart__history-card-status {
    color: var(--fg-success-primary);
}

.cart__history-card-status--pending,
.cart__history-card-status--pending_payment,
.cart__history-card-status--processing {
    color: var(--fg-tertiary);
}

.cart__history-card-status--completed {
    color: var(--fg-success-primary);
}

.cart__history-card-status--canceled,
.cart__history-card-status--closed,
.cart__history-card-status--fraud {
    color: var(--fg-error-primary);
}

.cart__history-card-row {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    width: 100%;
}

.cart__history-card-thumbs {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 5rem;
    overflow: visible;
}

.cart__history-card-thumb {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    margin-inline-start: -1.8rem;
    padding: 0.375rem;
    overflow: hidden;
    border: 0.09375rem solid var(--border-secondary);
    border-radius: 0.625rem; /* 10px */
    background: var(--bg-primary-alt);
    box-sizing: border-box;
}

.cart__history-card-thumb:first-child {
    margin-inline-start: 0;
}

/* Front largest; each next smaller for cascade (image thumbs only) */
.cart__history-card-thumb:nth-child(1):not(.cart__history-card-thumb--more) {
    width: 5rem;
    height: 5rem;
    z-index: 5;
}

.cart__history-card-thumb:nth-child(2):not(.cart__history-card-thumb--more) {
    width: 4.25rem;
    height: 4.25rem;
    z-index: 4;
}

.cart__history-card-thumb:nth-child(3):not(.cart__history-card-thumb--more) {
    width: 3.5rem;
    height: 3.5rem;
    z-index: 3;
}

.cart__history-card-thumb:nth-child(4):not(.cart__history-card-thumb--more) {
    width: 2.875rem;
    height: 2.875rem;
    z-index: 2;
}

.cart__history-card-thumb:nth-child(n + 5):not(.cart__history-card-thumb--more) {
    width: 2.375rem;
    height: 2.375rem;
    z-index: 1;
}

.cart__history-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* +N sits beside the pile — not in the cascade overlap */
.cart__history-card-thumb--more {
    z-index: 0;
    width: auto;
    height: auto;
    min-height: 2.5rem;
    margin-inline-start: 0.75rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.cart__history-card-thumb--more span {
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-xl);
    font-weight: 500;
    line-height: 1.75rem;
    letter-spacing: 0.01em;
    text-align: center;
    white-space: nowrap;
}

.cart__history-card-total {
    display: flex;
    flex: 0 0 auto;
    gap: 0.75rem;
    align-items: center;
    margin-inline-start: auto;
    min-width: 0;
}

.cart__history-card-total-label {
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.125rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.cart__history-card-total-value {
    color: var(--fg-primary);
    font-family: var(--font-text);
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 1.5rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.cart__history-card-btn {
    flex: 0 0 auto;
    gap: 0.125rem;
    padding: 0.5rem 1.25rem !important;
}

.cart__history-card-btn span {
    padding: 0 0.375rem;
    color: var(--fg-secondary);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.5rem;
    letter-spacing: 0.01em;
}

.cart__history-card-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--fg-secondary);
}

.cart__history-card-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
    margin-inline-start: auto;
    min-width: 0;
}

@media (max-width: 1024px) {
    .cart__history-card-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .cart__history-card-thumbs {
        max-width: 100%;
        width: 100%;
        flex: 1 1 auto;
    }

    .cart__history-card-actions {
        width: 100%;
        margin-inline-start: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 767px) {
    .cart__history-card-thumbs {
        height: auto;
        min-height: 4.25rem;
    }

    .cart__history-card-thumb:not(.cart__history-card-thumb--more) {
        margin-inline-start: -0.875rem;
    }

    .cart__history-card-thumb:first-child {
        margin-inline-start: 0;
    }

    .cart__history-card-thumb--more {
        margin-inline-start: 0.625rem;
    }

    .cart__history-card-thumb:nth-child(1):not(.cart__history-card-thumb--more) {
        width: 4.25rem;
        height: 4.25rem;
    }

    .cart__history-card-thumb:nth-child(2):not(.cart__history-card-thumb--more) {
        width: 3.625rem;
        height: 3.625rem;
    }

    .cart__history-card-thumb:nth-child(3):not(.cart__history-card-thumb--more) {
        width: 3rem;
        height: 3rem;
    }

    .cart__history-card-thumb:nth-child(4):not(.cart__history-card-thumb--more) {
        width: 2.5rem;
        height: 2.5rem;
    }

    .cart__history-card-thumb:nth-child(n + 5):not(.cart__history-card-thumb--more) {
        width: 2.125rem;
        height: 2.125rem;
    }

    .cart__history-card-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        justify-content: stretch;
    }

    .cart__history-card-actions .cart__history-card-btn {
        width: 100%;
        justify-content: center;
    }
}

/* --------------------------------------------------------------------------
 * Sticky checkout bar (643:14074)
 * Sticky within cart content — unpins before footer (not fixed over footer)
 * -------------------------------------------------------------------------- */

.cart__total {
    position: sticky;
    bottom: 0;
    z-index: 7; /* below shop-header (8) / landing header (9); above cart list content */
    display: flex;
    gap: 1rem;
    align-items: center;
    width: calc(100% + var(--theme-main-padding-inline-start, 2.5rem) + var(--theme-main-padding-inline, 2.5rem));
    margin-top: auto;
    margin-right: calc(-1 * var(--theme-main-padding-inline, 2.5rem));
    margin-left: calc(-1 * var(--theme-main-padding-inline-start, 2.5rem));
    padding: 0.75rem 1.75rem 1.125rem 2.625rem; /* 12 / 28 / 18 / 42 */
    /* background-color: color-mix(in srgb, var(--bg-secondary) 72%, transparent); */
    /* backdrop-filter: blur(0.75rem); */
    -webkit-backdrop-filter: blur(0.75rem);
}

@media (max-width: 1024px) {
    .cart__total {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem; /* 16px — Figma Bottom Navbar Container */
        padding: 0 1rem 1.25rem; /* 0 / 16 / 20 */
    }
}

@media (max-width: 767px) {
    .cart__total {
        width: calc(100% + 2rem);
        margin-right: -1rem;
        margin-left: -1rem;
    }
}

.cart__total-info {
    display: flex;
    flex: 1 1 auto;
    gap: 1.25rem;
    align-items: center;
    justify-content: flex-end;
    min-width: 12.875rem;
    padding: 0.3rem 0.3rem;
    border: 0.125rem solid var(--border-secondary);
    border-radius: 0.75rem;
    background: var(--bg-primary);
}

@media (max-width: 1024px) {
    .cart__total-info {
        width: 100%;
        gap: 1.75rem; /* 28px — Figma summary row */
    }
}

.cart__total-info-text {
    display: flex;
    flex: 1 1 auto;
    gap: 1.75rem; /* 28px */
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.cart__total-info-pair {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    white-space: nowrap;
}

.cart__total-info-text-span {
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.125rem;
    letter-spacing: 0.01em;
}

.cart__total-info-text-strong {
    color: var(--fg-primary);
    font-family: var(--font-text);
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 1.5rem;
    letter-spacing: 0.01em;
}

@media (max-width: 1024px) {
    .cart__total-info-text {
        display: flex;
        flex: 1 1 auto;
        gap: 1.75rem; /* 28px */
        align-items: center;
        justify-content: flex-end;
        min-width: 0;
    }

    .cart__total-info-pair {
        flex: 1 1 0;
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
        min-width: 0;
    }
}

.cart__total-remove-all {
    flex: 0 0 auto;
    gap: 0.125rem;
    min-height: 1.75rem;
    padding: 0.125rem 0.5rem !important;
    border-radius: 0.625rem !important;
}

.cart__total-remove-all-label {
    padding: 0 0.375rem;
    color: var(--fg-secondary);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.5rem;
    letter-spacing: 0.01em;
}

.cart__total-remove-all svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--fg-secondary);
}

@media (max-width: 1024px) {
    .cart__total-remove-all {
        --btn-size-h: 1.75rem; /* 28px — btn--xs icon-only */
        flex: 0 0 auto;
        gap: 0;
        width: var(--btn-size-h);
        height: var(--btn-size-h);
        min-width: var(--btn-size-h);
        max-width: var(--btn-size-h);
        padding: 0.125rem !important;
        border-radius: 0.625rem !important;
    }

    .cart__total-remove-all-label {
        display: none;
    }
}

.cart__total-pay-btn {
    flex: 0 0 auto;
    gap: 0.125rem;
}

.cart__total-pay-btn span {
    padding: 0 0.375rem;
    color: inherit;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.5rem;
    letter-spacing: 0.01em;
}

.cart__total-pay-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    color: inherit;
    fill: currentColor;
}

.cart__total-pay-btn svg path {
    fill: currentColor;
}

@media (max-width: 1024px) {
    .cart__total-pay-btn {
        flex: 1 1 auto;
        width: 100%;
        justify-content: center;
    }
}
