/* ============================================================
   Restaurant Menu Widget — rmw-style.css
   v1.0.0
   ============================================================ */

/* ── Reset & base ──────────────────────────────────────────── */
.rmw-wrapper *,
.rmw-wrapper *::before,
.rmw-wrapper *::after {
    box-sizing: border-box;
}

.rmw-wrapper {
    font-family: inherit;
    max-width: 100%;
}

/* ── Category filter bar ────────────────────────────────────── */
.rmw-cat-filter {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 4px;
    margin-bottom: 20px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.rmw-cat-filter::-webkit-scrollbar {
    height: 4px;
}

.rmw-cat-filter::-webkit-scrollbar-thumb {
    background: #d4a574;
    border-radius: 4px;
}

.rmw-cat-filter--sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffff;
}

/* Modo "Fija abajo": barra de navegación anclada a la parte inferior de
   la pantalla, igual que el menú de una app móvil. Ocupa todo el ancho
   del viewport independientemente del ancho del contenedor del widget. */
.rmw-cat-filter--fixed-bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    margin: 0;
    background: #ffffff;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #eee;
    justify-content: center;
}

.rmw-cat-filter-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    border: 1.5px solid #e2ddd6;
    border-radius: 30px;
    background: transparent;
    color: #666666;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    font-family: inherit;
}

.rmw-cat-filter-btn:hover {
    border-color: #1a2a4a;
}

.rmw-cat-filter-btn.is-active {
    background: #1a2a4a;
    border-color: #1a2a4a;
    color: #ffffff;
}

.rmw-cat-filter-btn--all {
    font-weight: 800;
}

/* ── Category section ──────────────────────────────────────── */
.rmw-category-section {
    border: 1.5px solid #d4a574;
    border-radius: 3px;
    margin-bottom: 28px;
    background: #ffffff;
    overflow: hidden;
    scroll-margin-top: 70px;
}

/* Modo Pestañas: oculta todas las categorías salvo la activa.
   El estado inicial se renderiza ya correcto desde PHP (clase .is-active
   en la primera categoría), así que no hay parpadeo antes de que cargue el JS. */
.rmw-wrapper[data-filter-mode="tabs"] .rmw-category-section {
    display: none;
    margin-bottom: 0;
}

.rmw-wrapper[data-filter-mode="tabs"] .rmw-category-section.is-active {
    display: block;
}

/* ── Category header ───────────────────────────────────────── */
.rmw-category-header {
    padding: 13px 24px;
    text-align: center;
    border-bottom: 1.5px solid inherit;
}

.rmw-category-title {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #8b1a1a;
    text-transform: uppercase;
    font-family: inherit;
}

/* ── Dishes list ───────────────────────────────────────────── */
.rmw-dishes-list {
    padding: 0 24px;
}

/* ── Dish item ─────────────────────────────────────────────── */
.rmw-dish-item {
    padding: 18px 0;
    border-bottom: 1px solid #f2ede8;
    transition: background 0.15s ease;
}

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

.rmw-dish-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

/* ── Dish image (optional) ─────────────────────────────────── */
.rmw-dish-image {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: #f2ede8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rmw-dish-info {
    flex: 1;
    min-width: 0;
}

.rmw-dish-title {
    display: block;
    font-size: 20px;
    font-weight: 400;
    color: #1a2a4a;
    margin-bottom: 5px;
    line-height: 1.3;
    font-family: Georgia, 'Times New Roman', 'DejaVu Serif', serif;
}

.rmw-dish-desc {
    font-size: 12.5px;
    color: #666;
    line-height: 1.55;
    margin: 0;
}

.rmw-dish-allergens {
    font-size: 11px;
    color: #aaa;
    margin: 5px 0 0;
}

.rmw-allergen-label {
    font-weight: 700;
    color: #bbb;
}

/* ── Dish right column ─────────────────────────────────────── */
.rmw-dish-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.rmw-dish-price {
    font-size: 15px;
    font-weight: 700;
    color: #1a2a4a;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* ── Order mode: qty controls ──────────────────────────────── */
.rmw-qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 24px;
    padding: 3px 8px 3px 4px;
}

.rmw-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #1a2a4a;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.18s ease, transform 0.12s ease;
    font-family: inherit;
    flex-shrink: 0;
}

.rmw-qty-btn:hover {
    background: #0e1c38;
}

.rmw-qty-btn:active {
    transform: scale(0.92);
}

.rmw-qty-minus {
    font-size: 22px;
}

.rmw-qty-count {
    min-width: 18px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #1a2a4a;
    line-height: 1;
}

/* ── Cart panel (position: fixed) ──────────────────────────── */
.rmw-cart {
    position: fixed;
    bottom: 96px;     /* above the cart bubble */
    right: 20px;
    width: 308px;
    max-height: 420px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 100000;
    flex-direction: column;
    border: 1px solid #ece8e2;
    animation: rmw-cart-in 0.22s ease;
    overflow: hidden;
}

@keyframes rmw-cart-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.rmw-cart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #1a2a4a;
    color: #fff;
    flex-shrink: 0;
}

.rmw-cart-icon-svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: #fff;
}

.rmw-cart-title {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.rmw-cart-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
    font-family: inherit;
}

.rmw-cart-close:hover {
    color: #fff;
}

.rmw-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    max-height: 300px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.rmw-cart-items::-webkit-scrollbar {
    width: 4px;
}
.rmw-cart-items::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.rmw-cart-empty {
    color: #bbb;
    font-size: 13px;
    text-align: center;
    padding: 20px 0 10px;
    margin: 0;
}

.rmw-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f2ede8;
}

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

.rmw-cart-item-name {
    font-size: 13px;
    color: #2a2a2a;
    flex: 1;
    padding-right: 10px;
    line-height: 1.4;
}

.rmw-cart-item-qty {
    font-size: 12px;
    font-weight: 700;
    color: #1a2a4a;
    background: #eef1f6;
    border-radius: 12px;
    padding: 2px 8px;
    white-space: nowrap;
}

/* ── Cart footer & send button ─────────────────────────────── */
.rmw-cart-footer {
    padding: 12px 16px;
    border-top: 1px solid #f0ebe4;
    flex-shrink: 0;
}

.rmw-cart-send {
    width: 100%;
    padding: 13px 16px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.18s ease, transform 0.12s ease;
    font-family: inherit;
    letter-spacing: 0.2px;
}

.rmw-cart-send:hover  { background: #1dae58; }
.rmw-cart-send:active { transform: scale(0.98); }

/* ── Cart bubble toggle ─────────────────────────────────────── */
.rmw-cart-bubble {
    position: fixed;
    bottom: 22px;
    right: 96px;    /* sits left of WA bubble */
    width: 56px;
    height: 56px;
    background: #1a2a4a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    border: none;
    box-shadow: 0 4px 18px rgba(26, 42, 74, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    padding: 0;
    animation: rmw-bubble-pop 0.28s cubic-bezier(.34,1.56,.64,1);
}

@keyframes rmw-bubble-pop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.rmw-cart-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(26, 42, 74, 0.45);
}

.rmw-cart-bubble svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    fill: none;
}

/* Cart count badge */
.rmw-bubble-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #e8385a;
    color: #fff;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    padding: 0 2px;
    line-height: 1;
}

/* ── WhatsApp bubble (fixed) ───────────────────────────────── */
.rmw-wa-bubble {
    position: fixed;
    bottom: 20px;
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rmw-wa-right {
    right: 20px;
    flex-direction: row-reverse;
}

.rmw-wa-left {
    left: 20px;
    flex-direction: row;
}

.rmw-wa-bubble a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.rmw-wa-bubble a:hover {
    transform: scale(1.1);
    box-shadow: 0 7px 28px rgba(37, 211, 102, 0.55);
}

.rmw-wa-bubble a svg {
    width: 34px;
    height: 34px;
}

/* Tooltip */
.rmw-wa-tooltip {
    background: #222;
    color: #fff;
    font-size: 12.5px;
    padding: 7px 13px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    position: relative;
    font-family: inherit;
}

.rmw-wa-left  .rmw-wa-tooltip { transform: translateX(-8px); }

/* Arrow */
.rmw-wa-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
}

.rmw-wa-right .rmw-wa-tooltip::after {
    right: -9px;
    border-left-color: #222;
}

.rmw-wa-left .rmw-wa-tooltip::after {
    left: -9px;
    border-right-color: #222;
}

.rmw-wa-bubble:hover .rmw-wa-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .rmw-dish-title  { font-size: 17px; }
    .rmw-dish-desc   { font-size: 12px; }
    .rmw-dishes-list { padding: 0 14px; }
    .rmw-dish-image  { width: 56px; height: 56px; border-radius: 6px; }
    .rmw-cat-filter-btn { padding: 7px 14px; font-size: 11px; }

    .rmw-cart {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 80px;
    }

    .rmw-cart-bubble {
        right: 80px;
        width: 50px;
        height: 50px;
        bottom: 16px;
    }

    .rmw-wa-right { right: 14px; bottom: 14px; }
    .rmw-wa-left  { left:  14px; bottom: 14px; }

    .rmw-wa-bubble a { width: 52px; height: 52px; }
    .rmw-wa-bubble a svg { width: 28px; height: 28px; }

    .rmw-wa-tooltip { display: none; }
}

/* ── Accessibility: reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .rmw-cart,
    .rmw-cart-bubble,
    .rmw-wa-bubble a,
    .rmw-qty-btn {
        animation: none;
        transition: none;
    }
}
