/* Carrito de compras */

.cart-page .page-content {
    background: var(--home-bg, #f6f7f9);
}

.cart-page-header {
    background: #fff;
    border-bottom: 1px solid #e8eaee;
    padding: 20px 0;
}

.cart-page-header h1 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--home-text, #1f2937);
}

.cart-page-header p {
    margin: 6px 0 0;
    color: var(--home-muted, #6b7280);
    font-size: 14px;
}

.cart-section {
    padding: 24px 0 48px;
}

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

.cart-items-card {
    background: #fff;
    border: 1px solid #eceef2;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.cart-items-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #eceef2;
}

.cart-items-head h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--home-text, #1f2937);
}

.cart-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    color: var(--home-muted, #6b7280);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.cart-refresh:hover {
    border-color: var(--home-accent, #ef5730);
    color: var(--home-accent, #ef5730);
    background: #fff8f5;
}

.cart-items-columns {
    display: none;
    grid-template-columns: minmax(0, 1fr) 100px 120px 100px 44px;
    gap: 12px;
    padding: 10px 18px;
    background: #f9fafb;
    border-bottom: 1px solid #eceef2;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--home-muted, #6b7280);
}

.cart-items-body {
    min-height: 120px;
}

.cart-loading {
    text-align: center;
    padding: 48px 20px;
    color: var(--home-muted, #6b7280);
    font-size: 14px;
}

.cart-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px 14px;
    padding: 16px 18px;
    border-bottom: 1px solid #f0f2f5;
    align-items: start;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-media {
    grid-row: 1 / span 3;
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    border: 1px solid #eceef2;
    background: #fff;
    padding: 6px;
    overflow: hidden;
}

.cart-item-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-info {
    grid-column: 2;
    min-width: 0;
}

.cart-item-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--home-text, #1f2937);
    text-decoration: none !important;
    line-height: 1.35;
    margin-bottom: 4px;
}

.cart-item-name:hover {
    color: var(--home-accent, #ef5730);
}

.cart-item-unit-price {
    font-size: 13px;
    color: var(--home-muted, #6b7280);
}

.cart-item-qty {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-qty-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--home-muted, #6b7280);
    text-transform: uppercase;
}

.cart-item-qty .bootstrap-touchspin,
.cart-item-qty .quantity {
    margin: 0 !important;
    float: none !important;
}

.cart-item-qty input.cantAddToCartProductCartPage {
    width: 56px !important;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 6px 4px;
    font-weight: 600;
}

.cart-item-subtotal {
    grid-column: 2;
    font-size: 16px;
    font-weight: 700;
    color: #15803d;
}

.cart-item-remove {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff5f5;
    color: #dc2626;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.cart-item-remove:hover {
    background: #fee2e2;
    border-color: #f87171;
}

.cart-item {
    position: relative;
    padding-right: 58px;
}

.cart-empty {
    text-align: center;
    padding: 56px 24px;
}

.cart-empty i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.cart-empty p {
    margin: 0 0 20px;
    color: var(--home-muted, #6b7280);
    font-size: 15px;
}

.cart-summary-card {
    position: sticky;
    top: 90px;
    background: #fff;
    border: 1px solid #eceef2;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.cart-summary-card h3 {
    margin: 0 0 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--home-text, #1f2937);
}

.cart-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid #eceef2;
    border-bottom: 1px solid #eceef2;
    margin-bottom: 14px;
}

.cart-summary-row span {
    font-size: 14px;
    color: var(--home-muted, #6b7280);
}

.cart-summary-row strong {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--home-text, #1f2937);
}

.cart-summary-note {
    margin: 0 0 16px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--home-muted, #6b7280);
}

.cart-checkout-btn,
.cart-continue-btn {
    display: flex;
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

.cart-page .home-btn-ghost {
    background: #f3f4f6;
    color: var(--home-text, #1f2937) !important;
    border: 1px solid #e5e7eb;
}

.cart-page .home-btn-ghost:hover {
    background: #e9ebef;
    color: var(--home-text, #1f2937) !important;
}

.cart-item-info .cart-item-unit-price {
    display: block;
}

.cart-item > .cart-item-unit-price {
    display: none;
}

@media (min-width: 768px) {
    .cart-item > .cart-item-unit-price {
        display: block;
    }

    .cart-item-info .cart-item-unit-price {
        display: none;
    }

    .cart-items-columns {
        display: grid;
    }

    .cart-item {
        grid-template-columns: 72px minmax(0, 1fr) 100px 120px 100px 44px;
        align-items: center;
        padding-right: 18px;
    }

    .cart-item-media {
        grid-row: auto;
    }

    .cart-item-info {
        grid-column: 2;
    }

    .cart-item-unit-price {
        grid-column: 3;
        text-align: right;
        font-size: 14px;
        color: var(--home-text, #1f2937);
        font-weight: 600;
    }

    .cart-item-qty {
        grid-column: 4;
        justify-content: center;
    }

    .cart-item-qty-label {
        display: none;
    }

    .cart-item-subtotal {
        grid-column: 5;
        text-align: right;
    }

    .cart-item-remove {
        position: static;
        grid-column: 6;
        justify-self: end;
    }

    .cart-item-name {
        margin-bottom: 0;
    }
}

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

    .cart-summary-card {
        position: static;
    }

    .cart-refresh-label {
        display: none;
    }
}
