/* =========================================================
   MEMORIAL PETS — CARRITO DE COMPRAS
   ========================================================= */
:root {
    --mp-azul: #193D70;
    --mp-celeste: #4DB8DA;
    --mp-crema: #FFF6E7;
}

/* ---------- Ícono del carrito en el header ---------- */
.mp-cart-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-right: 8px;
    border: none;
    background: transparent;
    color: var(--mp-azul);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.2s ease;
    order: 5;
}

.mp-cart-icon-btn:hover {
    background: rgba(25, 61, 112, 0.08);
    transform: translateY(-1px);
}

.mp-cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--mp-celeste);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 999px;
    box-shadow: 0 0 0 2px #fff;
    transition: transform 0.15s ease;
}

.mp-cart-badge.mp-bump {
    animation: mpCartBump 0.35s ease;
}

@keyframes mpCartBump {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.mp-cart-badge[data-empty="true"] {
    display: none;
}

/* Ubicación dentro de distintos navbars del sitio */
.navbar .mp-cart-icon-btn {
    margin-left: auto;
}

@media (min-width: 992px) {
    .navbar-toggler ~ .mp-cart-icon-btn,
    .mp-cart-icon-btn {
        margin-right: 6px;
    }
}

/* ---------- Overlay + Drawer lateral ---------- */
.mp-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 40, 0.45);
    z-index: 2040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mp-cart-overlay.mp-open {
    opacity: 1;
    visibility: visible;
}

.mp-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 100%);
    background: #fff;
    z-index: 2050;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(0,0,0,0.18);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.mp-cart-drawer.mp-open {
    transform: translateX(0);
}

.mp-cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    background: var(--mp-azul);
    color: #fff;
}

.mp-cart-drawer-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-cart-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}

.mp-cart-close:hover { opacity: 1; }

.mp-cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 18px;
}

.mp-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: #8a8a8a;
    padding: 40px 20px;
}

.mp-cart-empty i {
    font-size: 46px;
    color: #cfd9e6;
    margin-bottom: 14px;
}

.mp-cart-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f0ede6;
}

.mp-cart-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f4f4f4;
}

.mp-cart-item-info {
    flex: 1;
    min-width: 0;
}

.mp-cart-item-name {
    font-weight: 600;
    color: var(--mp-azul);
    font-size: 14.5px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mp-cart-item-price {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.mp-cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mp-cart-qty {
    display: flex;
    align-items: center;
    border: 1px solid #e2ddd0;
    border-radius: 8px;
    overflow: hidden;
}

.mp-cart-qty button {
    width: 26px;
    height: 26px;
    border: none;
    background: #f7f4ee;
    color: var(--mp-azul);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.mp-cart-qty button:hover { background: #eee7d8; }

.mp-cart-qty span {
    min-width: 28px;
    text-align: center;
    font-size: 13.5px;
    font-weight: 600;
}

.mp-cart-item-remove {
    background: transparent;
    border: none;
    color: #b94a4a;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.75;
}

.mp-cart-item-remove:hover { opacity: 1; text-decoration: underline; }

.mp-cart-item-subtotal {
    font-weight: 700;
    color: var(--mp-azul);
    font-size: 13.5px;
}

.mp-cart-drawer-footer {
    padding: 18px 22px 22px;
    border-top: 1px solid #f0ede6;
    background: var(--mp-crema);
}

.mp-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--mp-azul);
    margin-bottom: 14px;
}

.mp-cart-view-btn {
    display: block;
    text-align: center;
    padding: 12px;
    border: 1.5px solid var(--mp-azul);
    color: var(--mp-azul);
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.mp-cart-view-btn:hover {
    background: var(--mp-azul);
    color: #fff;
    text-decoration: none;
}

.mp-cart-checkout-btn {
    width: 100%;
    padding: 14px;
    background: var(--mp-azul);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(25,61,112,0.25);
    transition: all 0.2s ease;
}

.mp-cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(25,61,112,0.35);
}

.mp-cart-checkout-btn:disabled,
.mp-cart-checkout-btn.mp-disabled {
    background: #aab3bf;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ---------- Botón "Añadir al carrito" ---------- */
.btn-add-cart {
    background: #ffffff;
    color: var(--mp-celeste);
    border: 1.5px solid var(--mp-celeste);
    padding: 15px 30px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-add-cart:hover {
    background: var(--mp-celeste);
    color: #fff;
    transform: translateY(-2px);
}

.btn-add-cart.mp-added {
    background: #2e9e5b;
    border-color: #2e9e5b;
    color: #fff;
}

.arete-card-actions .btn-add-cart {
    flex: 1;
    padding: 12px 10px;
    font-size: 13px;
    border-radius: 10px;
}

@media (max-width: 900px) {
    .product-actions {
        flex-direction: column;
    }
    .btn-add-cart {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .arete-card-actions {
        flex-wrap: wrap;
    }
    .arete-card-actions .btn-add-cart,
    .arete-card-actions .btn-buy,
    .arete-card-actions .btn-advisor {
        flex: 1 1 100%;
    }
}

/* ---------- Toast de confirmación ---------- */
.mp-cart-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--mp-azul);
    color: #fff;
    padding: 13px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mp-cart-toast.mp-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =========================================================
   PÁGINA DE CARRITO (cart.html)
   ========================================================= */
.mp-cart-page {
    max-width: 1100px;
    margin: 60px auto 90px;
    padding: 0 20px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.mp-cart-page h1 {
    color: var(--mp-azul);
    font-size: 32px;
    margin-bottom: 30px;
}

.mp-cart-page-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

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

.mp-cart-page-list {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    padding: 10px 24px;
}

.mp-cart-page-item {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0ede6;
}

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

.mp-cart-page-item img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    background: #f4f4f4;
    flex-shrink: 0;
}

.mp-cart-page-item-info { flex: 1; min-width: 0; }

.mp-cart-page-item-info h4 {
    color: var(--mp-azul);
    font-size: 16px;
    margin: 0 0 4px;
}

.mp-cart-page-item-info .mp-unit-price {
    color: #777;
    font-size: 13.5px;
    margin-bottom: 10px;
}

.mp-cart-page-summary {
    background: var(--mp-crema);
    border-radius: 16px;
    padding: 26px;
    position: sticky;
    top: 100px;
}

.mp-cart-page-summary h3 {
    color: var(--mp-azul);
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 19px;
}

.mp-cart-page-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    color: #444;
    margin-bottom: 10px;
}

.mp-cart-page-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 19px;
    font-weight: 700;
    color: var(--mp-azul);
    padding-top: 14px;
    margin-top: 6px;
    border-top: 1px solid rgba(25,61,112,0.15);
}

.mp-cart-page-empty {
    text-align: center;
    padding: 70px 20px;
    color: #8a8a8a;
}

.mp-cart-page-empty i {
    font-size: 56px;
    color: #cfd9e6;
    margin-bottom: 18px;
}

.mp-cart-page-empty a {
    display: inline-block;
    margin-top: 18px;
    padding: 13px 30px;
    background: var(--mp-azul);
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
}

.mp-checkout-note {
    font-size: 12.5px;
    color: #8a8a70;
    text-align: center;
    margin-top: 12px;
}
