/* ==========================================================================
   Pizza Royers · Carta  —  estilos del frontend
   Prefijo de clases: .prc-   (todo aislado del tema de WordPress)
   Estética: pizzería premium — negro/carbón, vino y dorado.
   ========================================================================== */

.prc-app {
  /* Tokens (se pueden sobreescribir desde Ajustes del plugin) */
  --prc-bg: #f4efe4;
  --prc-surface: #ffffff;
  --prc-ink: #17130f;
  --prc-muted: #756c5e;
  --prc-line: #e6dfd0;
  --prc-brand: #7a1220;
  --prc-brand-ink: #ffffff;
  --prc-accent: #c9a227;
  --prc-dark: #17130f;
  --prc-dark-2: #241d17;
  --prc-blue: #17130f;      /* estado "seleccionado" (antes azul, ahora negro/carbón) */
  --prc-blue-ink: #e9c96b;  /* texto dorado sobre el negro */
  --prc-radius: 16px;
  --prc-shadow: 0 1px 2px rgba(23, 19, 15, 0.05), 0 10px 26px -14px rgba(23, 19, 15, 0.35);
  --prc-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  font-family: var(--prc-font);
  color: var(--prc-ink);
  background: var(--prc-bg);
  border-radius: calc(var(--prc-radius) + 6px);
  padding: 0 0 32px;
  position: relative;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  container-type: inline-size;
}
.prc-app *,
.prc-app *::before,
.prc-app *::after { box-sizing: border-box; }
.prc-app button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; margin: 0; }
.prc-app img { display: block; max-width: 100%; height: auto; }
.prc-app :focus-visible { outline: 3px solid var(--prc-accent); outline-offset: 2px; border-radius: 8px; }

.prc-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Cabecera ---------- */
.prc-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px 22px 26px;
  background:
    radial-gradient(120% 160% at 15% -20%, rgba(201, 162, 39, .16), transparent 55%),
    linear-gradient(155deg, var(--prc-dark) 0%, var(--prc-dark-2) 55%, #2c221a 100%);
  border-radius: calc(var(--prc-radius) + 6px) calc(var(--prc-radius) + 6px) 0 0;
  position: relative;
  overflow: hidden;
}
.prc-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--prc-accent) 18%, var(--prc-accent) 82%, transparent);
  opacity: .85;
}
.prc-brand { display: flex; align-items: center; gap: 14px; min-width: 0; position: relative; z-index: 1; }
.prc-brand img {
  width: 48px; height: 48px; object-fit: contain; flex: none; border-radius: 50%;
  background: #fff; padding: 4px; box-shadow: 0 0 0 1.5px rgba(201, 162, 39, .55), 0 6px 16px rgba(0,0,0,.35);
}
.prc-brand-text { display: flex; flex-direction: column; min-width: 0; }
.prc-brand-title {
  font-size: 21px; font-weight: 800; letter-spacing: .01em; line-height: 1.15; margin: 0; color: #fbf7ee;
}
.prc-brand-sub {
  font-size: 11.5px; color: var(--prc-accent); margin: 5px 0 0; font-weight: 700;
  text-transform: uppercase; letter-spacing: .11em;
}
.prc-count {
  font-size: 11.5px; color: #171310; white-space: nowrap; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  background: var(--prc-accent); border: none; padding: 7px 12px; border-radius: 999px; position: relative; z-index: 1;
}

/* ---------- Búsqueda ---------- */
.prc-search { padding: 16px 20px 10px; }
.prc-search-box { position: relative; display: flex; align-items: center; }
.prc-search-box svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--prc-muted); pointer-events: none; }
.prc-search-input {
  width: 100%; height: 48px; padding: 0 44px 0 42px; border-radius: 12px;
  border: 1.5px solid var(--prc-line); background: var(--prc-surface); color: var(--prc-ink);
  font: inherit; font-size: 15px; box-shadow: var(--prc-shadow); -webkit-appearance: none; appearance: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.prc-search-input:focus { border-color: var(--prc-ink); }
.prc-search-input::placeholder { color: var(--prc-muted); }
.prc-search-clear { position: absolute; right: 8px; width: 32px; height: 32px; border-radius: 10px; display: none; align-items: center; justify-content: center; color: var(--prc-muted); }
.prc-search-clear svg { position: static; width: 16px; height: 16px; }
.prc-search-clear:hover { background: var(--prc-bg); color: var(--prc-ink); }
.prc-search-box.has-value .prc-search-clear { display: inline-flex; }

/* ---------- Barra de colecciones (pegajosa) ---------- */
.prc-tabs-wrap {
  position: sticky; top: var(--prc-sticky-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--prc-bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--prc-line);
}
.prc-tabs {
  display: flex; gap: 9px; padding: 14px 20px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.prc-tabs::-webkit-scrollbar { display: none; }
.prc-tab {
  flex: none; scroll-snap-align: start; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 11px 20px; min-height: 42px; border-radius: 999px; font-size: 14px; font-weight: 700; letter-spacing: -0.005em;
  color: var(--prc-ink); background: var(--prc-surface); border: 1.5px solid var(--prc-line);
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.prc-tab:hover { border-color: var(--prc-brand); color: var(--prc-brand); }
.prc-tab:active { transform: scale(.97); }
.prc-tab[aria-selected="true"] {
  background: var(--prc-blue); color: var(--prc-blue-ink); border-color: var(--prc-blue);
  box-shadow: 0 8px 18px -8px rgba(23, 19, 15, .55);
}
.prc-tab[aria-selected="true"]:hover { color: var(--prc-blue-ink); }
.prc-tab .prc-tab-n {
  font-size: 11.5px; font-weight: 800; margin-left: 4px; padding: 2px 7px; border-radius: 999px; line-height: 1;
  background: color-mix(in srgb, var(--prc-ink) 8%, transparent); color: inherit;
}
.prc-tab[aria-selected="true"] .prc-tab-n { background: rgba(233, 201, 107, .2); }

/* Submenú de salsas (solo pizzas) */
.prc-subfilters { display: flex; gap: 10px; padding: 0 20px 12px; overflow-x: auto; scrollbar-width: none; }
.prc-subfilters[hidden] { display: none; }
.prc-subfilters::-webkit-scrollbar { display: none; }
.prc-sauce {
  flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 38px;
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 700; line-height: 1;
  color: var(--prc-muted); border: 1.5px dashed var(--prc-line); background: transparent; cursor: pointer; transition: all .18s ease;
}
.prc-sauce:hover { border-color: var(--prc-brand); color: var(--prc-brand); border-style: solid; }
.prc-sauce[aria-pressed="true"] {
  background: var(--prc-brand); color: #fff; border-color: var(--prc-brand); border-style: solid;
  box-shadow: 0 4px 12px rgba(122, 18, 32, .32);
}

/* ---------- Secciones y cuadrícula ---------- */
.prc-sections { padding: 8px 20px 0; display: flex; flex-direction: column; gap: 30px; }
.prc-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 2px 12px; border-bottom: 2px solid var(--prc-ink); }
.prc-section-title {
  font-size: 21px; font-weight: 800; letter-spacing: -0.01em; margin: 0; line-height: 1.15;
  text-transform: uppercase; letter-spacing: .02em;
}
.prc-section-meta { font-size: 12.5px; color: var(--prc-accent); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }

.prc-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@container (min-width: 620px) { .prc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@container (min-width: 900px) { .prc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@container (min-width: 1200px) { .prc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Tarjeta */
.prc-card {
  position: relative; display: flex; flex-direction: column; text-align: left; width: 100%;
  background: var(--prc-surface); border: 1px solid var(--prc-line); border-radius: var(--prc-radius);
  box-shadow: var(--prc-shadow); overflow: hidden;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, border-color .22s ease;
  animation: prc-in .45s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}
.prc-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 2;
  background: linear-gradient(90deg, var(--prc-brand), var(--prc-accent));
  transform: scaleX(0); transform-origin: left; transition: transform .28s ease;
}
.prc-card:hover::before { transform: scaleX(1); }
@keyframes prc-in { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
.prc-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(23,19,15,.06), 0 20px 36px -16px rgba(23,19,15,.38); border-color: #d8cfba; }
.prc-card:active { transform: scale(.985); }
.prc-card-media {
  position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 12%;
  background:
    radial-gradient(60% 60% at 50% 55%, rgba(122,18,32,.09), transparent 70%),
    linear-gradient(180deg, #fbf8f1, #f1ebdd);
}
.prc-card-media img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(23,19,15,.24)); transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.prc-card:hover .prc-card-media img { transform: rotate(6deg) scale(1.04); }
.prc-card-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.prc-card-title { font-size: 15px; font-weight: 800; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.prc-card-sub { font-size: 12.5px; color: var(--prc-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prc-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 9px; border-top: 1px dashed var(--prc-line); }
.prc-price { font-weight: 800; font-size: 14.5px; letter-spacing: -0.005em; color: var(--prc-brand); }
.prc-more { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 10px; background: var(--prc-bg); color: var(--prc-ink); flex: none; transition: background .18s ease, color .18s ease; }
.prc-more svg { width: 16px; height: 16px; }
.prc-card:hover .prc-more { background: var(--prc-ink); color: var(--prc-accent); }

/* Badges */
.prc-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 5px; z-index: 3; pointer-events: none; }
.prc-badge { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.18); }
.prc-badge-nueva { background: var(--prc-ink); }
.prc-badge-top { background: var(--prc-accent); color: #241d05; }
.prc-badge-picante { background: var(--prc-brand); }
.prc-badge-vegetariana { background: #2f6e44; }
.prc-badge-sin-gluten { background: #6b5316; }

/* Vacío */
.prc-empty { padding: 48px 20px; text-align: center; color: var(--prc-muted); }
.prc-empty strong { display: block; color: var(--prc-ink); font-size: 18px; margin-bottom: 6px; }

/* ---------- Modal ---------- */
.prc-modal {
  position: fixed; inset: 0; z-index: 99999; display: none; font-family: var(--prc-font); color: var(--prc-ink);
  --prc-bg: #f4efe4; --prc-surface: #fff; --prc-ink: #17130f; --prc-muted: #756c5e; --prc-line: #e6dfd0;
  --prc-brand: #7a1220; --prc-brand-ink: #fff; --prc-accent: #c9a227; --prc-radius: 16px;
}
.prc-modal.is-open { display: block; }
.prc-modal *, .prc-modal *::before, .prc-modal *::after { box-sizing: border-box; }
.prc-modal button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; margin: 0; }
.prc-modal :focus-visible { outline: 3px solid var(--prc-accent); outline-offset: 2px; border-radius: 8px; }
.prc-backdrop { position: absolute; inset: 0; background: rgba(12, 9, 7, .68); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: prc-fade .25s ease both; }
@keyframes prc-fade { from { opacity: 0 } to { opacity: 1 } }

.prc-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--prc-surface); border-radius: 24px 24px 0 0; overflow: hidden;
  box-shadow: 0 -10px 44px rgba(0,0,0,.35);
  animation: prc-up .38s cubic-bezier(.2,.8,.2,1) both;
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes prc-up { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }
.prc-modal.is-closing .prc-sheet { animation: prc-down .22s ease both; }
.prc-modal.is-closing .prc-backdrop { animation: prc-fade .22s ease reverse both; }
@keyframes prc-down { to { transform: translateY(40px); opacity: 0 } }

.prc-grabber { width: 44px; height: 5px; border-radius: 3px; background: var(--prc-line); margin: 10px auto 0; flex: none; }
.prc-close {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 12px;
  background: rgba(23,19,15,.55); display: grid; place-items: center; color: #fbf7ee; backdrop-filter: blur(4px);
}
.prc-close:hover { background: var(--prc-ink); }
.prc-close svg { width: 18px; height: 18px; }

.prc-sheet-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1; }
.prc-sheet-inner { display: flex; flex-direction: column; }

/* Diagrama */
.prc-figure {
  position: relative; padding: 20px 20px 12px;
  background:
    radial-gradient(75% 65% at 50% 38%, rgba(201,162,39,.14), transparent 70%),
    linear-gradient(180deg, var(--prc-dark, #17130f), #2a2119 60%, #34291d 100%);
}
.prc-pizza-wrap { position: relative; width: min(100%, 320px); aspect-ratio: 1; margin: 0 auto; }
.prc-pizza-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 26px rgba(0,0,0,.45)); }
.prc-slices { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.prc-slice { fill: rgba(255,255,255,0); stroke: rgba(255,255,255,.7); stroke-width: 1.4; cursor: pointer; transition: fill .2s ease; }
.prc-slice:hover, .prc-slice.is-active { fill: rgba(201,162,39,.3); }
.prc-slice-marker { pointer-events: none; }
.prc-slice-marker circle { fill: #fbf7ee; stroke: var(--prc-ink); stroke-width: 2; transition: fill .2s ease, transform .2s ease; transform-box: fill-box; transform-origin: center; }
.prc-slice-marker text { fill: var(--prc-ink); font-size: 11px; font-weight: 800; text-anchor: middle; dominant-baseline: central; font-family: var(--prc-font); }
.prc-slice-marker.is-active circle { fill: var(--prc-accent); transform: scale(1.18); }
.prc-figure-hint { text-align: center; font-size: 12px; color: rgba(251,247,238,.65); margin: 12px 0 0; }

/* Cuerpo del modal */
.prc-body { padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.prc-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.prc-title { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.prc-subtitle { margin: 4px 0 0; color: var(--prc-muted); font-size: 14px; font-weight: 600; }
.prc-price-lg { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; color: var(--prc-brand); }
.prc-desc { margin: 0; font-size: 15px; color: #3d3733; }

.prc-ings { display: flex; flex-direction: column; gap: 8px; }
.prc-label { font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--prc-muted); margin: 0; }
.prc-ing-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.prc-ing {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px 7px 7px; border-radius: 999px;
  background: var(--prc-bg); border: 1px solid var(--prc-line); font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: all .18s ease;
}
.prc-ing:hover, .prc-ing.is-active { border-color: var(--prc-brand); background: #fff; box-shadow: 0 0 0 3px rgba(122,18,32,.1); }
.prc-ing-n { width: 22px; height: 22px; border-radius: 50%; background: var(--prc-ink); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; flex: none; }
.prc-ing.is-active .prc-ing-n { background: var(--prc-brand); }

.prc-story {
  position: relative; padding: 16px 18px 16px 22px; border-radius: 14px;
  background: linear-gradient(135deg, var(--prc-dark, #17130f), #2a2119);
}
.prc-story::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--prc-accent); }
.prc-story-head { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--prc-accent); }
.prc-story-head svg { width: 16px; height: 16px; }
.prc-story p { margin: 0; font-size: 15px; line-height: 1.6; color: #f1e9d6; }

.prc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.prc-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--prc-muted); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--prc-line); }
.prc-tag .prc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--prc-muted); }
.prc-tag-vegetariana .prc-dot { background: #2f6e44; }
.prc-tag-picante .prc-dot { background: var(--prc-brand); }
.prc-tag-sin-gluten .prc-dot { background: var(--prc-accent); }
.prc-tag-nueva .prc-dot { background: var(--prc-ink); }
.prc-tag-top .prc-dot { background: var(--prc-accent); }

.prc-nav { display: flex; justify-content: space-between; gap: 10px; padding-top: 6px; border-top: 1px solid var(--prc-line); margin-top: 4px; }
.prc-nav button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 700; color: var(--prc-muted); max-width: 48%; }
.prc-nav button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prc-nav button:hover { background: var(--prc-bg); color: var(--prc-ink); }
.prc-nav svg { width: 16px; height: 16px; flex: none; }

/* Escritorio: diálogo centrado a dos columnas */
@media (min-width: 760px) {
  .prc-sheet {
    left: 50%; top: 50%; bottom: auto; right: auto; width: min(880px, calc(100vw - 48px));
    max-height: min(680px, calc(100vh - 48px)); border-radius: 24px;
    transform: translate(-50%, -50%);
    animation: prc-pop .32s cubic-bezier(.2,.8,.2,1) both;
  }
  @keyframes prc-pop { from { transform: translate(-50%, -46%) scale(.97); opacity: 0 } to { transform: translate(-50%, -50%) scale(1); opacity: 1 } }
  .prc-modal.is-closing .prc-sheet { animation: prc-pop .2s ease reverse both; }
  .prc-grabber { display: none; }
  .prc-sheet-inner { flex-direction: row; min-height: 100%; }
  .prc-figure { flex: 0 0 46%; display: flex; flex-direction: column; justify-content: center; padding: 34px 28px; }
  .prc-pizza-wrap { width: min(100%, 340px); }
  .prc-body { flex: 1; padding: 34px 32px 28px; }
  .prc-title { font-size: 29px; }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .prc-app *, .prc-modal * { animation: none !important; transition: none !important; }
}

/* Bloqueo de scroll en body al abrir modal */
body.prc-lock { overflow: hidden; }
