/**
 * SCP Cart — carrito
 */
/* Cart page */
.scp-cart-page .scp-page-head {
    margin-bottom: 20px;
    padding: 0 0 14px;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid #d8d8de;
    box-shadow: none;
}

.scp-page-head__back {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
}

.scp-page-head__back::before {
    content: "‹ ";
    color: var(--scp-accent, #9333ea);
}

.scp-cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 20px;
    align-items: start;
}

.scp-cart-layout__products,
.scp-cart-layout__summary {
    min-width: 0;
}

.scp-cart-layout__summary {
    align-self: start;
}

.scp-cart-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scp-cart-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 14px 16px;
    align-items: start;
    background: #fff;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.scp-cart-item__thumb img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 8px;
    background: #fafafa;
}

.scp-cart-item__body {
    min-width: 0;
}

.scp-cart-item__title {
    margin: 0 0 12px;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
}

.scp-cart-item__title a {
    color: #222;
    text-decoration: none;
}

.scp-cart-item__price-col {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--scp-accent, #9333ea);
    white-space: nowrap;
    text-align: right;
    align-self: start;
    padding-top: 2px;
}

.scp-cart-item__price-col .woocommerce-Price-amount {
    color: inherit;
    font-weight: inherit;
}

.scp-cart-item__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
}

.scp-cart-item__qty-wrap {
    display: inline-flex;
    align-items: center;
    background: #f3f0f8;
    border-radius: 999px;
    padding: 2px;
    gap: 0;
}

.scp-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--scp-accent, #9333ea);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 50%;
    line-height: 1;
    padding: 0;
}

.scp-qty-btn:hover {
    background: rgba(147, 51, 234, 0.12);
}

.scp-cart-item__qty .quantity {
    display: inline-flex;
    align-items: center;
}

.scp-cart-item__qty .qty {
    width: 36px;
    text-align: center;
    border: none;
    background: transparent;
    padding: 6px 2px;
    font-weight: 700;
    font-size: 0.9rem;
    -moz-appearance: textfield;
}

.scp-cart-item__qty .qty::-webkit-outer-spin-button,
.scp-cart-item__qty .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.scp-cart-item__remove-btn {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: #f3e8ff;
    border-radius: 8px;
    color: var(--scp-accent, #9333ea) !important;
    text-decoration: none;
    flex-shrink: 0;
}

.scp-cart-item__remove-btn:hover {
    background: #e9d5ff;
}

.scp-cart-item__trash-icon {
    display: block;
}

.scp-cart-form-actions {
    margin-top: 16px;
    display: none;
}

body.scp-cart-page .woocommerce .cart-collaterals,
body.scp-cart-page .woocommerce .cart-collaterals .cart_totals,
body.scp-cart-page .woocommerce .scp-cart-totals {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    clear: none !important;
    margin: 0 !important;
}

body.scp-cart-page .woocommerce .cart-collaterals {
    display: block;
}

.scp-cart-totals {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 24px;
    height: auto;
    box-sizing: border-box;
}

.scp-cart-totals__title {
    margin: 0 0 12px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
}

.scp-cart-totals__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.92rem;
}

.scp-cart-totals__row--subtotal .scp-cart-totals__label {
    font-weight: 700;
    color: #222;
}

.scp-cart-totals__row--total {
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 12px;
    font-size: 1rem;
    font-weight: 700;
}

.scp-cart-totals__value--total {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0;
    color: var(--scp-accent, #9333ea);
    white-space: nowrap;
}

.scp-cart-totals__value--total strong {
    display: inline;
    font-weight: inherit;
}

.scp-cart-totals__asterisk {
    color: inherit;
    font-weight: inherit;
}

.scp-cart-totals__note {
    margin: 6px 0 14px;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #777;
}

.scp-cart-totals__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scp-cart-page .wc-proceed-to-checkout {
    padding: 0 !important;
    margin: 0;
}

.scp-cart-page .wc-proceed-to-checkout::before,
.scp-cart-page .wc-proceed-to-checkout::after {
    display: none !important;
}

body.scp-cart-page .woocommerce .checkout-button.button.alt {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 20px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    border-radius: 10px !important;
    text-align: center;
    text-decoration: none;
    background: var(--scp-accent, #9333ea) !important;
    color: #fff !important;
    border: 2px solid var(--scp-accent, #9333ea) !important;
    box-sizing: border-box;
    transform: none !important;
}

.scp-cart-page .checkout-button.button.alt:hover {
    background: var(--scp-accent-hover, #7e22ce) !important;
    border-color: var(--scp-accent-hover, #7e22ce) !important;
    color: #fff !important;
}

.scp-cart-totals__checkout,
.scp-cart-totals__continue {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

/* Overrides WooCommerce en el carrito SCP */
.scp-cart-page .woocommerce a.remove.scp-cart-item__remove-btn {
    color: var(--scp-accent, #9333ea) !important;
}

.scp-cart-page .woocommerce-cart-form .form-row,
.scp-cart-page .woocommerce-cart-form .quantity {
    margin: 0;
    padding: 0;
}

.scp-cart-page .woocommerce-cart-form input.qty {
    width: 36px !important;
    min-height: 0 !important;
    box-shadow: none;
}

/* Anular estilos globales de WooCommerce en el carrito */
body.scp-cart-page .woocommerce .woocommerce-cart-form,
body.scp-cart-page .woocommerce .woocommerce-cart-form * {
    box-sizing: border-box;
}

body.scp-cart-page .woocommerce table.shop_table {
    display: none !important;
}

body.scp-cart-page .woocommerce .shipping-calculator-form,
body.scp-cart-page .woocommerce .woocommerce-shipping-calculator,
body.scp-cart-page.scp-needs-postcode .woocommerce .scp-cart-totals__row--shipping {
    display: none !important;
}

.scp-cart-empty {
    background: #fff;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
}

/* Overrides WooCommerce layout en carrito SCP */
body.scp-cart-page .woocommerce .cart-collaterals,
body.scp-cart-page .woocommerce .cart-collaterals .cart_totals,
body.scp-cart-page .woocommerce .scp-cart-totals {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
}

body.scp-cart-page .woocommerce .wc-proceed-to-checkout {
    padding: 0 !important;
}

body.scp-cart-page .woocommerce .checkout-button.button.alt {
    display: flex !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 20px !important;
    font-size: 0.9rem !important;
}

@media (max-width: 960px) {
    .scp-cart-layout {
        grid-template-columns: 1fr;
    }

    .scp-cart-totals {
        position: static;
    }
}

@media (max-width: 600px) {
    .scp-cart-item {
        grid-template-columns: 80px minmax(0, 1fr);
        align-items: start;
    }

    .scp-cart-item__thumb img {
        width: 80px;
        height: 80px;
    }

    .scp-cart-item__price-col {
        grid-column: 2 / -1;
        text-align: left;
        align-self: start;
        margin-top: -4px;
    }
}
