.chatbot-btn {
    position: fixed;
    bottom: 160px;
    right: 20px;
    background: var(--rojo, #e63946);
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 998;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chatbot-btn:hover { transform: scale(1.1); }

.chatbot-window {
    position: fixed;
    bottom: 160px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.chatbot-window.active { display: flex; }

.chatbot-header {
    background: var(--rojo, #e63946);
    color: white;
    padding: 1em;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chatbot-close { background: none; border: none; color: white; font-size: 1.2rem; cursor: pointer; }

.chatbot-messages {
    flex: 1;
    padding: 1em;
    overflow-y: auto;
    max-height: 350px;
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}

.chatbot-msg {
    padding: 0.7em 1em;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.4;
}
.chatbot-msg.bot {
    background: #f0f0f0;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chatbot-msg.user {
    background: var(--rojo, #e63946);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chatbot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    padding: 0.5em 1em 1em;
}
.chatbot-option {
    background: #fff;
    border: 1px solid var(--rojo, #e63946);
    color: var(--rojo, #e63946);
    padding: 0.4em 0.8em;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}
.chatbot-option:hover {
    background: var(--rojo, #e63946);
    color: white;
}

[data-theme="dark"] .chatbot-window { background: #1c1c1e; }
[data-theme="dark"] .chatbot-msg.bot { background: #2c2c2e; color: #f0f0f0; }
[data-theme="dark"] .chatbot-option { background: #2c2c2e; color: #f0f0f0; border-color: #e63946; }

/* ============================================
   BOTÓN FLOTANTE MI PEDIDO
   ============================================ */
.btn-mi-pedido {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 997;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-mi-pedido:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }

.btn-mi-pedido-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 12px;
    height: 12px;
    background: var(--rojo, #e63946);
    border-radius: 50%;
    border: 2px solid #fff;
    display: none;
    animation: mp-pulse 1.5s ease-in-out infinite;
}
.btn-mi-pedido-dot.visible { display: block; }

@keyframes mp-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.7; }
}

.mi-pedido-panel {
    position: fixed;
    bottom: 160px;
    right: 20px;
    width: 330px;
    max-height: 520px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: mp-slide-in 0.25s ease-out;
}
.mi-pedido-panel.active { display: flex; }

@keyframes mp-slide-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mp-header {
    background: #1a1a1a;
    color: #fff;
    padding: 0.9em 1.1em;
    font-weight: 700;
    font-size: 0.92rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mp-close { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 0; }

.mp-body {
    flex: 1;
    overflow-y: auto;
    padding: 1em 1.1em;
    font-size: 0.88rem;
}

.mp-loading { text-align: center; color: #aaa; padding: 2em 0; }

.mp-estado-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.25em 0.75em;
    border-radius: 20px;
    border: 1px solid;
    margin-bottom: 1em;
}
.mp-badge-pendiente      { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.mp-badge-confirmada     { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.mp-badge-en_preparacion { background: #fffde7; color: #f57f17; border-color: #fff176; }
.mp-badge-en_camino      { background: #f3e5f5; color: #7b1fa2; border-color: #ce93d8; }
.mp-badge-entregada      { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.mp-badge-cancelada      { background: #ffebee; color: #c62828; border-color: #ef9a9a; }

/* Mini stepper */
.mp-stepper {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1em;
    overflow-x: auto;
}
.mp-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 50px;
    position: relative;
}
.mp-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 10px;
    left: calc(50% + 12px);
    right: calc(-50% + 12px);
    height: 2px;
    background: #e5e5e5;
}
.mp-step.done:not(:last-child)::after { background: #2e7d32; }
.mp-step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e5e5e5;
    border: 2px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
    z-index: 1;
    position: relative;
}
.mp-step.done .mp-step-dot   { background: #2e7d32; border-color: #2e7d32; }
.mp-step.current .mp-step-dot { background: var(--rojo, #e63946); border-color: var(--rojo, #e63946); }
.mp-step-label {
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #bbb;
    margin-top: 0.35em;
    text-align: center;
    white-space: nowrap;
}
.mp-step.done .mp-step-label,
.mp-step.current .mp-step-label { color: #333; }

.mp-prod-row {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.5em 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.84rem;
}
.mp-prod-row:last-child { border-bottom: none; }
.mp-prod-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #eee;
}
.mp-prod-ph {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.mp-prod-nombre { flex: 1; font-weight: 600; color: #222; }
.mp-prod-cant   { color: #aaa; font-size: 0.78rem; white-space: nowrap; }
.mp-prod-precio { font-weight: 700; color: #111; white-space: nowrap; }

.mp-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding: 0.25em 0;
    color: #555;
}
.mp-total-row.grand {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    border-top: 1px solid #e5e5e5;
    margin-top: 0.4em;
    padding-top: 0.5em;
}

.mp-footer {
    padding: 0.75em 1.1em;
    border-top: 1px solid #f0f0f0;
}
.mp-btn-detalle {
    display: block;
    text-align: center;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.83rem;
    font-weight: 700;
    padding: 0.7em 1em;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}
.mp-btn-detalle:hover { background: #333; color: #fff; }

/* Dark mode */
[data-theme="dark"] .mi-pedido-panel { background: #1c1c1e; }
[data-theme="dark"] .mp-body .mp-prod-nombre { color: #f0f0f0; }
[data-theme="dark"] .mp-body .mp-prod-precio { color: #f0f0f0; }
[data-theme="dark"] .mp-total-row.grand { color: #f0f0f0; }
[data-theme="dark"] .mp-footer { border-color: #333; }
[data-theme="dark"] .mp-prod-row { border-color: #2c2c2e; }
[data-theme="dark"] .btn-mi-pedido { background: #2a2a2a; }
[data-theme="dark"] .btn-mi-pedido-dot { border-color: #1c1c1e; }

/* ============================================
   TOAST AVISO HORARIO
   ============================================ */
.horario-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #1a1a1a;
    color: #fff;
    padding: 0.85em 1.6em;
    border-radius: 40px;
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0,0,0,0.22);
    z-index: 9998;
    white-space: nowrap;
    animation: ht-slide-up 0.4s cubic-bezier(0.22,1,0.36,1) forwards;
    border: 1.5px solid rgba(255,255,255,0.12);
}
.horario-toast.hiding {
    animation: ht-slide-down 0.35s ease-in forwards;
}

@keyframes ht-slide-up {
    from { opacity: 0; transform: translateX(-50%) translateY(24px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes ht-slide-down {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(24px); }
}

[data-theme="dark"] .horario-toast {
    background: #2a2a2a;
    border-color: rgba(255,255,255,0.15);
}
