/* ===== Base (mobile-first, max 480px centrado) ===== */
.llamamesa-public {
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #111827;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    --color-libre:    #9ca3af;
    --color-ocupada:  #3b82f6;
    --color-llamando: #f59e0b;
    --color-atendida: #10b981;
    --color-border:   var(--color-ocupada);
}

.llamamesa-public[data-estado="LIBRE"]    { --color-border: var(--color-libre); }
.llamamesa-public[data-estado="OCUPADA"]  { --color-border: var(--color-ocupada); }
.llamamesa-public[data-estado="LLAMANDO"] { --color-border: var(--color-llamando); }
.llamamesa-public[data-estado="ATENDIDA"] { --color-border: var(--color-atendida); }
.llamamesa-public.llamamesa-estado-llamando { --color-border: var(--color-llamando); }

/* ===== Header ===== */
.llamamesa-pub-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 6px solid var(--color-border);
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}

.llamamesa-pub-logo {
    flex-shrink: 0;
}

.llamamesa-pub-logo img {
    max-width: 100px;
    max-height: 100px;
    display: block;
}

.llamamesa-pub-info { flex: 1; min-width: 0; }

.llamamesa-pub-name {
    display: none;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #111827;
    line-height: 1.2;
}

.llamamesa-pub-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.llamamesa-pub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    padding: 0;
    font-family: inherit;
}

.llamamesa-pub-icon:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

.llamamesa-pub-header {
    padding: 14px 16px;
}

.llamamesa-pub-icons {
    margin-left: auto;
}

/* ===== Main ===== */
.llamamesa-pub-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px 0;
    flex: 1;
    position: relative;
}

/* Globo de diálogo (arriba) */
.llamamesa-pub-bubble {
    position: relative;
    background: #fff;
    border: 3px solid #111;
    border-radius: 20px;
    padding: 20px 18px 18px;
    margin-bottom: 0;
}

/* Cola del globo apuntando hacia abajo (a la llama) */
.llamamesa-pub-bubble::before,
.llamamesa-pub-bubble::after {
    content: '';
    position: absolute;
    left: 40px;
    width: 0;
    height: 0;
    border-style: solid;
}

.llamamesa-pub-bubble::before {
    bottom: -18px;
    border-width: 18px 14px 0 14px;
    border-color: #111 transparent transparent transparent;
}

.llamamesa-pub-bubble::after {
    bottom: -12px;
    left: 43px;
    border-width: 12px 11px 0 11px;
    border-color: #fff transparent transparent transparent;
}

.llamamesa-pub-bubble-text {
    font-size: 15px;
    line-height: 1.4;
    margin: 0 0 16px;
    color: #111827;
}

.llamamesa-pub-bubble-text strong {
    font-weight: 800;
}

.llamamesa-pub-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Botones globo */
.llamamesa-btn-globo {
    display: block;
    width: 100%;
    padding: 15px 18px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    border-radius: 16px;
    border: 3px solid #111;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.3;
    font-family: inherit;
    transition: transform 0.06s ease, box-shadow 0.15s ease;
    background: #fff;
    color: #111;
    box-sizing: border-box;
    position: relative;
}

.llamamesa-btn-globo:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.9);
}

.llamamesa-btn-globo:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0 rgba(0,0,0,0.9);
}

.llamamesa-btn-globo:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.llamamesa-btn-primary {
    background: #1d4ed8;
    color: #fff;
    border-color: #111;
}

.llamamesa-btn-warning {
    background: #d97706;
    color: #fff;
    border-color: #111;
}

.llamamesa-btn-secondary {
    background: #fff;
    color: #111;
    border-color: #111;
}

.llamamesa-pub-aviso {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.llamamesa-mensaje-js {
    margin-top: 8px;
    text-align: center;
    font-weight: 600;
    color: #166534;
    font-size: 14px;
}

/* ===== Llama (abajo, grande) ===== */
.llamamesa-pub-llama {
    display: flex;
    justify-content: flex-start;
    padding: 30px 0 0 30px;
    margin-top: -8px;
    flex: 1;
    align-items: flex-end;
}

.llamamesa-pub-llama img {
    width: 190px;
    height: auto;
    display: block;
}

/* ===== Footer ===== */
.llamamesa-pub-footer {
    padding: 18px 16px 20px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
    background: #fafafa;
}

.llamamesa-pub-quejas {
    display: inline-block;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    margin-bottom: 12px;
    font-weight: 500;
}

.llamamesa-pub-quejas:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.llamamesa-pub-copy {
    font-size: 12px;
    color: #9ca3af;
}

.llamamesa-pub-copy a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 600;
}

.llamamesa-pub-copy a:hover { color: #111827; }

/* Mensaje genérico (Enlace inválido, mesa no encontrada) */
.llamamesa-message {
    text-align: center;
    padding: 60px 20px;
    background: #fef2f2;
    border-radius: 12px;
    margin: 20px;
    border: 1px solid #fecaca;
}

.llamamesa-message h2 { color: #991b1b; margin-top: 0; }

/* Modal de horarios */
.llamamesa-horarios-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.llamamesa-horarios-box {
    background: #fff;
    border-radius: 12px;
    padding: 22px 24px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.llamamesa-horarios-box h3 {
    margin: 0 0 12px;
    font-size: 17px;
    color: #111827;
}

.llamamesa-horarios-box pre {
    margin: 0 0 16px;
    font-family: inherit;
    font-size: 14px;
    color: #374151;
    white-space: pre-wrap;
    line-height: 1.5;
}

.llamamesa-horarios-box button {
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
}

/* ===== Bottom sheet flotante (la llama) ===== */
.llamamesa-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50vh;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 9998;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 20px;
}

.llamamesa-sheet.llamamesa-sheet-open {
    transform: translateY(0);
}

/* Barrita superior */
.llamamesa-sheet-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 999px;
    margin: 12px auto 8px;
    flex-shrink: 0;
}

/* Botón cerrar */
.llamamesa-sheet-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    z-index: 2;
}

.llamamesa-sheet-close:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Contenido */
.llamamesa-sheet-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    padding: 0 16px;
    position: relative;
}

/* Llama */
.llamamesa-sheet-llama {
    width: 190px;
    height: auto;
    display: block;
    margin-bottom: -8px;
    position: relative;
    z-index: 1;
}

/* Globo de diálogo */
.llamamesa-sheet-bubble {
    position: relative;
    background: #fff;
    border: 3px solid #111;
    border-radius: 20px;
    padding: 16px 18px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 320px;
    text-align: center;
}

/* Cola del globo apuntando hacia abajo */
.llamamesa-sheet-bubble::before,
.llamamesa-sheet-bubble::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
}

.llamamesa-sheet-bubble::before {
    bottom: -18px;
    border-width: 18px 14px 0 14px;
    border-color: #111 transparent transparent transparent;
}

.llamamesa-sheet-bubble::after {
    bottom: -12px;
    border-width: 12px 11px 0 11px;
    border-color: #fff transparent transparent transparent;
}

.llamamesa-sheet-text {
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    color: #111827;
}

.llamamesa-sheet-text strong {
    font-weight: 800;
}
/* Bienvenida en el globo principal */
.llamamesa-pub-bubble-hi {
    display: block;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 2px;
}

.llamamesa-pub-bubble-rest {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
}