/* ============================================================
 *  Sistema de Temas del Menú Público
 *  ============================================================ */

:root {
    --theme-primary:       #e11d48;
    --theme-secondary:     #0f172a;
    --theme-accent:        #fbbf24;
    --theme-bg:            #ffffff;
    --theme-card-bg:       #ffffff;
    --theme-text:          #1e293b;
    --theme-muted:         #64748b;

    --theme-mobile-cols:   2;
    --theme-tablet-cols:   3;
    --theme-desktop-cols:  4;

    --radius-card: 14px;
    --radius-chip: 999px;
    --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Variantes de fuente */
body[data-font="serif"] { --font-heading: Georgia, "Times New Roman", serif; --font-body: Georgia, serif; }
body[data-font="rounded"] { --font-heading: "SF Pro Rounded", "Segoe UI", sans-serif; --font-body: "SF Pro Rounded", sans-serif; }
body[data-font="mono"] { --font-heading: ui-monospace, Menlo, monospace; --font-body: ui-monospace, Menlo, monospace; }

/* La hoja también se carga en el editor de plantillas del panel (para la
 * galería de "Estilos base"); limitar el fondo/tipografía a `body.menu-public`
 * evita que el menú público imponga su tema al resto del admin. */
body.menu-public {
    background: var(--theme-bg);
    color: var(--theme-text);
    font-family: var(--font-body);
}
.grid-row { display: table; width: 100%; }
.grid-cell { display: table-cell; width: 50%; padding: 5px; vertical-align: top; }
/* ─────────── Contenedores ─────────── */
.theme-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}
.theme-container--narrow  { max-width: 720px; }
.theme-container--normal  { max-width: 1024px; }
.theme-container--wide    { max-width: 1280px; }
.theme-container--full    { max-width: 100%; padding: 0; }

/* ─────────── Header minimal ─────────── */
.menu-header-minimal {
    background: var(--theme-bg);
    border-bottom: 1px solid rgba(0,0,0,.06);
    position: sticky;
    top: 0;
    z-index: 30;
}
.menu-header-minimal__inner {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    max-width: 1280px;
    margin: 0 auto;
}
.menu-header-minimal__logo {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
}
.menu-header-minimal__brand {
    flex: 1;
    font-size: 1.05rem;
    margin: 0;
    font-family: var(--font-heading);
}

/* ─────────── Hero ─────────── */
.hero {
    min-height: 480px;
    background-size: cover;
    background-position: center;
    display: grid;
    place-items: center;
    color: #fff;
    padding: 3rem 1rem;
    text-align: center;
}
.hero__logo {
    width: 96px; height: 96px; border-radius: 50%;
    object-fit: cover; border: 4px solid rgba(255,255,255,.3);
    margin: 0 auto 1rem;
}
.hero__brand {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 0 0 .5rem;
    font-family: var(--font-heading);
}
.hero__tagline {
    font-size: 1rem;
    margin: 0 0 1.5rem;
    opacity: .9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hero__actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
}
.hero-featured {
    padding: 2rem 1rem;
}
.hero-featured__title {
    text-align: center;
    margin: 0 0 1rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
}
.hero-featured__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 1280px;
    margin: 0 auto;
}

/* ─────────── Grid de productos ─────────── */
.product-grid--grid {
    display: grid;
    grid-template-columns: repeat(var(--theme-mobile-cols), minmax(0, 1fr));
    gap: .85rem;
}
@media (min-width: 640px) {
    .product-grid--grid { grid-template-columns: repeat(var(--theme-tablet-cols), minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .product-grid--grid { grid-template-columns: repeat(var(--theme-desktop-cols), minmax(0, 1fr)); }
}

/* ─────────── Masonry ─────────── */
.product-masonry {
    columns: var(--theme-mobile-cols);
    column-gap: .75rem;
}
@media (min-width: 640px) { .product-masonry { columns: var(--theme-tablet-cols); } }
@media (min-width: 1024px) { .product-masonry { columns: var(--theme-desktop-cols); } }

.product-masonry-item {
    break-inside: avoid;
    margin-bottom: .75rem;
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    cursor: pointer;
}
.product-masonry-item img {
    width: 100%; display: block;
}
.product-masonry-item__placeholder {
    aspect-ratio: 4/3;
    background: #f1f5f9;
    display: grid;
    place-items: center;
    color: #cbd5e1;
    font-size: 2rem;
}
.product-masonry-item__overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.75));
    color: #fff;
    padding: 1.5rem .75rem .6rem;
}
.product-masonry-item__overlay h3 {
    margin: 0 0 .15rem;
    font-size: .9rem;
    font-family: var(--font-heading);
}
.product-masonry-item__overlay .price {
    font-size: .9rem;
    font-weight: 700;
}

/* ─────────── Lista ─────────── */
.product-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.product-list-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem;
    background: var(--theme-card-bg);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 3px rgba(15,23,42,.05);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.product-list-item:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(15,23,42,.08);
}
.product-list-item__media {
    width: 72px; height: 72px; flex: 0 0 72px;
    border-radius: 8px; overflow: hidden;
}
.product-list-item__media img { width: 100%; height: 100%; object-fit: cover; }
.product-list-item__body { flex: 1; min-width: 0; }
.product-list-item__title {
    margin: 0;
    font-size: .95rem;
    font-family: var(--font-heading);
}
.product-list-item__desc {
    margin: .15rem 0 0;
    font-size: .8rem;
    color: var(--theme-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-list-item__price {
    font-weight: 700;
    color: var(--theme-primary);
    font-size: 1rem;
    white-space: nowrap;
}

/* ─────────── Catálogo / Cards ─────────── */
.product-catalog,
.product-cards {
    display: grid;
    grid-template-columns: repeat(var(--theme-mobile-cols), minmax(0, 1fr));
    gap: 1rem;
}
@media (min-width: 640px) {
    .product-catalog,
    .product-cards { grid-template-columns: repeat(var(--theme-tablet-cols), minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .product-catalog { grid-template-columns: repeat(var(--theme-desktop-cols), minmax(0, 1fr)); }
    .product-cards   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.product-catalog-card {
    background: var(--theme-card-bg);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15,23,42,.06);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.product-catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(15,23,42,.12);
}
.product-catalog-card__media {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f1f5f9;
}
.product-catalog-card__media img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s;
}
.product-catalog-card:hover .product-catalog-card__media img { transform: scale(1.06); }
.product-catalog-card__placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 3rem;
    color: #cbd5e1;
}
.product-catalog-card__body {
    padding: .75rem;
    text-align: center;
}
.product-catalog-card__body h3 {
    margin: 0 0 .25rem;
    font-size: .95rem;
    font-family: var(--font-heading);
}
.product-catalog-card__body p {
    margin: 0 0 .5rem;
    font-size: .78rem;
    color: var(--theme-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-catalog-card__body .price {
    color: var(--theme-primary);
    font-weight: 700;
    font-size: 1rem;
}

/* ─────────── Estilos de tarjeta ─────────── */
.product-card--flat      { box-shadow: none; border: 1px solid rgba(0,0,0,.06); }
.product-card--rounded   { border-radius: var(--radius-card); }
.product-card--shadow    { box-shadow: 0 4px 16px rgba(15,23,42,.08); }
.product-card--bordered  { border: 2px solid var(--theme-primary); box-shadow: none; }
.product-card--glass     { background: rgba(255,255,255,.6); backdrop-filter: blur(8px); }

/* ─────────── Hover de tarjeta ─────────── */
.product-card[data-hover="lift"]:hover   { transform: translateY(-4px); }
.product-card[data-hover="scale"]:hover  { transform: scale(1.02); }
.product-card[data-hover="glow"]:hover   { box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb, 225,29,72), .2); }

/* ─────────── Filtros pills ─────────── */
.menu-filters--pills {
    position: sticky;
    top: 0;
    z-index: 25;
    background: var(--theme-bg);
    border-bottom: 1px solid rgba(0,0,0,.06);
    display: flex;
    gap: .35rem;
    padding: .6rem 1rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.menu-filters--pills::-webkit-scrollbar { display: none; }
.menu-categories-bar {
    display: flex;
    gap: .35rem;
    margin-left: auto;
}

/* ─────────── Redondeos de botones ─────────── */
body[data-button-radius="sharp"] .btn { border-radius: 0; }
body[data-button-radius="rounded"] .btn { border-radius: 8px; }
body[data-button-radius="pill"] .btn { border-radius: 999px; }

body[data-button-style="outline"] .btn-primary {
    background: transparent;
    border: 2px solid var(--theme-primary);
    color: var(--theme-primary);
}
body[data-button-style="ghost"] .btn-primary {
    background: rgba(225,29,72,.08);
    color: var(--theme-primary);
}

/* ─────────── Animaciones ─────────── */
body[data-animations="1"] .product-card {
    animation: themeFadeIn .35s ease both;
}
@keyframes themeFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* ─────────── Modal ─────────── */
.product-modal--centered { border-radius: 18px; }
.product-modal--side {
    margin: 0 0 0 auto;
    max-height: 100vh;
    border-radius: 0;
    width: min(520px, 100vw);
    height: 100vh;
}
.product-modal--fullscreen {
    width: 100vw; height: 100vh;
    border-radius: 0;
}

/* ─── Header minimal ─── */
.menu-header-minimal {
    background: var(--theme-bg, #fff);
    border-bottom: 1px solid rgba(0,0,0,.06);
    position: sticky;
    top: 0;
    z-index: 30;
}
.menu-header-minimal__inner {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    max-width: 1280px;
    margin: 0 auto;
}
.menu-header-minimal__logo {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.menu-header-minimal__brand {
    flex: 1;
    font-size: 1.05rem;
    margin: 0;
    font-family: var(--font-heading);
}
.menu-header-minimal__actions {
    display: flex;
    gap: .35rem;
}

/* ─── Categorías bar (dentro de filtros) ─── */
.menu-categories-bar {
    display: flex;
    gap: .35rem;
    margin-left: auto;
    overflow-x: auto;
    scrollbar-width: none;
}
.menu-categories-bar::-webkit-scrollbar { display: none; }
.chip--category {
    background: transparent;
    border: 1px solid #e2e8f0;
}

/* ─── Alturas de header ─── */
.menu-header--compact .menu-cover { height: 120px; }
.menu-header--normal  .menu-cover { height: 180px; }
.menu-header--tall    .menu-cover { height: 280px; }
.menu-header--full    .menu-cover { height: 60vh; min-height: 400px; }

/* ─── Modal variantes ─── */
.product-modal--side {
    margin: 0 0 0 auto;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    width: min(520px, 100vw);
}
.product-modal--fullscreen {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
}
