:root {
    --primary-color: #BF52C8;
    --primary-soft: #f7ecfb;
    --success-color: #00DD1C;
    --bg-body: #f5f5f5;
    --text-color: #222;
    --border-radius-card: 10px;
    --shadow-soft: 0 4px 16px rgba(0,0,0,0.06);
    --danger-color: #dc2626;
    --gray-soft: #e5e7eb;
    --gray-text: #6b7280;
}

/* Reset básico */
* {
    box-sizing: border-box;
}

body.tienda-body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-color);
    margin: 0;
}

/* ================= HEADER GENERAL ================= */

.tienda-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-bottom: 1px solid #f0f0f0;
}

.tienda-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tienda-header-left,
.tienda-header-center,
.tienda-header-right {
    flex: 1;
}

/* CENTRO: logo */

.tienda-header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tienda-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    overflow: hidden;
}

.tienda-logo {
    display: block;
    height: 120px;
    max-height: none;
    transform: translate(-5px, 0);
}

/* IZQUIERDA: botón "Seguir comprando" */

.carrito-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(191, 82, 200, 0.28);
    background: var(--primary-soft);
    color: var(--primary-color);
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
}

.carrito-back-btn i {
    font-size: 1rem;
}

/* DERECHA: usuario + carrito */

.tienda-header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.user-block {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray-text);
}

.user-block i {
    color: var(--primary-color);
}

.user-block a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Carrito icono */

.cart-block .cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-color);
    font-size: 1rem;
    text-decoration: none;
}

.cart-block .cart-link.disabled {
    cursor: default;
    opacity: 0.9;
}

.cart-block .cart-count {
    font-weight: 600;
}

/* ================= MAIN / CONTENEDOR ================= */

.tienda-main,
.carrito-main {
    max-width: 1200px;
    margin: 16px auto 40px;
    padding: 0 16px;
}

.carrito-section h1 {
    margin-top: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mensaje carrito vacío */

.no-results {
    text-align: center;
    padding: 40px 0;
    color: #777;
    font-size: 0.95rem;
}

/* ================= LAYOUT DEL CARRITO ================= */

.carrito-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    margin-top: 16px;
}

.carrito-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Card de cada producto en el carrito */

.carrito-item-card {
    background: #ffffff;
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 10px;
    padding: 10px;

    /* borde verde ligero para resaltar */
    border: 1px solid rgba(0, 221, 28, 0.22);
}


.carrito-item-img img {
    width: 110px;
    height: 110px;
    border-radius: 10px;
    object-fit: cover;
    background: #f9fafb;
}

.carrito-item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.carrito-item-body h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Layout interno del card: info izquierda, precios/datos derecha */

.carrito-item-main {
    flex: 1;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.carrito-item-info {
    flex: 1.6;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.carrito-item-code {
    font-size: 0.9rem;
    color: var(--gray-text);
}

.carrito-item-code i {
    margin-right: 4px;
    color: #9ca3af;
}

.carrito-item-desc {
    font-size: 0.8rem;
    color: var(--gray-text);
    text-align: justify;
}

/* Columna derecha: precios + qty + botones */

.carrito-item-pricing-col {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.carrito-price-block {
    border-radius: 10px;
    background: #f9fafb;
    padding: 8px 10px;
    font-size: 0.85rem;
}

.carrito-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.carrito-price-row .label {
    color: var(--gray-text);
}

.carrito-price-row .value {
    font-weight: 600;
    color: #111827;
}

.carrito-price-separator {
    border: none;
    border-top: 1px dashed #d1d5db;
    margin: 6px 0;
}

.carrito-price-row.total-row .label {
    font-weight: 600;
}

.carrito-price-row.total-row .value {
    font-size: 0.9rem;
}

/* Fila de descuento, en rojo suave */

.descuento-row .label {
    color: var(--danger-color);
}

.descuento-row .value {
    color: var(--danger-color);
}

/* Acciones a la derecha, alineadas en fila */

.carrito-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

/* Textos de precio / puntos / subtotal */

.carrito-item-precio,
.carrito-item-puntos,
.carrito-item-subtotal {
    margin: 2px 0;
    font-size: 0.85rem;
    color: var(--gray-text);
}

.carrito-item-precio strong,
.carrito-item-subtotal strong {
    color: #111827;
}

/* Formulario de cantidad y acciones */

.carrito-item-form {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Cantidad */

.carrito-item-qty label {
    font-size: 0.85rem;
    color: var(--gray-text);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quantity-input {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    overflow: hidden;
    background: #f9fafb;
}

.quantity-input input[type="number"] {
    width: 60px;
    border: none;
    text-align: center;
    font-size: 0.9rem;
    padding: 6px 0;
    background: transparent;
}

.qty-btn {
    background: #f3f4f6;
    border: none;
    padding: 6px 10px;
    font-size: 1rem;
    cursor: pointer;
    color: #374151;
}

.qty-btn:hover {
    background: #e5e7eb;
}

/* Acciones: actualizar / eliminar */

.carrito-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* Botones genéricos */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    background: #ffffff;
    color: #111827;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

/* Primario (actualizar, continuar) */

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    opacity: 0.95;
}

/* Eliminar */

.btn-outline-danger {
    background: #ffffff;
    border-color: rgba(220, 38, 38, 0.35);
    color: var(--danger-color);
}

.btn-outline-danger:hover {
    background: rgba(220, 38, 38, 0.06);
}

/* ================= RESUMEN DE COMPRA ================= */

.carrito-resumen {
    background: #ffffff;
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-soft);
    padding: 14px 14px 16px;
    font-size: 0.9rem;
    align-self: flex-start;
}

.resumen-block {
    border-radius: 10px;
    background: #f9fafb;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.resumen-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--gray-text);
}

.resumen-row span:last-child {
    font-weight: 500;
    color: #111827;
}

.resumen-row.resumen-total span:first-child {
    font-weight: 600;
}

.resumen-row.resumen-total span:last-child {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.resumen-separator {
    border: none;
    border-top: 1px dashed #d1d5db;
    margin: 8px 0;
}

/* Formas de pago */

.carrito-pagos {
    margin-top: 8px;
    margin-bottom: 8px;
}

.carrito-pagos h3 {
    font-size: 0.95rem;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.carrito-pagos h3 i {
    color: var(--primary-color);
}

.pago-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid transparent;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.pago-option input[type="radio"] {
    margin-top: 3px;
}

.pago-option-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pago-title {
    font-weight: 600;
    color: #111827;
}

.pago-subtitle {
    color: var(--gray-text);
}

/* Cuando esté checked, resaltamos el borde */

.pago-option:hover {
    border-color: rgba(191, 82, 200, 0.45);
}

.pago-option input[type="radio"]:checked + .pago-option-body,
.pago-option input[type="radio"]:focus + .pago-option-body {
    /* truco: si luego quieres usar :has() puedes mejorar esto */
}

.carrito-resumen-form {
    margin-top: 6px;
}

.carrito-resumen h2 {
    margin-top: 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.carrito-resumen p {
    margin: 6px 0;
    color: var(--gray-text);
}

.carrito-resumen strong {
    color: #111827;
}

.btn-continuar {
    width: 100%;
    margin-top: 12px;
    background: linear-gradient(90deg, #BF52C8, #00DD1C);
    border: none;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
    justify-content: center;
}

.btn-continuar[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================= MODALES CHECKOUT ================= */

.checkout-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.checkout-modal-backdrop.is-visible {
    display: flex;
}

.checkout-modal {
    background: #ffffff;
    border-radius: 14px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.28);
    position: relative;
    padding: 14px 16px 16px;
}

.checkout-modal-content h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.checkout-modal-content p {
    font-size: 0.9rem;
    color: var(--gray-text);
}

/* Botón cerrar modal */

.checkout-modal .modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.7);
    background: #ffffff;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15,23,42,0.18);
}

.checkout-modal .modal-close i {
    font-size: 0.85rem;
}

/* ================= RESPONSIVE ================= */

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

    .carrito-resumen {
        position: sticky;
        bottom: 0;
        z-index: 10;
    }
}

/* HEADER responsive */

@media (max-width: 768px) {

    .tienda-header-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 6px 10px;
        gap: 4px;
        position: relative;
    }

    /* Logo arriba, alineado a la izquierda */
    .tienda-header-center {
        order: 1;
        display: flex;
        align-items: center;
    }

    .tienda-logo-link {
        justify-content: flex-start;
        height: 56px;
    }

    .tienda-logo {
        height: 90px;
        max-height: none;
        transform: translate(-5px, -4px);
    }

    /* Carrito flotando arriba a la derecha */
    .cart-block {
        position: absolute;
        top: 8px;
        right: 10px;
    }

    .cart-block .cart-link {
        padding: 4px 10px;
    }

    /* Saludo centrado debajo del logo */
    .tienda-header-right {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 2px;
        gap: 8px;
    }

    /* Botón Seguir comprando al final, 100% ancho */
    .tienda-header-left {
        order: 3;
        width: 100%;
    }

    .carrito-back-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
        padding: 7px 10px;
    }

    /* Ajustes carrito items */
    .carrito-item-card {
        flex-direction: row;
    }

    .carrito-item-img img {
        width: 90px;
        height: 90px;
    }

        .carrito-item-card {
        flex-direction: row;
        align-items: flex-start;
    }

    .carrito-item-main {
        flex-direction: column;
        gap: 8px;
    }

    .carrito-item-pricing-col {
        width: 100%;
    }

    .carrito-price-block {
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .carrito-item-card {
        flex-direction: row;
        align-items: flex-start;
    }

    .carrito-item-body h3 {
        font-size: 0.9rem;
    }

    .carrito-item-precio,
    .carrito-item-puntos,
    .carrito-item-subtotal {
        font-size: 0.8rem;
    }

    .quantity-input input[type="number"] {
        width: 52px;
        font-size: 0.85rem;
    }

    .btn-sm {
        padding-inline: 8px;
    }
}

/* ===== Resumen de compra ===== */
.resumen-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
    font-size: 0.9rem;
}

.resumen-row span {
    color: var(--gray-text);
}

/* Referido para invitados */
.carrito-ref-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--gray-soft);
}

.carrito-ref-title {
    font-size: 0.9rem;
    margin: 0 0 6px;
    color: var(--gray-text);
}

.carrito-ref-form label {
    font-size: 0.85rem;
    color: var(--gray-text);
}

.referrer-input-group {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.referrer-input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid var(--gray-soft);
    padding: 6px 10px;
    font-size: 0.9rem;
}

/* Mensajes de validación */
.referrer-msg {
    font-size: 0.8rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.referrer-msg-error {
    color: var(--danger-color);
}

.referrer-msg-success {
    color: var(--success-color);
}

/* Radios de método de pago */
.carrito-pago-metodo {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-soft);
}

.carrito-pago-title {
    font-size: 0.9rem;
    margin: 0 0 6px;
    color: var(--gray-text);
}

.radio-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.radio-line input[type="radio"] {
    accent-color: var(--primary-color);
}

.radio-line span i {
    color: var(--primary-color);
}

/* Hint cuando no se puede continuar */
.continuar-hint {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--gray-text);
}

/* Modal checkout */
.checkout-modal-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkout-total {
    font-size: 0.9rem;
    color: var(--gray-text);
}

.checkout-total strong {
    font-size: 1rem;
}

.checkout-form .form-group {
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.checkout-form label {
    display: block;
    margin-bottom: 4px;
    color: var(--gray-text);
}

.checkout-form select,
.checkout-form input[type="text"],
.checkout-form input[type="file"] {
    width: 100%;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--gray-soft);
    background: #f9fafb;
}

/* Cuenta + botón copiar */
.cuenta-wrapper {
    display: flex;
    gap: 6px;
    align-items: center;
}

.cuenta-wrapper input[type="text"] {
    flex: 1;
}

/* Botón ancho completo */
.btn-full {
    width: 100%;
    justify-content: center;
}

/* Borde verde ligero en cards (resalta productos y resumen) */
.carrito-item-card,
.carrito-resumen {
    border: 1px solid rgba(0, 221, 28, 0.2);
}

/* Responsive referido */
@media (max-width: 480px) {
    .referrer-input-group {
        flex-direction: column;
    }

    .referrer-input-group .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ====== RESUMEN DE COMPRA / STEPS ====== */

.resumen-totales {
    border-radius: 10px;
    background: #f9fafb;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(191, 82, 200, 0.18);
}

.resumen-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin: 4px 0;
}

.resumen-line span:first-child {
    color: #6b7280;
}

.resumen-total {
    border-top: 1px dashed #e5e7eb;
    padding-top: 6px;
    margin-top: 4px;
    font-weight: 600;
}

.texto-descuento {
    color: #dc2626;
}

/* ====== BLOQUES DE PASO (STEP) ====== */

.step-block {
    border-radius: 10px;
    border: 1px solid rgba(0, 221, 28, 0.20); /* verde suave */
    background: #fdfdfd;
    padding: 10px 12px;
    margin-top: 10px;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.step-number {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #00DD1C;
    color: #fff;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.step-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.step-text {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 2px 0 8px;
}

/* ====== CÓDIGO DE REFERIDO ====== */

.referrer-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.referrer-input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.btn-referrer-check {
    border-radius: 999px;
    border: 1px solid rgba(191, 82, 200, 0.6);
    background: #fff;
    color: #BF52C8;
    font-weight: 500;
}

.btn-referrer-check i {
    color: #BF52C8;
}

.referrer-status {
    font-size: 0.8rem;
    min-height: 20px;
    transition: all 0.18s ease;
}

.referrer-status.referrer-error {
    margin-top: 2px;
    color: #dc2626;
    background: #fef2f2;
    border-radius: 999px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: shake 0.22s ease-in-out;
}

.referrer-status.referrer-success {
    margin-top: 2px;
    color: #15803d;
    background: #ecfdf5;
    border-radius: 999px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: fadeInUp 0.25s ease-out;
}

/* Animaciones */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ====== FORMAS DE PAGO (RADIOS) ====== */

.payment-method-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.payment-option {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.payment-option input[type="radio"] {
    margin-top: 4px;
}

.payment-option-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-option-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.payment-option-title i {
    color: #BF52C8;
}

.payment-option-desc {
    font-size: 0.8rem;
    color: #6b7280;
}

.payment-option:hover {
    border-color: rgba(191, 82, 200, 0.7);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.payment-option input[type="radio"]:checked + .payment-option-body,
.payment-option input[type="radio"]:checked ~ .payment-option-body {
    /* fallback por si cambia estructura */
}

.payment-hint {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 6px;
}

/* Botón continuar pago */
.pago-continuar-btn {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pago-continuar-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ====== MODALES DE PAGO ====== */

.pago-modal h2 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pago-modal h2 i {
    color: #BF52C8;
}

.pago-steps-list {
    margin: 6px 0 10px;
    padding-left: 18px;
    font-size: 0.85rem;
    color: #4b5563;
}

.pago-steps-list li {
    margin-bottom: 2px;
}

/* Select de pagos */
.pago-select {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    font-size: 0.9rem;
}

/* Número de cuenta vistoso */
.account-number-box {
    margin-top: 4px;
    border-radius: 10px;
    border: 1px dashed rgba(0, 221, 28, 0.6);
    background: #ecfdf5;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.account-number-text {
    font-family: 'SF Mono', ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
    color: #065f46;
    word-break: break-all;
}

.btn-copy-account {
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.7);
    background: #ffffff;
    color: #047857;
    font-size: 0.8rem;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-copy-account i {
    font-size: 0.95rem;
}

.account-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #6b7280;
}

/* Área de carga de imagen */
.upload-area {
    margin-top: 4px;
}

.upload-input {
    display: none;
}

.upload-label {
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.8);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: #f9fafb;
    font-size: 0.85rem;
    color: #4b5563;
}

.upload-label i {
    font-size: 1.4rem;
    color: #BF52C8;
}

.upload-label small {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
}

.upload-preview {
    margin-top: 6px;
    display: none;
}

.upload-preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

/* Botón procesar pago */
.btn-procesar-pago {
    margin-top: 10px;
    width: 100%;
    justify-content: center;
    font-size: 0.95rem;
    padding: 9px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Botón Ir a pagar */
.btn-ir-pagar {
    width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(191, 82, 200, 0.6);
    color: #BF52C8;
    padding: 7px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
}

.btn-ir-pagar[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ====== MODAL DE ALERTA ====== */

.alert-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.alert-modal-backdrop.is-visible {
    display: flex;
}

.alert-modal {
    background: #ffffff;
    border-radius: 14px;
    max-width: 360px;
    width: 90%;
    padding: 14px 16px 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(15,23,42,0.35);
    animation: fadeInUp 0.25s ease-out;
}

.alert-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
}

.alert-modal-icon i {
    font-size: 1.2rem;
}

.alert-modal h3 {
    margin: 4px 0 4px;
    font-size: 1rem;
}

.alert-modal p {
    font-size: 0.85rem;
    color: #4b5563;
    margin: 0 0 8px;
}

.alert-modal-btn {
    width: 100%;
    justify-content: center;
    font-size: 0.9rem;
}

/* ====== RESPONSIVE ====== */

@media (max-width: 768px) {
    .referrer-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-referrer-check {
        width: 100%;
        justify-content: center;
    }

    .account-number-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-copy-account {
        align-self: stretch;
        justify-content: center;
    }

    .btn-ir-pagar {
        font-size: 0.9rem;
    }
}

/* Fila del código de referido */
.referrer-input-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 6px;
}

/* Input del código: centrado, vistoso */
.referrer-input {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    border-radius: 999px 0 0 999px;
    height: 44px;
    border: 1px solid rgba(191, 82, 200, 0.55);
    background-color: #ffffff;
}

/* Placeholder también centrado y suave */
.referrer-input::placeholder {
    text-align: center;
    color: #9ca3af;
    font-weight: 400;
    letter-spacing: 0.04em;
}

/* Botón validar del mismo alto que el input */
.btn-referrer-check {
    height: 44px;
    padding: 0 16px;
    border-radius: 0 999px 999px 0;
    border: 1px solid rgba(191, 82, 200, 0.9);
    border-left: none;
    background: linear-gradient(90deg, #BF52C8, #7C3AED);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(148, 27, 181, 0.3);
}

.btn-referrer-check i {
    font-size: 1rem;
}

.btn-referrer-check:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(148, 27, 181, 0.35);
}

.btn-referrer-check:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(148, 27, 181, 0.25);
}

/* Responsive: que no se rompa en móvil */
@media (max-width: 480px) {
    .referrer-input {
        font-size: 0.9rem;
        height: 40px;
    }

    .btn-referrer-check {
        height: 40px;
        padding: 0 12px;
        font-size: 0.85rem;
    }
}

/* ===== CARD INFORMATIVO ENTRE CÓDIGO Y PAGO ===== */

.resumen-info-card {
    border-left: 3px solid rgba(191, 82, 200, 0.8);
    background: #f9fafb;
    padding: 10px 12px 12px;
    margin-top: 10px;
}

.resumen-info-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.resumen-info-icon {
    border-radius: 999px;
    background: rgba(191, 82, 200, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #BF52C8;
    flex-shrink: 0;
}

.resumen-info-icon i {
    font-size: 1.2rem;
}

.resumen-info-text h3 {
    margin: 0 0 2px;
    font-size: 0.95rem;
    font-weight: 600;
}

.resumen-info-text p {
    margin: 0;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Lista de pasos */
.resumen-info-steps {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resumen-info-steps li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.85rem;
    color: #4b5563;
}

.step-badge {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #BF52C8;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Responsive: que se adapte bien en móvil */
@media (max-width: 640px) {
    .resumen-info-card {
        padding: 10px;
    }

    .resumen-info-text h3 {
        font-size: 0.9rem;
    }

    .resumen-info-text p,
    .resumen-info-steps li {
        font-size: 0.82rem;
    }
}

.carrito-item-info .carrito-item-title {
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 500;
}

.carrito-price-block-right {
    text-align: right;
}

.carrito-price-block-right .carrito-price-row {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
}

.carrito-price-block-right .carrito-price-row .value,
.carrito-price-block-right .carrito-price-row small {
    text-align: right;
}

/* ===== BOTÓN FLOTANTE RESUMEN ===== */

.floating-resumen-btn {
    position: fixed;
    top: 25%;                 /* Centro vertical de la pantalla */
    right: 12px;              /* Pegado al borde derecho */
    transform: translateY(-50%);
    z-index: 100;             /* Por encima del contenido normal */

    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: none;

    background: linear-gradient(135deg, #BF52C8, #00DD1C);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.floating-resumen-btn i {
    font-size: 1.4rem;
}

.floating-resumen-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-50%) translateX(-1px);
}

.floating-resumen-btn:active {
    transform: translateY(-50%) translateX(0);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

@media (min-width: 901px) {
    .floating-resumen-btn {
        display: none;
    }
}

/* ====== SIDEBAR RESUMEN EN MÓVIL ====== */

.carrito-resumen-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 110;
    display: none;
}

.carrito-resumen-overlay.is-visible {
    display: block;
}

/* Solo comportamiento tipo sidebar en pantallas ≤ 900px */
@media (max-width: 900px) {

    /* El layout pasa a una columna, pero el resumen ya no se muestra fijo abajo */
    .carrito-layout {
        grid-template-columns: 1fr;
    }

    .carrito-resumen {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100%;
        max-width: 360px;

        transform: translateX(100%);
        transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;

        z-index: 120;
        border-radius: 16px 0 0 16px;
        box-shadow: none;

        /* un poco más de padding para que respire */
        padding: 16px 14px 24px;
        overflow-y: auto;
    }

    .carrito-resumen.is-open {
        transform: translateX(0);
        box-shadow: -4px 0 18px rgba(15, 23, 42, 0.35);
    }

    /* Cuando el sidebar está abierto, bloqueamos el scroll del body */
    body.sidebar-open {
        overflow: hidden;
    }
}

/* ==== Ajuste del código de referido SOLO para celulares ==== */
@media (max-width: 640px) {
    .referrer-input-row {
        flex-direction: column;      /* uno debajo del otro */
        align-items: stretch;
        gap: 8px;                    /* separación entre input y botón */
    }

    .referrer-input {
        border-radius: 999px;        /* redondeado en las 4 esquinas */
        height: 44px;                /* opcional, para que se vea prolijo */
    }

    .btn-referrer-check {
        width: 100%;
        justify-content: center;
        border-radius: 999px;        /* redondeado en las 4 esquinas */
        border-left: 1px solid rgba(191, 82, 200, 0.9); /* rehacemos el borde */
        height: 44px;                /* mismo alto que el input */
        padding: 0 14px;
    }
}

/* Área de subida de comprobante */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* Preview centrado y más pequeño */
.upload-preview {
    display: none;               /* Oculto por defecto */
    width: 100%;
    max-height: 190px;
    padding: 0.5rem;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
}

.upload-preview.is-visible {
    display: flex;               /* Se muestra con flex al tener imagen */
}

.upload-preview-img {
    max-width: 100%;
    max-height: 170px;           /* Más pequeña */
    object-fit: contain;
    border-radius: 0.75rem;
}

/* Modal scrollable verticalmente */
.checkout-modal {
    max-height: 90vh;            /* No más alto que la ventana */
    display: flex;
    flex-direction: column;
}

.checkout-modal-content {
    overflow-y: auto;            /* Scroll interno */
    -webkit-overflow-scrolling: touch;
}


/* Bloque de usuario (header superior) */
.user-block {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted, #4b5563);
  flex-wrap: wrap;
}

.user-block i.bi {
  font-size: 1.3rem;
  color: var(--primary-color, #bf52c8);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-info strong {
  font-weight: 600;
  color: var(--text-color, #111827);
}

.user-guest-text a {
  color: var(--primary-color, #bf52c8);
  font-weight: 500;
  text-decoration: none;
}

.user-guest-text a:hover {
  text-decoration: underline;
}

/* Form de logout */
.logout-form {
  margin: 0;
}

/* Botón de cerrar sesión */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.75);
  background: #ffffff;
  color: #374151;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;

  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.btn-logout i {
  font-size: 0.9rem;
}

/* Hover suave, sin “saltos” */
.btn-logout:hover {
  background: #f3e8ff;
  border-color: var(--primary-color, #bf52c8);
  color: var(--primary-color, #bf52c8);
  box-shadow: 0 3px 10px rgba(191, 82, 200, 0.25);
}

/* Focus accesible */
.btn-logout:focus {
  outline: 2px solid var(--primary-color, #bf52c8);
  outline-offset: 2px;
}

/* Responsive en pantallas pequeñas */
@media (max-width: 640px) {
  .user-block {
    justify-content: space-between;
    font-size: 0.8rem;
  }

  .btn-logout span {
    display: none; /* Solo ícono en móviles */
  }

  .btn-logout {
    padding: 6px 8px;
  }
}

.user-block .btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: #ffffff;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.12s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.user-block .btn-logout:hover {
    background: #f9fafb;
    border-color: #bf52c8;
    color: #7c3aed;
    box-shadow: 0 4px 14px rgba(148, 163, 184, 0.4);
    transform: translateY(-0.5px);
}

/* Modal intro */
.modal-intro {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #BF52C8;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.modal-intro p {
    margin: 0;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Lista de pasos */
.pago-steps-list {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.25rem 1.25rem 1.25rem 2.5rem;
    margin-bottom: 1.5rem;
    counter-reset: step-counter;
}

.pago-steps-list li {
    margin-bottom: 0.75rem;
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.6;
}

.pago-steps-list li:last-child {
    margin-bottom: 0;
}

/* Account hint */
.account-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.5;
}

.account-hint i {
    color: #BF52C8;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* ============================================
   ESTILOS MEJORADOS PARA PASOS DE PAGO
   ============================================ */

/* Versión 1: Estilo compacto con iconos coloridos */
.pago-steps-compact {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.pago-steps-compact li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #334155;
    border-left: 3px solid #3b82f6;
    transition: all 0.2s ease;
}

.pago-steps-compact li:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left-color: #2563eb;
    transform: translateX(3px);
}

.pago-steps-compact li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.pago-steps-compact {
    counter-reset: step-counter;
}

/* Variante con colores diferentes por tipo */
.pago-steps-compact.efectivo li {
    border-left-color: #10b981;
}

.pago-steps-compact.efectivo li::before {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.pago-steps-compact.efectivo li:hover {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left-color: #059669;
}

.pago-steps-compact.transferencia li {
    border-left-color: #8b5cf6;
}

.pago-steps-compact.transferencia li::before {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.pago-steps-compact.transferencia li:hover {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-left-color: #7c3aed;
}

/* ============================================
   Versión 2: Estilo horizontal ultra-compacto
   ============================================ */
.pago-steps-mini {
    list-style: none;
    padding: 12px 16px;
    margin: 0;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.pago-steps-mini li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.5;
}

.pago-steps-mini li:not(:last-child) {
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.pago-steps-mini li::before {
    content: counter(mini-counter);
    counter-increment: mini-counter;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    background: #3b82f6;
    color: white;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    margin-top: 2px;
}

.pago-steps-mini {
    counter-reset: mini-counter;
}

/* ============================================
   Versión 3: Estilo con iconos Font Awesome
   ============================================ */
.pago-steps-icons {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.pago-steps-icons li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #334155;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.pago-steps-icons li:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.pago-steps-icons li i {
    width: 20px;
    min-width: 20px;
    color: #3b82f6;
    font-size: 0.875rem;
}

/* ============================================
   Versión 4: Estilo minimalista en una línea
   ============================================ */
.pago-steps-inline {
    list-style: none;
    padding: 10px 14px;
    margin: 0;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8125rem;
}

.pago-steps-inline li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: white;
    border-radius: 6px;
    color: #475569;
    border: 1px solid #cbd5e1;
    white-space: nowrap;
}

.pago-steps-inline li::before {
    content: counter(inline-counter);
    counter-increment: inline-counter;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 700;
}

.pago-steps-inline {
    counter-reset: inline-counter;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .pago-steps-compact li,
    .pago-steps-mini li {
        font-size: 0.8125rem;
    }
    
    .pago-steps-inline {
        flex-direction: column;
    }
    
    .pago-steps-inline li {
        width: 100%;
        white-space: normal;
    }
}

/* ========== MODAL DATOS DE ENVÍO ========== */
.envio-step {
    margin-bottom: 1.5rem;
}

.envio-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.envio-form-group {
    display: flex;
    flex-direction: column;
}

.envio-form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.envio-form-group label i {
    color: #8b5cf6;
    font-size: 1rem;
}

.envio-form-group label .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

.envio-form-group input,
.envio-form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.envio-form-group input:focus,
.envio-form-group textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.envio-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.envio-form-group small {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.envio-form-group small i {
    font-size: 0.875rem;
}

.btn-actualizar-envio {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.btn-actualizar-envio:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

.btn-actualizar-envio:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.envio-status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.envio-status.envio-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.envio-status.envio-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.envio-info-card {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 2px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
}

.envio-info-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.envio-info-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.envio-info-icon i {
    color: white;
    font-size: 1.25rem;
}

.envio-info-text h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e40af;
    margin: 0 0 0.25rem 0;
}

.envio-info-text p {
    font-size: 0.8125rem;
    color: #1e3a8a;
    margin: 0;
    line-height: 1.5;
}

.envio-datos-actuales {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.75rem;
}

.envio-datos-actuales h5 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.envio-datos-actuales h5 i {
    font-size: 0.875rem;
}

.envio-dato-item {
    font-size: 0.8125rem;
    color: #374151;
    padding: 0.375rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

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

.envio-dato-item strong {
    color: #6b7280;
    min-width: 80px;
    font-weight: 600;
}

.envio-dato-item span {
    flex: 1;
    word-break: break-word;
}

@media (min-width: 640px) {
    .envio-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .envio-form-group.full-width {
        grid-column: 1 / -1;
    }
}

@media (max-width: 639px) {
    .envio-form-group input,
    .envio-form-group textarea {
        font-size: 16px; /* Previene zoom en iOS */
    }
}

/* ========== ESTILOS PARA DESGLOSE DE ENVÍO ========== */

.resumen-row-envio {
    padding: 0.75rem 0;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
    margin: 0.5rem 0;
}

.resumen-row-envio.envio-gratis {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.08) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.envio-gratis-text {
    color: #16a34a !important;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.envio-gratis-text i {
    font-size: 1rem;
}

.resumen-row-hint {
    background: rgba(59, 130, 246, 0.06);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.75rem;
}

.resumen-row-hint small {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
}

.resumen-row-hint strong {
    color: #7c3aed;
}

.resumen-row-total {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: #fff;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
}

.resumen-row-total span,
.resumen-row-total strong {
    color: #fff;
    font-size: 1.1rem;
}

.resumen-row-puntos {
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.resumen-row-puntos i {
    color: #f59e0b;
}

/* =========================
   RESUMEN (MÓVIL) -> SCROLL INTERNO
   ========================= */

@media (max-width: 576px){

  /* cuando el resumen está abierto, bloquea scroll del body */
  body.sidebar-open{
    overflow: hidden;
    touch-action: none;
  }

  /* tu sidebar/resumen debe ocupar el alto disponible y scrollear por dentro */
  .carrito-resumen{
    position: fixed; /* si ya lo es, esto lo refuerza */
    /* si es tipo bottom-sheet: anclado abajo */
    bottom: 0;

    /* usa dvh para evitar bug de barras del navegador en móvil */
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    height: auto;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  /* si tu CSS lo mueve con transform al abrir, perfecto.
     pero si lo anclas con top en lugar de bottom, esto lo estabiliza */
  .carrito-resumen.is-open{
    /* no pongas height fija aquí, solo que sea visible */
    /* (si tu CSS usa transform translateY para mostrarlo, déjalo) */
  }

  /* Evita que los hijos “rompan” el scroll con alturas raras */
  .carrito-resumen > *{
    min-height: 0;
  }
}
