/* ============================================================
   MINI-CART — Panel lateral deslizante
   ============================================================ */
[hidden] { display: none !important; }

/* ── Overlay ── */
.mc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mc-overlay.mc-open {
    opacity: 1;
    pointer-events: all;
}

/* ── Panel ── */
.mc-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
	/*height:100vh;*/
    width: 85%;
    max-width: 420px;
    background: var(--blanco, #fff);
    z-index: 1101;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mc-panel.mc-open {
    transform: translateX(0);
}

/* ── Header ── */
.mc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 24px;
    border-bottom: 1px solid var(--gris-claro, #eee);
    flex-shrink: 0;
}

.mc-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mc-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    color: var(--casi-negro, #1a1a1a);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.mc-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: var(--casi-negro, #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s ease;
}

.mc-close svg {
    width: 40px;
    height: 40px;
}

.mc-close:hover {
    background: var(--fondo, #f5f5f5);
}

/* ── Loading spinner ── */
.mc-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gris-claro, #eee);
    border-top-color: var(--carmin, #cc2a2a);
    border-radius: 50%;
    animation: mc-spin 0.7s linear infinite;
}

@keyframes mc-spin {
    to { transform: rotate(360deg); }
}

/* ── Estado vacío ── */
.mc-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--gris-medio, #aaa);
    padding: 40px 24px;
}

.mc-empty svg {
    opacity: 0.3;
}

.mc-empty p {
    font-size: 1rem;
    margin: 0;
}

/* ── Wrapper lista (necesario para el indicador de scroll) ── */
.mc-list-wrap {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Gradiente inferior: aparece cuando hay más contenido debajo */
.mc-list-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.93));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
}

/* Gradiente superior: aparece cuando hay contenido desplazado arriba */
.mc-list-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, transparent, rgba(255, 255, 255, 0.93));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 1;
}

.mc-list-wrap.has-more::after  { opacity: 1; }
.mc-list-wrap.has-less::before { opacity: 1; }

/* Botones de scroll arriba/abajo */
.mc-scroll-hint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--blanco, #fff);
    border: 1.5px solid var(--gris-claro, #ddd);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    color: var(--casi-negro, #333);
    cursor: pointer;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s, background 0.15s;
    z-index: 2;
}

.mc-scroll-hint:hover { background: var(--gris-claro, #f5f5f5); }
.mc-scroll-hint { user-select: none; }

.mc-scroll-hint--down { bottom: 2px; left: calc(50% + 50px); }
.mc-scroll-hint--up   { top: 2px;    left: calc(50% + 50px); }

.mc-list-wrap.has-more .mc-scroll-hint--down,
.mc-list-wrap.has-less .mc-scroll-hint--up {
    opacity: 1;
    pointer-events: auto;
}

/* ── Lista de productos ── */
.mc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.mc-list::-webkit-scrollbar { width: 4px; }
.mc-list::-webkit-scrollbar-thumb { background: var(--gris-claro, #eee); border-radius: 2px; }

/* ── Cada línea ── */
.mc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--gris-claro, #f0f0f0);
    transition: opacity 0.25s ease;
}

.mc-item.mc-removing {
    opacity: 0;
}

.mc-item-img {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--fondo, #f5f5f5);
}

.mc-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Grid 2 filas a la derecha de la imagen */
.mc-item-info {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 6px;
    align-items: center;
}

/* Fila 1: nombre (izq) + precio (der) */
.mc-item-name {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--casi-negro, #1a1a1a);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
}

.mc-item-price {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--casi-negro, #1a1a1a);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
    padding-left: 8px;
}

/* Fila 2: stepper izq + papelera der */
.mc-item-row2 {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mc-item-stepper {
    display: flex;
    align-items: center;
    gap: 0;
}

.mc-item-stepper-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: var(--fondo, #f0f0f0);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--casi-negro, #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
    line-height: 1;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

@media (hover: hover) {
    .mc-item-stepper-btn:hover {
        background: var(--casi-negro, #1a1a1a);
        color: #fff;
    }
}

.mc-item-stepper-btn.mc-btn-tap {
    background: var(--casi-negro, #1a1a1a);
    color: #fff;
}

.mc-item-stepper-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.mc-item-stepper-qty {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--casi-negro, #1a1a1a);
    min-width: 65px;
    text-align: center;
    white-space: nowrap;
}

.mc-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--gris-medio, #bbb);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.15s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mc-item-remove svg {
    width: 22px;
    height: 22px;
}

@media (hover: hover) {
    .mc-item-remove:hover {
        transform: scale(1.2);
    }
}

/* ── Footer — estado carrito vacío (solo muestra el botón de continuar) ── */
.mc-footer--empty .mc-total-row,
.mc-footer--empty .mc-checkout-btn,
.mc-footer--empty .mc-secure {
    display: none;
}

/* ── Footer ── */
.mc-footer {
    padding: 2px 20px 10px;
    border-top: 1px solid var(--gris-claro, #eee);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mc-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.mc-total-label {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--casi-negro, #111);
    font-weight: 600;
}

.mc-total-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--casi-negro, #1a1a1a);
    font-variant-numeric: tabular-nums;
}

/* Mensaje envío gratis / pedido mínimo — debajo del título */
.mc-shipping-msg {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 8px;
	margin-bottom: 2px;
    margin: 0;
    display: inline-block;
	text-align:center;
	border-bottom: 1px solid var(--gris-claro, #eee);
}
.mc-shipping-msg:empty {
    display: none;
}

.mc-shipping-msg.msg-warning { background: #fff8e1; color: #b45309; }
.mc-shipping-msg.msg-ok      { background: #f0fdf4; color: #166534; }
.mc-shipping-msg.msg-error   { background: #fff1f2; color: #9f1239; }

.mc-continue-btn + .mc-checkout-btn,
.mc-checkout-btn {
    margin-top: 10px;
}

.mc-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--carmin, #cc2a2a);
    user-select: none;
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background 0.2s ease, transform 0.1s ease;
}

.mc-checkout-btn:hover {
    background: var(--carmin-oscuro, #a82020);
}

.mc-checkout-btn--disabled {
    background: #e8c4c4;
    color: #fff;
    pointer-events: none;
    cursor: default;
}

.mc-checkout-btn:active {
    transform: scale(0.98);
}

.mc-continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--casi-negro, #1a1a1a);
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background 0.2s ease, transform 0.1s ease;
    border: none;
    cursor: pointer;
}

.mc-continue-btn:hover {
    background: #333;
    color: #fff;
}

.mc-continue-btn:active {
    transform: scale(0.98);
}

/* ── Zona seguridad ── */
.mc-secure {
    display: flex;
    justify-content: center; /* Centra todo el bloque en el carrito */
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gris-claro, #eee);
}

.mc-secure-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    color: var(--gris-medio, #999);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.mc-secure-label img {
    max-width: 150px;
    height: auto;
    filter: grayscale(0.2);
    opacity: 0.8;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .mc-panel {
        max-width: 100%;
    }
}

/* Flechas de scroll: solo en pantallas >= 600px */
@media (max-width: 599px) {
    .mc-scroll-hint { display: none; }
}