/* ============================================================
   styles.css — Overrides y estilos específicos del admin
   Se carga DESPUÉS de menu-styles.css
   ============================================================ */

:root {
    --add-color: #28a745;
    --delete-color: #e53935;
}


/* ============================================================
   LAYOUT DE DOS COLUMNAS
   ============================================================ */

.admin-layout {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
    padding-left: clamp(1rem, 4vw, 3rem);
}

/* Editor del menú: mismo ancho que el page-wrapper del index */
.admin-menu-editor {
    flex: 0 0 860px;
    background-color: var(--primary-color);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.6);
}

/* Panel derecho */
.admin-sidebar {
    flex: 1;
    min-width: 180px;
    padding: 2rem 1.5rem;
    position: sticky;
    top: var(--topbar-h, 0px);   /* debajo de la barra superior (también fija) */
    height: calc(100vh - var(--topbar-h, 0px));
    overflow-y: auto;
    background: #141210;
}

.sidebar-title {
    color: var(--text-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(124, 108, 92, 0.2);
}

.sidebar-empty {
    color: rgba(124, 108, 92, 0.4);
    font-size: 0.8rem;
    font-style: italic;
    line-height: 1.6;
}

.loading-msg {
    color: var(--text-color);
    padding: 2rem;
    text-align: center;
    opacity: 0.5;
}

/* Ocultar sidebar cuando no hay espacio */
@media (max-width: 1080px) {
    .admin-sidebar { display: none; }
    .admin-menu-editor { flex: 1; }
}

@media (max-width: 900px) {
    .admin-menu-editor { flex: 1; width: 100%; }
}


/* ============================================================
   BOTÓN GUARDAR (fijo)
   ============================================================ */

.save-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

/* Botón Guardar: pastilla color arena (marca Cubierto) */
#saveMenuBtn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 24px;
    font: 600 .92rem/1 inherit;
    letter-spacing: .3px;
    background: #c8b89a;
    color: #161412;
    border: 1px solid #c8b89a;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0,0,0,.45);
    transition: background .18s, border-color .18s, color .18s, transform .12s, box-shadow .18s;
    user-select: none;
}
#saveMenuBtn:hover  { background: #d9cbb0; border-color: #d9cbb0; transform: translateY(-1px); box-shadow: 0 14px 32px rgba(0,0,0,.5); }
#saveMenuBtn:active { transform: translateY(1px); box-shadow: 0 6px 16px rgba(0,0,0,.4); }
#saveMenuBtn:focus-visible { outline: 2px solid #f2ead9; outline-offset: 3px; }
#saveMenuBtn.is-saving { cursor: progress; opacity: .9; transform: none; }
#saveMenuBtn.is-saving svg { animation: save-spin 1s linear infinite; }
#saveMenuBtn.is-saved { background: #3fb96b; border-color: #3fb96b; color: #fff; }
#saveMenuBtn.is-error { background: #c0392b; border-color: #c0392b; color: #fff; }
@keyframes save-spin { to { transform: rotate(360deg); } }


/* ============================================================
   ÍTEMS EDITABLES (sobre el layout de menu-styles.css)
   ============================================================ */

/* Los ítems en admin no abren acordeón al clic */
.admin-page .menu-item {
    cursor: default;
    position: relative;
    padding-right: 28px;
}

/* Descripción siempre visible en admin */
.admin-page .item-details {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
}

/* Inputs que se ven como el texto del menú */
.input-product,
.input-price,
.input-description {
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    transition: border-color 0.15s;
}

.input-product {
    font-weight: bold;
    width: 100%;
    min-width: 0;
    cursor: text;
}

.item-header .producto {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
}

.input-price {
    width: 70px;
    text-align: right;
    cursor: text;
    -moz-appearance: textfield;
}
.input-price::-webkit-outer-spin-button,
.input-price::-webkit-inner-spin-button { -webkit-appearance: none; }

.input-description {
    display: block;
    width: 100%;
    cursor: text;
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.75;
    padding: 0;
    margin: 0;
    /* multilínea: crece con el contenido, interlineado compacto como en el menú */
    resize: none;
    overflow: hidden;
    line-height: 1.25;
    min-height: 1.25em;
    white-space: pre-wrap;
    box-sizing: border-box;
}

/* Menú publicado sin precios: los precios del editor quedan atenuados */
body.prices-hidden .input-price { opacity: .35; }
body.prices-hidden .admin-item .precio { opacity: .5; }

.input-product:focus,
.input-price:focus,
.input-description:focus {
    border-bottom-color: var(--text-color);
}

.input-product:hover:not(:focus),
.input-price:hover:not(:focus),
.input-description:hover:not(:focus) {
    border-bottom-color: rgba(124, 108, 92, 0.35);
}

/* Botón eliminar ítem (aparece al hover) */
.delete-item-btn {
    position: absolute;
    right: 0;
    top: 2px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    padding: 2px 4px;
    transition: opacity 0.15s, color 0.15s;
}

.admin-item:hover .delete-item-btn { opacity: 0.5; }
.delete-item-btn:hover { opacity: 1 !important; color: var(--delete-color); }

/* Botón agregar ítem */
.add-item-btn {
    display: block;
    width: 100%;
    background: none;
    border: 1px dashed rgba(124, 108, 92, 0.25);
    color: rgba(124, 108, 92, 0.4);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
    border-radius: 4px;
    margin: 0.4rem 0 1rem;
    text-align: left;
    transition: all 0.15s;
    font-family: inherit;
}

.add-item-btn:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}


/* ============================================================
   DROP ZONES Y SLIDER (sobre .menu-image de menu-styles.css)
   ============================================================ */

/* La altura la controla JS desde Firebase; solo evitar que estire al contenido */
.admin-page .menu-image {
    align-self: flex-start;
}

.drop-zone { cursor: pointer; }

.drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 5;
}

.drop-overlay span {
    color: #fff;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem 1rem;
    border: 2px dashed rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

.drop-zone:hover .drop-overlay,
.drop-zone.drag-over .drop-overlay,
.drop-zone.uploading .drop-overlay { opacity: 1; }

.drop-zone.drag-over { outline: 3px dashed #28a745; outline-offset: -4px; }

/* Botón de intercambio texto/imagen */
.layout-toggle-btn {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    background: rgba(0, 0, 0, 0.65);
    color: #c8b89a;
    border: 1px solid rgba(200, 184, 154, 0.35);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.layout-toggle-btn:hover {
    background: rgba(124, 108, 92, 0.8);
    border-color: #c8b89a;
}

/* Controles de posición y tamaño (dos filas) */
.pos-controls {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 82%;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ctrl-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ctrl-arrow {
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    flex-shrink: 0;
    user-select: none;
    line-height: 1;
}

.pos-slider,
.height-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    outline: none;
}

.pos-slider    { cursor: ew-resize; }
.height-slider { cursor: ns-resize; }

.pos-slider::-webkit-slider-thumb,
.height-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

.pos-slider::-webkit-slider-thumb    { cursor: ew-resize; }
.height-slider::-webkit-slider-thumb { cursor: ns-resize; }

.pos-slider::-webkit-slider-thumb:hover,
.height-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.pos-slider::-moz-range-thumb,
.height-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.pos-slider::-moz-range-thumb    { cursor: ew-resize; }
.height-slider::-moz-range-thumb { cursor: ns-resize; }

/* Solo el div de imagen se transforma — los controles nunca se ven afectados */
.image-bg {
    position: absolute;
    inset: 0;
    background-size: auto 100%;
    background-repeat: no-repeat;
    background-position: 50% center;
}
.image-bg.img-flipped { transform: scaleX(-1); }

.img-flip-btn {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 28px;
    height: 22px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 6px;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 22px;
    text-align: center;
    flex-shrink: 0;
}
.img-flip-btn.active {
    background: rgba(200,184,154,0.45);
    color: #fff;
    border-color: rgba(200,184,154,0.75);
}
.img-flip-btn:hover {
    background: rgba(255,255,255,0.22);
    color: #fff;
}
.flip-label {
    color: rgba(255,255,255,0.6);
    font-size: 10px;
    line-height: 22px;
    user-select: none;
}


/* ── Feature gating ─────────────────────────────────────────── */
.feature-locked {
    position: relative;
    pointer-events: none;
    opacity: 0.45;
}
.feature-locked::after {
    content: '🔒 Plan superior';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    color: rgba(200,184,154,.6);
    background: rgba(20,20,20,.5);
    border-radius: 8px;
    pointer-events: none;
}
.plan-lock-badge {
    display: none;
    font-size: .58rem;
    background: rgba(200,184,154,.1);
    border: 1px solid rgba(200,184,154,.2);
    color: rgba(200,184,154,.5);
    border-radius: 4px;
    padding: .1rem .4rem;
    vertical-align: middle;
    margin-left: .3rem;
}
.plan-lock-badge.visible { display: inline; }
body.no-descriptions .input-description { display: none !important; }

/* ── Controles de imagen de fondo (sidebar) ─────────────────── */
.bg-img-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
}
.bg-img-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid rgba(124,108,92,.3);
    background: rgba(20,20,20,.8) center/cover no-repeat;
    flex-shrink: 0;
}
.btn-bg-upload {
    flex: 1;
    background: rgba(124,108,92,.15);
    border: 1px solid rgba(124,108,92,.3);
    color: #c8b89a;
    border-radius: 7px;
    padding: .32rem .6rem;
    font-size: .72rem;
    cursor: pointer;
    transition: background .15s;
}
.btn-bg-upload:hover { background: rgba(124,108,92,.25); }
.btn-bg-remove {
    background: none;
    border: none;
    color: rgba(200,184,154,.4);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}
.btn-bg-remove:hover { color: rgba(200,184,154,.8); }

/* ============================================================
   CONTROLES DE DISEÑO (sidebar)
   ============================================================ */

.sidebar-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(124,108,92,0.08);
}
.sidebar-section:last-child { border-bottom: none; padding-bottom: 0; }

.ctrl-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(200,184,154,.62); /* más contraste en modo oscuro */
    margin-bottom: 6px;
}

.seg-control {
    display: flex;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(124,108,92,0.25);
    border-radius: 6px;
    overflow: hidden;
}

.seg-btn {
    flex: 1;
    background: none;
    border: none;
    color: rgba(124,108,92,0.5);
    font-size: 0.78rem;
    padding: 6px 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.seg-btn.active {
    background: rgba(124,108,92,0.25);
    color: #c8b89a;
}

.ctrl-select {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(124,108,92,0.25);
    border-radius: 6px;
    color: #c8b89a;
    padding: 6px 8px;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.ctrl-slider {
    width: 100%;
    margin-top: 4px;
    accent-color: #7C6C5C;
    cursor: pointer;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ctrl-color {
    width: 36px;
    height: 28px;
    border: 1px solid rgba(124,108,92,0.25);
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 2px;
    flex-shrink: 0;
}

.color-hex {
    font-size: 0.75rem;
    color: rgba(124,108,92,0.6);
    font-family: monospace;
}

.mini-drop {
    border: 1px dashed rgba(124,108,92,0.25);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    font-size: 0.75rem;
    color: rgba(124,108,92,0.4);
    transition: border-color 0.15s, color 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.mini-drop:hover, .mini-drop.drag-over { border-color: #7C6C5C; color: #7C6C5C; }

.bg-remove-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 0.72rem;
    color: rgba(124,108,92,0.55);
    cursor: pointer;
    user-select: none;
}
.bg-remove-toggle input[type="checkbox"] {
    accent-color: #7C6C5C;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-remove-bg-now {
    display: block;
    width: 100%;
    margin-top: 4px;
    background: none;
    border: none;
    color: rgba(40,167,69,0.65);
    font-size: 0.72rem;
    cursor: pointer;
    text-align: left;
    padding: 2px 0;
    transition: color 0.15s;
    font-family: inherit;
}
.btn-remove-bg-now:hover:not(:disabled) { color: #28a745; }
.btn-remove-bg-now:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-remove-asset {
    display: block;
    width: 100%;
    margin-top: 4px;
    background: none;
    border: none;
    color: rgba(220,53,69,0.55);
    font-size: 0.72rem;
    cursor: pointer;
    text-align: left;
    padding: 2px 0;
    transition: color 0.15s;
    font-family: inherit;
}
.btn-remove-asset:hover { color: #dc3545; }


/* ============================================================
   RESPONSIVE ADMIN
   ============================================================ */

@media (max-width: 768px) {
    .admin-page .menu-section,
    .admin-page .menu-section.layout-reversed {
        flex-direction: column;
    }

    .admin-page .menu-content { order: 1; }
    .admin-page .menu-image   { order: 2; height: 200px; }

    .save-container { bottom: 16px; right: 16px; }
    #saveMenuBtn { padding: 12px 18px; font-size: 0.9rem; }
}

/* ── ÍCONOS LUCIDE ──────────────────────────────────────────── */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    pointer-events: none;
}

/* ── TOPBAR (admin + superadmin) ────────────────────────────── */
.admin-topbar {
    background: #111;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1.4rem;
    border-bottom: 1px solid rgba(124,108,92,.14);
    position: sticky; top: 0; z-index: 100;
    flex-wrap: wrap; gap: 8px;
}
.topbar-left  { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }

#topbarRestName {
    color: #c8b89a;
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .15px;
}
#topbarUserName {
    color: rgba(200,184,154,.38);
    font-size: .73rem;
    white-space: nowrap;
    letter-spacing: .1px;
}

.btn-back {
    display: inline-flex; align-items: center; gap: 5px;
    color: rgba(200,184,154,.5);
    font-size: .74rem;
    text-decoration: none;
    background: rgba(124,108,92,.07);
    border: 1px solid rgba(124,108,92,.22);
    padding: 5px 14px;
    border-radius: 20px;
    transition: background .18s, border-color .18s, color .18s;
    white-space: nowrap;
    font-family: inherit;
}
.btn-back:hover {
    background: rgba(124,108,92,.16);
    border-color: rgba(124,108,92,.42);
    color: #c8b89a;
}

.topbar-right a,
.topbar-right button {
    display: inline-flex; align-items: center; gap: 4px;
    color: rgba(200,184,154,.52);
    font-size: .74rem;
    background: rgba(124,108,92,.07);
    border: 1px solid rgba(124,108,92,.22);
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s, border-color .18s, color .18s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}
.topbar-right a:hover,
.topbar-right button:hover {
    background: rgba(124,108,92,.16);
    border-color: rgba(124,108,92,.42);
    color: #c8b89a;
}

/* Theme button — circular icon */
.theme-btn {
    background: rgba(124,108,92,.07);
    border: 1px solid rgba(124,108,92,.22);
    border-radius: 50%;
    width: 30px; height: 30px;
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .88rem;
    cursor: pointer;
    transition: background .18s, border-color .18s;
    color: rgba(200,184,154,.6);
    line-height: 1;
    flex-shrink: 0;
}
.theme-btn:hover {
    background: rgba(124,108,92,.18);
    border-color: rgba(124,108,92,.44);
}

/* Logout — leve tinte rojizo para diferenciarlo */
#saLogoutBtn, #logoutBtn {
    border-color: rgba(180,80,60,.22);
    color: rgba(200,140,120,.55);
}
#saLogoutBtn:hover, #logoutBtn:hover {
    background: rgba(180,80,60,.09);
    border-color: rgba(180,80,60,.42);
    color: rgba(220,160,140,.9);
}

/* ── LIGHT MODE — admin + superadmin ────────────────────────── */
body.light { background-color: #f2ede6; color: #3a2e22; }

/* topbar */
body.light .admin-topbar {
    background: #ede6dc;
    border-bottom-color: rgba(100,80,50,.12);
}
body.light #topbarRestName { color: #6b5135; }
body.light #topbarUserName { color: rgba(60,42,20,.38); }

body.light .btn-back {
    background: rgba(100,80,50,.05);
    border-color: rgba(100,80,50,.2);
    color: rgba(60,42,20,.55);
}
body.light .btn-back:hover {
    background: rgba(100,80,50,.13);
    border-color: rgba(100,80,50,.42);
    color: #4a2f10;
}
body.light .topbar-right a,
body.light .topbar-right button {
    background: rgba(100,80,50,.05);
    border-color: rgba(100,80,50,.2);
    color: rgba(60,42,20,.58);
}
body.light .topbar-right a:hover,
body.light .topbar-right button:hover {
    background: rgba(100,80,50,.13);
    border-color: rgba(100,80,50,.42);
    color: #4a2f10;
}
body.light .theme-btn {
    background: rgba(100,80,50,.05);
    border-color: rgba(100,80,50,.2);
    color: rgba(60,42,20,.6);
}
body.light .theme-btn:hover {
    background: rgba(100,80,50,.13);
    border-color: rgba(100,80,50,.42);
}
body.light #saLogoutBtn, body.light #logoutBtn {
    border-color: rgba(160,60,40,.2);
    color: rgba(140,60,40,.6);
}
body.light #saLogoutBtn:hover, body.light #logoutBtn:hover {
    background: rgba(160,60,40,.07);
    border-color: rgba(160,60,40,.4);
    color: rgba(140,60,40,.9);
}

/* ── MODO VISTA (superadmin impersonation) ──────────────────── */
body.preview-mode #saveMenuBtn       { display: none !important; }
body.preview-mode .add-item-btn      { display: none !important; }
body.preview-mode .delete-item-btn   { display: none !important; }
body.preview-mode .layout-toggle-btn { display: none !important; }
body.preview-mode .btn-remove-bg-now,
body.preview-mode .btn-remove-asset  { display: none !important; }
body.preview-mode .social-picker-grid { display: none !important; }
body.preview-mode .social-drag,
body.preview-mode .social-remove-btn { display: none !important; }

/* Sidebar — visible pero no interactivo */
body.preview-mode .admin-sidebar     { pointer-events: none; user-select: none; }
body.preview-mode .drop-overlay      { pointer-events: none !important; opacity: 0 !important; }
body.preview-mode .pos-controls      { pointer-events: none; opacity: .65; }
body.preview-mode .input-product,
body.preview-mode .input-price,
body.preview-mode .input-description { pointer-events: none; cursor: default; }

/* Badge en el topbar */
.preview-badge {
    background: rgba(200,140,60,.1);
    border: 1px solid rgba(200,140,60,.28);
    color: #c89050;
    border-radius: 20px;
    padding: 4px 13px;
    font-size: .72rem;
    white-space: nowrap;
    letter-spacing: .2px;
}
.preview-badge svg { vertical-align: -2px; }
/* Modo soporte (con código del cliente): verde, para distinguirlo de la vista previa */
.support-badge { background: rgba(60,170,100,.12); border-color: rgba(60,170,100,.35); color: #5cbf7a; }
body.light .support-badge { color: #2e7d4f; }

/* save button */
body.light #saveMenuBtn { background: #6b5135; border-color: #6b5135; color: #fff; box-shadow: 0 10px 24px rgba(60,42,20,.28); }
body.light #saveMenuBtn:hover { background: #5a4229; border-color: #5a4229; }
body.light #saveMenuBtn.is-saved { background: #23894a; border-color: #23894a; }
body.light #saveMenuBtn.is-error { background: #c0392b; border-color: #c0392b; }

/* sidebar */
body.light .admin-sidebar { background: #f2ede6; }
body.light .sidebar-title { color: rgba(60,42,20,.5); border-bottom-color: rgba(100,80,50,.15); }
body.light .ctrl-label { color: rgba(60,42,20,.6); }
body.light .ctrl-select {
    background: #fff;
    border-color: rgba(100,80,50,.25);
    color: #3a2e22;
}
body.light .ctrl-slider { accent-color: #6b5135; }
body.light .color-hex { color: rgba(60,42,20,.5); }
body.light .seg-btn { background: none; border-color: rgba(100,80,50,.25); color: #7a6248; }
body.light .seg-btn.active { background: rgba(100,80,50,.12); border-color: #7a6248; color: #6b5135; }
body.light .mini-drop {
    border-color: rgba(100,80,50,.25);
    background: rgba(100,80,50,.04);
    color: rgba(60,42,20,.5);
}
body.light .bg-remove-toggle { color: rgba(60,42,20,.55); }
body.light .btn-remove-bg-now { color: #6b5135; border-color: rgba(100,80,50,.3); }
body.light .btn-remove-asset { color: #c0392b; border-color: rgba(192,57,43,.3); }

/* superadmin specific */
body.light .sa-stat { background: #fff; border-color: rgba(100,80,50,.12); }
/* Planes en modo claro: tarjetas blancas; el recomendado se distingue con borde dorado, un tinte cálido y sombra suave */
body.light .sa-plan-card { background: #fff; border-color: rgba(100,80,50,.16); box-shadow: 0 1px 3px rgba(60,42,20,.05); }
body.light .sa-plan-card.sa-plan-recommended { background: linear-gradient(180deg, #fbf5ea 0%, #fff 55%); border: 1.5px solid #b8935a;
    box-shadow: 0 8px 22px rgba(107,81,53,.14); }
body.light .sa-plan-rec-badge { background: #6b5135; color: #fff; }
body.light .sa-plan-name { color: #6b5135; }
body.light .sa-plan-price { color: #2a1f14; }
body.light .sa-plan-price span { color: rgba(60,42,20,.5); }
body.light .sa-plan-row { color: rgba(60,42,20,.68); }
body.light .sa-plan-off { color: #2e7d4f; }
body.light .sa-plan-ben.on  { background: rgba(46,125,79,.09); color: #2e7d4f; border-color: rgba(46,125,79,.3); }
body.light .sa-plan-ben.off { background: rgba(100,80,50,.04); color: rgba(60,42,20,.38); border-color: rgba(100,80,50,.12); }
body.light .sa-periods-title { color: rgba(60,42,20,.5); }
body.light .sa-period { border-color: rgba(100,80,50,.18); color: rgba(60,42,20,.75); background: #fff; }
body.light .sa-period-input { background: #fff; border-color: rgba(100,80,50,.3); color: #2a1f14; }
/* Botones con colores legibles sobre fondo claro */
body.light .sa-btn-unblock { background: rgba(100,80,50,.07); border-color: rgba(100,80,50,.3); color: #6b5135; }
body.light .sa-btn-unblock:hover { background: rgba(100,80,50,.14); }
body.light .sa-btn-view { background: rgba(100,80,50,.05); border-color: rgba(100,80,50,.25); color: #6b5135; }
body.light .sa-btn-paid { color: #2e7d4f; border-color: rgba(46,125,79,.4); background: rgba(46,125,79,.08); }
body.light .sa-btn-unpaid { color: #a0601c; border-color: rgba(160,96,28,.4); }
body.light .sa-btn-block, body.light .sa-btn-delete { color: #b3261e; border-color: rgba(179,38,30,.35); background: rgba(179,38,30,.06); }
body.light .sa-btn-delete:hover, body.light .sa-btn-block:hover { background: rgba(179,38,30,.12); color: #b3261e; }
body.light .sa-stat-num { color: #6b5135; }
body.light .sa-stat-label { color: rgba(60,42,20,.45); }
body.light .sa-chart-card { background: #fff; border-color: rgba(100,80,50,.12); }
body.light .sa-chart-title { color: rgba(60,42,20,.45); }
body.light .sa-section { background: #fff; border-color: rgba(100,80,50,.12); }
body.light .sa-section-head { border-bottom-color: rgba(100,80,50,.1); }
body.light .sa-section-title { color: rgba(60,42,20,.45); }
body.light .sa-search { background: #f5f0ea; border-color: rgba(100,80,50,.2); color: #3a2e22; }
body.light .sa-tab { border-color: rgba(100,80,50,.2); color: rgba(60,42,20,.45); }
body.light .sa-tab.active, body.light .sa-tab:hover { border-color: rgba(100,80,50,.45); color: #6b5135; background: rgba(100,80,50,.07); }
body.light .sa-table thead th { color: rgba(60,42,20,.4); border-bottom-color: rgba(100,80,50,.1); }
body.light .sa-table tbody tr { border-bottom-color: rgba(100,80,50,.07); }
body.light .sa-table tbody tr:hover { background: rgba(100,80,50,.04); }
body.light .sa-table td { color: rgba(60,42,20,.75); }
body.light .sa-user-name { color: #6b5135; }
body.light .sa-user-email { color: rgba(60,42,20,.4); }
body.light .sa-badge-rest { background: rgba(100,80,50,.1); color: rgba(60,42,20,.65); border-color: rgba(100,80,50,.2); }
body.light .sa-avatar { opacity: .85; }
body.light .sa-empty { color: rgba(60,42,20,.3); }
body.light .sa-loading { color: rgba(60,42,20,.4); }

/* ── TÍTULO DE CATEGORÍA EDITABLE ───────────────────────────── */
.input-category-title {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    color: var(--title-color);
    font-family: var(--title-font-family), var(--main-font-family), sans-serif;
    font-size: var(--title-font-size, 20px);
    font-weight: var(--title-font-weight, 700);
    font-style: var(--title-font-style, normal);
    letter-spacing: inherit;
    padding: 0 0 .5rem;
    margin-top: 20px;
    outline: none;
    cursor: text;
    transition: border-color .15s;
    box-sizing: border-box;
}
.input-category-title:hover:not(:focus) { border-bottom-color: rgba(124,108,92,.45); }
.input-category-title:focus { border-bottom-color: var(--title-color, #7C6C5C); }
body.preview-mode .input-category-title { pointer-events: none; cursor: default; }

/* ── CONTROLES HORIZONTALES DE ESTILOS ──────────────────────── */
.size-controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.size-ctrl { display: flex; flex-direction: column; gap: 1px; }

.color-ctrl-row {
    display: flex; align-items: center; gap: 6px;
    padding: .28rem 0;
    border-bottom: 1px solid rgba(124,108,92,.06);
}
.color-ctrl-row:last-child { border-bottom: none; }
.ctrl-label-inline {
    flex: 1;
    font-size: .6rem; letter-spacing: 1px; text-transform: uppercase;
    color: rgba(200,184,154,.45);
    white-space: nowrap;
}
.color-hex-input {
    width: 62px;
    background: #111;
    border: 1px solid rgba(124,108,92,.2);
    border-radius: 4px;
    color: #c8b89a;
    font-size: .66rem;
    padding: 3px 5px;
    outline: none;
    font-family: monospace;
    letter-spacing: .3px;
    text-align: center;
}
.color-hex-input:focus { border-color: rgba(124,108,92,.5); }
body.light .color-hex-input { background: #fff; border-color: rgba(100,80,50,.2); color: #3a2e22; }
body.light .ctrl-label-inline { color: rgba(60,42,20,.45); }
body.light .color-ctrl-row { border-bottom-color: rgba(100,80,50,.06); }

/* Botones preset colores de íconos sociales */
.social-color-preset-btn {
    font-size: .62rem; padding: 3px 8px;
    border-radius: 6px; cursor: pointer;
    border: 1px solid rgba(124,108,92,.22);
    background: rgba(124,108,92,.08);
    color: rgba(200,184,154,.6);
    font-family: inherit;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.social-color-preset-btn:hover { background: rgba(124,108,92,.2); border-color: rgba(124,108,92,.45); color: #c8b89a; }

/* ── EDITOR REDES SOCIALES (admin sidebar) ──────────────────── */
.ctrl-input-text {
    width: 100%;
    background: #111;
    border: 1px solid rgba(124,108,92,.25);
    border-radius: 6px;
    color: #c8b89a;
    font-size: .75rem;
    padding: 6px 8px;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}
.ctrl-input-text:focus { border-color: rgba(124,108,92,.5); }
.ctrl-input-text::placeholder { color: rgba(200,184,154,.3); }

.socials-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; min-height: 4px; }
.social-row {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 2px; border-radius: 6px;
    border: 1px solid transparent; cursor: grab;
    transition: background .15s;
}
.social-row:hover { background: rgba(124,108,92,.08); }
.social-row.drag-over { border-color: rgba(124,108,92,.4); background: rgba(124,108,92,.06); }
.social-row.dragging  { opacity: .4; }
.social-drag { color: rgba(124,108,92,.35); font-size: 11px; cursor: grab; flex-shrink:0; user-select:none; }
.social-url-input {
    flex: 1; min-width: 0;
    background: #111;
    border: 1px solid rgba(124,108,92,.2);
    border-radius: 4px;
    color: #c8b89a;
    font-size: .65rem;
    padding: 3px 5px;
    outline: none;
    font-family: inherit;
}
.social-url-input:focus { border-color: rgba(124,108,92,.45); }

/* WhatsApp: prefijo fijo "https://wa.me/" + número */
.social-url-prefixed {
    flex: 1; min-width: 0;
    display: flex; align-items: center;
    background: #111;
    border: 1px solid rgba(124,108,92,.2);
    border-radius: 4px;
    font-size: .65rem;
    padding: 0 0 0 5px;
    cursor: text;
}
.social-url-prefixed:focus-within { border-color: rgba(124,108,92,.45); }
.social-url-prefix { color: rgba(200,184,154,.45); white-space: nowrap; user-select: none; }
.social-wa-input {
    flex: 1; min-width: 0;
    background: none; border: none; outline: none;
    color: #c8b89a; font: inherit; padding: 3px 5px 3px 0;
}
.social-wa-input::placeholder { color: rgba(200,184,154,.25); }
body.light .social-url-prefixed { background: #fff; border-color: rgba(100,80,50,.22); }
body.light .social-url-prefixed:focus-within { border-color: rgba(100,80,50,.5); }
body.light .social-url-prefix { color: rgba(60,42,20,.45); }
body.light .social-wa-input { color: #3a2e22; }
body.light .social-wa-input::placeholder { color: rgba(60,42,20,.28); }
.social-url-input::placeholder { color: rgba(200,184,154,.25); }
.social-color-input {
    width: 22px; height: 22px; border: none;
    padding: 0; cursor: pointer; border-radius: 3px;
    background: none; flex-shrink: 0;
}
.social-remove-btn {
    background: none; border: none;
    color: rgba(200,100,100,.55);
    cursor: pointer; font-size: 1rem; line-height: 1;
    padding: 0 2px; flex-shrink: 0;
}
.social-remove-btn:hover { color: rgba(220,80,80,.9); }
.social-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-top: 6px;
}
.social-pick-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 4px 6px;
    border-radius: 8px;
    background: rgba(124,108,92,.08);
    border: 1px solid rgba(124,108,92,.22);
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
    font-size: .58rem; letter-spacing: .3px;
    color: #c8b89a;
    font-family: inherit; line-height: 1;
}
.social-pick-btn:hover { background: rgba(124,108,92,.2); border-color: rgba(124,108,92,.5); transform: translateY(-1px); }
.social-pick-btn[disabled] { opacity: .2; cursor: not-allowed; pointer-events: none; }
.social-pick-name { margin-top: 1px; }
.sidebar-divider {
    border: none; border-top: 1px solid rgba(124,108,92,.15);
    margin: .2rem 0 1rem;
}

/* ── LIGHT MODE — redes sociales e inputs ───────────────────── */
body.light .ctrl-input-text {
    background: #fff;
    border-color: rgba(100,80,50,.22);
    color: #3a2e22;
}
body.light .ctrl-input-text::placeholder { color: rgba(60,42,20,.3); }
body.light .ctrl-input-text:focus { border-color: rgba(100,80,50,.5); }

body.light .social-url-input {
    background: #fff;
    border-color: rgba(100,80,50,.22);
    color: #3a2e22;
}
body.light .social-url-input::placeholder { color: rgba(60,42,20,.28); }
body.light .social-url-input:focus { border-color: rgba(100,80,50,.5); }

body.light .social-pick-btn {
    background: rgba(100,80,50,.06);
    border-color: rgba(100,80,50,.22);
    color: #6b5135;
}
body.light .social-pick-btn:hover {
    background: rgba(100,80,50,.15);
    border-color: rgba(100,80,50,.45);
}
body.light .social-pick-btn[disabled] { opacity: .22; }
body.light .social-drag { color: rgba(60,42,20,.3); }
body.light .social-row:hover { background: rgba(100,80,50,.07); }
body.light .social-row.drag-over { border-color: rgba(100,80,50,.3); background: rgba(100,80,50,.05); }
body.light .social-remove-btn { color: rgba(180,60,60,.5); }
body.light .social-remove-btn:hover { color: rgba(200,40,40,.85); }

.social-empty { font-size: .7rem; color: rgba(200,184,154,.45); padding: .2rem 0; margin: 0; }

/* ══════════════════════════════════════════════════════════
   Modo claro: más contraste en el editor
   Textos más oscuros y cada sección como tarjeta para separar las capas.
   ══════════════════════════════════════════════════════════ */
body.light .admin-sidebar { background: #ebe3d7; }
body.light .sidebar-title { color: #3a2e22; border-bottom-color: rgba(100,80,50,.3); font-weight: 600; }
body.light .sidebar-section {
    background: #fffdf9;
    border: 1px solid rgba(100,80,50,.2);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(60,42,20,.06);
}
body.light .sidebar-section:last-child { padding-bottom: 12px; border-bottom: 1px solid rgba(100,80,50,.2); }
body.light .sidebar-divider { border-top-color: rgba(100,80,50,.3); }
body.light .ctrl-label { color: #4a3a28; font-weight: 600; }
body.light .ctrl-label-inline { color: #5a4630; }
body.light .color-hex,
body.light .bg-remove-toggle { color: #5a4630; }
body.light .color-ctrl-row { border-bottom-color: rgba(100,80,50,.14); }
body.light .ctrl-select,
body.light .ctrl-input-text,
body.light .color-hex-input,
body.light .social-url-input,
body.light .social-url-prefixed { border-color: rgba(100,80,50,.38); color: #2e241a; }
body.light .ctrl-input-text::placeholder,
body.light .social-url-input::placeholder,
body.light .social-wa-input::placeholder { color: rgba(60,42,20,.45); }
body.light .social-url-prefix { color: rgba(60,42,20,.62); }
body.light .seg-btn { border-color: rgba(100,80,50,.4); color: #5a4630; }
body.light .seg-btn.active { background: #6b5135; border-color: #6b5135; color: #fff; }
body.light .mini-drop { border-color: rgba(100,80,50,.4); color: #5a4630; background: #f7f2ea; }
body.light .social-pick-btn { color: #3a2e22; border-color: rgba(100,80,50,.35); background: #f7f2ea; }
body.light .social-pick-btn[disabled] { opacity: .35; }
body.light .social-color-preset-btn { color: #4a3a28; border-color: rgba(100,80,50,.35); background: #f7f2ea; }
body.light .social-color-preset-btn:hover { color: #2e241a; border-color: rgba(100,80,50,.6); background: #efe6d8; }
body.light .social-drag { color: rgba(60,42,20,.55); }
body.light .social-remove-btn { color: rgba(170,50,40,.8); }
body.light .social-empty { color: rgba(60,42,20,.55); }
body.light .plan-lock-badge { color: #6b5135; background: rgba(100,80,50,.1); border-color: rgba(100,80,50,.3); }
.ctrl-value { color: #c8b89a; }
body.light .ctrl-value { color: #6b5135; }
body.light .bg-img-thumb { background-color: #e6ddcf; border-color: rgba(100,80,50,.35); }
body.light .btn-bg-upload { background: #f7f2ea; border-color: rgba(100,80,50,.38); color: #3a2e22; }
body.light .btn-bg-upload:hover { background: #efe6d8; }

/* Modo oscuro: un poco más de contraste en textos secundarios del editor */
body:not(.light) .ctrl-label-inline { color: rgba(200,184,154,.62); }
body:not(.light) .seg-btn:not(.active) { color: rgba(200,184,154,.6); }
body:not(.light) .mini-drop { color: rgba(200,184,154,.55); }
body:not(.light) .bg-remove-toggle { color: rgba(200,184,154,.62); }

/* Ventanas de confirmación del editor (confirmModal) */
.cm-popup { border-radius: 16px !important; font-size: .95rem; }
.cm-popup p { margin: .4rem 0; line-height: 1.5; }
.cm-confirm { color: #161412 !important; font-weight: 600 !important; }
body.light .cm-confirm { color: #fff !important; }
.cm-list { text-align: left; margin: .6rem auto; padding-left: 1.2rem; max-width: 300px; line-height: 1.5; }
.cm-hint { font-size: .82rem; opacity: .75; }

/* ── Encuadre de imágenes de sección: grilla de controles ── */
.ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.ctrl-cell { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.7); cursor: default; min-width: 0; }
.ctrl-cell svg { flex-shrink: 0; }
.ctrl-cell.ctrl-wide { grid-column: 1 / -1; }
.ctrl-cell small { font-size: .68rem; opacity: .8; }
.menu-section.mode-image-wide .width-cell { display: none; }
.posy-slider, .zoom-slider {
    -webkit-appearance: none; appearance: none;
    flex: 1; min-width: 0; height: 3px;
    background: rgba(255,255,255,.25); border-radius: 3px; outline: none;
}
.pos-slider, .height-slider { min-width: 0; }
.posy-slider { cursor: ns-resize; }
.zoom-slider { cursor: zoom-in; }
.posy-slider::-webkit-slider-thumb, .zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); transition: transform .1s;
}
.posy-slider::-webkit-slider-thumb:hover, .zoom-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.posy-slider::-moz-range-thumb, .zoom-slider::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%; background: #fff; border: none; box-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.img-flip-btn { display: inline-flex; align-items: center; justify-content: center; }
.img-reset-btn {
    margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px; border-radius: 6px; cursor: pointer;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
    color: rgba(255,255,255,.75); font: 10px/1 inherit;
}
.img-reset-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
/* Arrastrar para encuadrar */
.admin-page .drop-zone { cursor: move; touch-action: pan-y; } /* en táctil: scroll vertical libre */
.admin-page .drop-zone.dragging-image { cursor: grabbing; }
.admin-page .drop-zone.dragging-image .drop-overlay { opacity: 0 !important; }
body.preview-mode .admin-page .drop-zone, body.preview-mode .drop-zone { cursor: default; touch-action: auto; }

/* Aviso: el zoom supera la resolución real de la imagen */
.img-res-warning {
    position: absolute; top: 52px; left: 50%; transform: translateX(-50%); z-index: 11;   /* debajo de la barra de la sección (flechas, Diseño, eliminar) */
    display: inline-flex; align-items: center; gap: 5px; max-width: 90%;
    padding: 4px 10px; border-radius: 999px; pointer-events: none;
    background: rgba(230,170,40,.92); color: #1a1205; font-size: .66rem; font-weight: 600; line-height: 1.25;
}
.img-res-warning[hidden] { display: none; }

/* Editor: el recuadro de imagen se define por proporción (aspect-ratio inline),
   también en pantallas angostas (antes 200px fijos) */
.admin-page .menu-image.drop-zone { height: auto; }

/* ── Selector de diseño de la sección (editor) ── */
.layout-picker-btn {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 20;
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(0,0,0,.65); color: #c8b89a; border: 1px solid rgba(200,184,154,.35);
    border-radius: 20px; padding: 4px 14px; font: .78rem inherit; cursor: pointer; white-space: nowrap;
}
.layout-picker-btn:hover { background: rgba(124,108,92,.8); border-color: #c8b89a; }
.layout-picker {
    position: absolute; top: 44px; left: 50%; transform: translateX(-50%); z-index: 30;
    width: min(560px, 94%); padding: 14px; border-radius: 14px;
    background: #161616; border: 1px solid rgba(200,184,154,.3); box-shadow: 0 14px 36px rgba(0,0,0,.55);
    color: #ddd0bb; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.layout-picker[hidden] { display: none; }
.lp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: .85rem; color: rgba(221,208,187,.75); }
.lp-close { background: none; border: none; color: rgba(221,208,187,.6); cursor: pointer; padding: 2px; display: inline-flex; }
.lp-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.lp-side { border: 1px dashed rgba(200,184,154,.3); border-radius: 12px; padding: 10px; background: rgba(255,255,255,.02); }
.lp-side-label { display: block; font-size: .68rem; letter-spacing: 1px; text-transform: uppercase; color: rgba(221,208,187,.55); margin-bottom: 8px; }
.lp-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lp-opt {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px;
    border-radius: 10px; border: 1px solid rgba(200,184,154,.22); background: rgba(255,255,255,.03);
    color: #ddd0bb; font: .78rem inherit; cursor: pointer; transition: background .15s, border-color .15s;
}
.lp-opt:hover { border-color: rgba(200,184,154,.55); }
.lp-opt.active { background: #c8b89a; color: #161412; border-color: #c8b89a; font-weight: 600; }
.lp-swap {
    width: 34px; height: 34px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.04); border: 1px solid rgba(200,184,154,.3); color: #ddd0bb;
}
.lp-swap:hover { border-color: #c8b89a; }
.lp-hint { margin: 10px 0 0; font-size: .72rem; line-height: 1.45; color: rgba(221,208,187,.55); }
.lp-lock { margin: 8px 0 0; font-size: .74rem; color: #e6aa28; display: flex; align-items: center; gap: 5px; }
.lp-lock[hidden] { display: none; }
.lp-lock.pulse { animation: lp-pulse .6s ease 2; }
@keyframes lp-pulse { 50% { opacity: .35; } }
@media (max-width: 520px) { .lp-sides { grid-template-columns: 1fr; } .lp-swap { justify-self: center; transform: rotate(90deg); } }
body.preview-mode .layout-picker-btn { display: none !important; }
/* modo claro */
body.light .layout-picker { background: #fffdf9; border-color: rgba(100,80,50,.3); color: #3a2e22; box-shadow: 0 14px 36px rgba(60,42,20,.2); }
body.light .lp-head, body.light .lp-side-label, body.light .lp-hint, body.light .lp-close { color: rgba(60,42,20,.65); }
body.light .lp-side { border-color: rgba(100,80,50,.3); background: #f7f2ea; }
body.light .lp-opt { background: #fff; border-color: rgba(100,80,50,.28); color: #3a2e22; }
body.light .lp-opt.active { background: #6b5135; border-color: #6b5135; color: #fff; }
body.light .lp-swap { background: #fff; border-color: rgba(100,80,50,.3); color: #3a2e22; }
/* Imagen a lo ancho en el editor: el recuadro ocupa todo el ancho */
.admin-page .menu-section.mode-image-wide .menu-image.drop-zone { width: 100%; align-self: stretch; }

/* ── Barra de cada sección: mover ▲ ▼ + Diseño ── */
.section-toolbar {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 20;
    display: flex; align-items: center; gap: 4px;
}
.section-toolbar .layout-picker-btn { position: static; transform: none; }
.sec-move {
    width: 28px; height: 28px; border-radius: 50%; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.65); color: #c8b89a; border: 1px solid rgba(200,184,154,.35);
}
.sec-move:hover:not(:disabled) { background: rgba(124,108,92,.8); border-color: #c8b89a; }
.sec-move:disabled { opacity: .3; cursor: default; }
.menu-section.just-moved { animation: sec-moved .9s ease; }
@keyframes sec-moved { 0% { box-shadow: inset 0 0 0 3px #c8b89a; } 100% { box-shadow: inset 0 0 0 3px transparent; } }
body.preview-mode .section-toolbar { display: none !important; }

/* Botón "Quitar fondo" sobre una imagen de sección ya cargada */
.pos-controls .ctrl-row { flex-wrap: wrap; row-gap: 5px; }
.img-removebg-btn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px; border-radius: 6px; cursor: pointer;
    background: rgba(200,184,154,.18); border: 1px solid rgba(200,184,154,.45);
    color: #f2ead9; font: 10px/1 inherit; white-space: nowrap;
}
.img-removebg-btn:hover { background: rgba(200,184,154,.35); color: #fff; }
.img-removebg-btn[hidden] { display: none; }
.drop-zone.uploading .img-removebg-btn { opacity: .4; pointer-events: none; }

/* Editor: una sección "solo imagen" no tiene productos (se eliminan al elegir el diseño) */
.admin-page .menu-section.mode-image-wide .menu-content { display: none; }

/* Editor: las descripciones siempre visibles (no se anima el desplegable del menú) */
.admin-page .item-details { grid-template-rows: 1fr !important; transition: none !important; }

/* ── Títulos y secciones dinámicas (editor) ─────────────────── */
.cat-title-row { display: flex; align-items: flex-end; gap: 6px; break-after: avoid; }
.cat-title-row .input-category-title { flex: 1; min-width: 0; }
.input-category-title::placeholder { color: rgba(124,108,92,.4); font-weight: normal; }
.remove-cat-btn {
    flex-shrink: 0; width: 26px; height: 26px; margin-bottom: .45rem; padding: 0; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    background: none; border: 1px solid transparent; color: rgba(124,108,92,.45); transition: all .15s;
}
.remove-cat-btn:hover { color: var(--delete-color, #c0392b); border-color: rgba(192,57,43,.35); }
/* la sección siempre conserva al menos un título */
.menu-content .cat-block:only-of-type .remove-cat-btn { display: none; }

.add-cat-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
    margin: .6rem 0 .4rem; padding: .55rem .8rem; border-radius: 8px; cursor: pointer;
    background: rgba(124,108,92,.06); border: 1px dashed rgba(124,108,92,.45);
    color: rgba(200,184,154,.75); font: .8rem inherit; transition: all .15s; break-inside: avoid;
}
.add-cat-btn:hover { background: rgba(124,108,92,.14); border-color: #c8b89a; color: #ddd0bb; }

.sec-delete {
    width: 28px; height: 28px; border-radius: 50%; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.65); color: #c8b89a; border: 1px solid rgba(200,184,154,.35);
}
.sec-delete:hover { background: rgba(192,57,43,.85); border-color: #e07a6e; color: #fff; }

.add-section-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 2.2rem 1rem 1.6rem; }
.add-section-btn {
    width: 56px; height: 56px; border-radius: 50%; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 2px solid rgba(200,184,154,.45); color: #c8b89a;
    transition: background .15s, border-color .15s, transform .15s;
}
.add-section-btn:hover { background: rgba(200,184,154,.12); border-color: #c8b89a; transform: scale(1.06); }
.add-section-btn:active { transform: scale(.96); }
.add-section-label { font-size: .75rem; letter-spacing: 1px; text-transform: uppercase; color: rgba(200,184,154,.5); }
.add-section-lock { margin: 0; font-size: .74rem; color: #e6aa28; display: flex; align-items: center; gap: 5px; }
.add-section-lock[hidden] { display: none; }
.add-section-lock.pulse { animation: lp-pulse .6s ease 2; }

body.preview-mode .add-cat-btn,
body.preview-mode .remove-cat-btn,
body.preview-mode .add-section-wrap { display: none !important; }

body.light .add-cat-btn { background: rgba(100,80,50,.05); border-color: rgba(100,80,50,.35); color: #7a6248; }
body.light .add-cat-btn:hover { background: rgba(100,80,50,.1); border-color: #7a6248; color: #6b5135; }
body.light .add-section-btn { border-color: rgba(100,80,50,.4); color: #7a6248; }
body.light .add-section-btn:hover { background: rgba(100,80,50,.08); border-color: #6b5135; color: #6b5135; }
body.light .add-section-label { color: rgba(60,42,20,.5); }

/* Botón "Eliminar" sobre una imagen de sección ya cargada */
.img-delete-btn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px; border-radius: 6px; cursor: pointer;
    background: rgba(192,57,43,.18); border: 1px solid rgba(224,105,122,.45);
    color: #f3c9c4; font: 10px/1 inherit; white-space: nowrap;
}
.img-delete-btn:hover { background: rgba(192,57,43,.55); color: #fff; }
.img-delete-btn[hidden] { display: none; }
.drop-zone.uploading .img-delete-btn { opacity: .4; pointer-events: none; }
body.preview-mode .img-delete-btn { display: none !important; }


/* ── Vista previa del fondo del menú en el editor (Js: applyEditorMenuBg) ── */
.admin-menu-editor { position: relative; overflow: hidden; }
.admin-menu-editor > :not(.menu-bg-wrap) { position: relative; z-index: 1; }
.has-menu-bg .admin-menu-editor { background-color: transparent; }

/* ── Títulos: negrita / cursiva ── */
.title-style-row { display: flex; gap: 6px; margin-top: 8px; }
.style-toggle {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 6px 8px; border-radius: 8px; cursor: pointer; font: .75rem inherit;
    background: transparent; border: 1px solid rgba(200,184,154,.25); color: rgba(200,184,154,.6); transition: all .15s;
}
.style-toggle b, .style-toggle i { font-family: Georgia, serif; font-size: .9rem; }
.style-toggle:hover { border-color: #c8b89a; color: #c8b89a; }
.style-toggle[aria-pressed="true"] { background: #c8b89a; border-color: #c8b89a; color: #161412; }
body.light .style-toggle { border-color: rgba(100,80,50,.3); color: rgba(60,42,20,.6); }
body.light .style-toggle[aria-pressed="true"] { background: #6b5135; border-color: #6b5135; color: #fff; }

/* ── Textos de ayuda del panel de diseño ── */
.ctrl-help { margin: 6px 0 0; font-size: .68rem; line-height: 1.45; color: rgba(200,184,154,.5); }
.ctrl-help b { color: rgba(200,184,154,.75); font-weight: 600; }
.ctrl-help-inline { font-weight: 400; text-transform: none; letter-spacing: 0; color: rgba(200,184,154,.45); }
body.light .ctrl-help { color: rgba(60,42,20,.55); }
body.light .ctrl-help b { color: rgba(60,42,20,.8); }
body.light .ctrl-help-inline { color: rgba(60,42,20,.5); }
body.preview-mode .style-toggle { pointer-events: none; }

/* Editor, Texto + Texto: el primer título sin margen arriba, alineado con el de la 2.ª columna */
.admin-page .menu-section.mode-text-text .menu-content > .cat-block:first-child .input-category-title { margin-top: 0; }

/* ══════════════════════════════════════════════════════════
   Barra lateral del editor: grupos plegables con resumen
   ══════════════════════════════════════════════════════════ */
.sb-group { border: 1px solid rgba(124,108,92,.22); border-radius: 12px; margin-bottom: 10px; background: rgba(255,255,255,.015); }
.sb-group > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 12px; cursor: pointer; color: #ddd0bb; }
.sb-group > summary::-webkit-details-marker { display: none; }
.sb-group > summary > svg:first-child { flex-shrink: 0; color: #c8b89a; }
.sb-group-title { flex: 1; min-width: 0; }
.sb-group-title b { display: block; font-size: .86rem; font-weight: 600; letter-spacing: .2px; }
.sb-group-title small { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; font-size: .7rem; color: rgba(200,184,154,.55);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-chev { flex-shrink: 0; color: rgba(200,184,154,.5); transition: transform .2s; }
.sb-group[open] > summary .sb-chev { transform: rotate(180deg); }
.sb-group[open] > summary { border-bottom: 1px solid rgba(124,108,92,.18); }
.sb-group > summary:hover .sb-group-title b { color: #c8b89a; }
.sb-group-body { padding: 4px 12px 2px; }
.sb-group-body > .sidebar-section:last-child { border-bottom: none; }
.sb-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(200,184,154,.35); }
.sb-warn { color: #e6aa28; }
.sb-mode-panel[hidden] { display: none; }
/* La vista previa del superadmin bloquea los controles, pero deja abrir y cerrar los grupos */
body.preview-mode .sb-group > summary { pointer-events: auto; cursor: pointer; }

/* Botón "Diseño" y panel lateral (solo cuando la barra no entra en pantalla) */
.topbar-right .sb-open-btn, .sb-drawer-head { display: none; }
.sb-backdrop[hidden] { display: none; }
@media (max-width: 1080px) {
    .topbar-right .sb-open-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 20px; cursor: pointer; font-size: .78rem;
        background: rgba(200,184,154,.14); border: 1px solid rgba(200,184,154,.45); color: #ddd0bb; }
    body.sb-drawer-open .admin-sidebar { display: block; position: fixed; top: 0; right: 0; bottom: 0; height: auto; width: min(380px, 92vw); z-index: 1000; background: #161412;
        overflow-y: auto; padding: 0 16px 24px; box-shadow: -12px 0 40px rgba(0,0,0,.45); }
    .sb-drawer-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 2; margin: 0 -16px 12px; padding: 14px 16px;
        background: inherit; border-bottom: 1px solid rgba(124,108,92,.25); color: #ddd0bb; }
    .sb-close { background: none; border: none; color: inherit; cursor: pointer; padding: 4px; display: inline-flex; }
    .sb-backdrop { position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.45); }
    body.sb-drawer-open { overflow: hidden; }
}
body.light .sb-group { border-color: rgba(100,80,50,.2); background: #fffdf9; }
body.light .sb-group > summary { color: #3a2e22; }
body.light .sb-group > summary > svg:first-child { color: #6b5135; }
body.light .sb-group-title small { color: rgba(60,42,20,.55); }
body.light .sb-chev { color: rgba(60,42,20,.45); }
body.light .sb-group[open] > summary { border-bottom-color: rgba(100,80,50,.15); }
body.light .sb-dot { border-color: rgba(60,42,20,.25); }
body.light .sb-warn { color: #a0601c; }
body.light .topbar-right .sb-open-btn { background: #fff; border-color: rgba(100,80,50,.35); color: #6b5135; }
body.light.sb-drawer-open .admin-sidebar { background: #ebe3d7; }
body.light .sb-group-body .sidebar-section { background: none; border: none; border-bottom: 1px solid rgba(100,80,50,.12); border-radius: 0; box-shadow: none; padding: 0 0 12px; margin-bottom: 12px; }
body.light .sb-group-body .sidebar-section:last-child { border-bottom: none; padding-bottom: 0; }
body.light .sb-drawer-head { color: #3a2e22; border-bottom-color: rgba(100,80,50,.2); }

/* Botones X (quitar / cerrar / eliminar): círculo visible en vez de una X suelta */
.btn-bg-remove, .social-remove-btn, .lp-close, .delete-item-btn {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 24px; height: 24px; padding: 0; border-radius: 50%; cursor: pointer; line-height: 1;
    background: rgba(220,90,80,.14); border: 1px solid rgba(220,90,80,.5); color: #e98a80;
    transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.btn-bg-remove:hover, .social-remove-btn:hover, .lp-close:hover, .delete-item-btn:hover {
    background: #d9534f; border-color: #d9534f; color: #fff;
}
.btn-bg-remove svg, .social-remove-btn svg, .lp-close svg, .delete-item-btn svg { stroke-width: 2.5; }
.lp-close { background: rgba(221,208,187,.1); border-color: rgba(221,208,187,.4); color: #ddd0bb; }
.delete-item-btn { width: 22px; height: 22px; top: 0; opacity: .55; }
.admin-item:hover .delete-item-btn, .delete-item-btn:focus-visible { opacity: 1; }
@media (hover: none) { .delete-item-btn { opacity: .8; } }
body.light .btn-bg-remove, body.light .social-remove-btn, body.light .delete-item-btn {
    background: #fdecea; border-color: rgba(190,60,50,.55); color: #b8382c;
}
body.light .lp-close { background: #fff; border-color: rgba(100,80,50,.4); color: #5a4630; }
body.light .btn-bg-remove:hover, body.light .social-remove-btn:hover, body.light .lp-close:hover, body.light .delete-item-btn:hover {
    background: #c9302c; border-color: #c9302c; color: #fff;
}

/* Celular: los botones de la barra superior pasan a otra fila en vez de ensanchar la página */
@media (max-width: 600px) {
    .topbar-right { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
    #topbarUserName { display: none; }
}
