.flm-menu {
  --flm-bg: #fffdf7;
  --flm-paper: #ffffff;
  --flm-paper-warm: #fff8ec;
  --flm-text: #1f1b18;
  --flm-muted: #6f655c;
  --flm-line: rgba(116, 93, 68, 0.18);
  --flm-accent: #c69a27;
  --flm-accent-dark: #745011;
  --flm-red: #8f1f17;
  --flm-red-soft: #fff0ec;
  --flm-shadow: 0 18px 50px rgba(25, 20, 15, 0.10);
  --flm-radius: 22px;

  font-family: Arial, Helvetica, sans-serif;
  color: var(--flm-text);
  line-height: 1.55;
}

.flm-menu,
.flm-menu * {
  box-sizing: border-box;
}

.flm-menu button {
  font: inherit;
}

.flm-menu h2,
.flm-menu h3,
.flm-menu p {
  margin-top: 0;
}

.flm-menu__inner {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 38px;
}

.flm-menu__loading,
.flm-empty {
  width: min(1120px, calc(100% - 28px));
  margin: 24px auto;
  padding: 18px;
  background: var(--flm-paper-warm);
  border: 1px solid var(--flm-line);
  border-radius: 16px;
  color: var(--flm-muted);
}

.flm-menu__topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.flm-menu__title {
  margin: 0 0 20px;
  font-size: clamp(30px, 6vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.flm-language,
.flm-super-tabs,
.flm-category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.flm-language {
  padding: 5px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--flm-line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(24, 18, 12, 0.06);
}

.flm-language__button,
.flm-super-tabs__button,
.flm-category-nav__chip {
  appearance: none;
  cursor: pointer;
  border: 0;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.flm-language__button {
  min-width: 44px;
  padding: 8px 13px;
  border-radius: 999px;
  background: transparent;
  color: var(--flm-muted);
  font-size: 13px;
  font-weight: 800;
}

.flm-language__button.is-active {
  color: #ffffff;
  background: var(--flm-red);
}

.flm-super-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 8px;
  margin: 0 0 14px;
  background: rgba(255, 253, 247, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid var(--flm-line);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(24, 18, 12, 0.08);
}

.flm-super-tabs__button {
  flex: 1 0 auto;
  min-width: min(220px, 44vw);
  padding: 13px 18px;
  border-radius: 999px;
  color: var(--flm-text);
  background: transparent;
  font-size: 15px;
  font-weight: 900;
}

.flm-super-tabs__button.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--flm-red), #5f130f);
  box-shadow: 0 8px 18px rgba(143, 31, 23, 0.25);
}

.flm-category-nav {
  margin: 0 0 20px;
  padding: 2px 0 8px;
}

.flm-category-nav__chip {
  padding: 9px 14px;
  border: 1px solid var(--flm-line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--flm-muted);
  font-size: 13px;
  font-weight: 800;
}

.flm-category-nav__chip:hover,
.flm-language__button:hover,
.flm-super-tabs__button:hover {
  transform: translateY(-1px);
}

.flm-menu__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.flm-category {
  scroll-margin-top: 92px;
  overflow: hidden;
  background: var(--flm-paper);
  border: 1px solid var(--flm-line);
  border-radius: var(--flm-radius);
  box-shadow: var(--flm-shadow);
}

.flm-category__content {
  padding: clamp(22px, 4vw, 34px);
}

.flm-category__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.flm-category__icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: var(--flm-red);
  background: var(--flm-red-soft);
  border: 1px solid rgba(143, 31, 23, 0.14);
  font-size: 20px;
}

.flm-category h3 {
  margin: 0;
  color: var(--flm-text);
  font-size: clamp(21px, 4vw, 30px);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.flm-category__line {
  display: block;
  width: 58px;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--flm-red), var(--flm-accent));
}

.flm-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.flm-item {
  display: block;
  padding: 15px 0;
  border-bottom: 1px dashed var(--flm-line);
}

.flm-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.flm-item__body {
  min-width: 0;
}

.flm-item__title-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 12px;
}

.flm-item__title-main {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.flm-item__name {
  display: inline-block;
  max-width: 100%;
  color: var(--flm-text);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-transform: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.flm-item__name-button {
  appearance: none;
  display: inline;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}


/* Reset fuerte: evita que el tema de WordPress convierta a mayúsculas
   los nombres de productos cuando el nombre es botón por tener imagen. */
.flm-menu .flm-item__name-button,
.flm-menu .flm-item__name-button:hover,
.flm-menu .flm-item__name-button:focus,
.flm-menu .flm-item__name-button:active {
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.3 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  color: var(--flm-text) !important;
  background: transparent !important;
  box-shadow: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border-radius: 0 !important;
}

.flm-item__name-button:focus-visible {
  outline: 2px solid rgba(143, 31, 23, 0.28);
  outline-offset: 4px;
  border-radius: 6px;
}

.flm-item__description {
  margin: 5px 0 0;
  max-width: 780px;
  color: var(--flm-muted);
  font-size: 13px;
  line-height: 1.45;
}

.flm-item__dots {
  display: none;
}

.flm-item__price {
  align-self: start;
  padding-left: 8px;
  color: var(--flm-red);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

.flm-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  color: #ffffff;
  background: var(--flm-accent-dark);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flm-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.flm-item__tags span {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
  padding: 2px 7px;
  color: var(--flm-red);
  background: var(--flm-red-soft);
  border: 1px solid rgba(143, 31, 23, 0.12);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.flm-price-options {
  width: min(100%, 420px);
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.flm-price-options__title {
  display: block;
  color: var(--flm-accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flm-price-options__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 10px;
  background: var(--flm-paper-warm);
  border: 1px solid var(--flm-line);
  border-radius: 12px;
  font-size: 13px;
}

.flm-price-options__row span {
  color: var(--flm-muted);
}

.flm-price-options__row strong {
  color: var(--flm-red);
  white-space: nowrap;
}

.flm-allergen-image {
  margin-top: 28px;
  padding: clamp(18px, 4vw, 28px);
  background: var(--flm-paper);
  border: 1px solid var(--flm-line);
  border-radius: var(--flm-radius);
  box-shadow: var(--flm-shadow);
}

.flm-allergen-image__text h3 {
  margin: 0 0 6px;
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 900;
}

.flm-allergen-image__text p {
  margin: 0 0 16px;
  color: var(--flm-muted);
  font-size: 14px;
}

.flm-allergen-image img {
  display: block;
  width: min(100%, 720px);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--flm-line);
  border-radius: 14px;
  background: #ffffff;
}

.flm-modal[hidden] {
  display: none;
}

.flm-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 18px;
}

.flm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 7, 0.68);
  backdrop-filter: blur(6px);
}

.flm-modal__panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 520px);
  max-height: min(72vh, 640px);
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

.flm-modal__image {
  display: block;
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  border-radius: 16px;
  background: var(--flm-paper-warm);
}

.flm-modal__title {
  display: block;
  padding: 0 6px 4px;
  color: var(--flm-text);
  font-size: 15px;
  text-align: center;
}

.flm-modal__close {
  position: absolute;
  top: -12px;
  right: -10px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--flm-red);
  color: #ffffff;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.flm-modal-open {
  overflow: hidden;
}

.flm-menu--layout-two-columns .flm-menu__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flm-menu--layout-compact .flm-category__content {
  padding: 20px;
}

.flm-menu--layout-compact .flm-item {
  padding: 10px 0;
}

@media (min-width: 860px) {
  .flm-menu__inner {
    padding-top: 36px;
  }

  .flm-menu__grid {
    gap: 24px;
  }

  .flm-item {
    grid-template-columns: minmax(0, 1fr) 90px;
    gap: 8px 18px;
  }

  .flm-item__dots {
    display: block;
    grid-column: 1 / 3;
    grid-row: 1;
    align-self: end;
    height: 1px;
    margin-left: min(54%, 520px);
    margin-right: 96px;
    border-bottom: 1px dotted rgba(116, 93, 68, 0.28);
    pointer-events: none;
  }

  .flm-item__price {
    text-align: right;
  }
}

@media (max-width: 680px) {
  .flm-menu__inner {
    width: min(100% - 18px, 1120px);
    padding-top: 14px;
  }

  .flm-menu__topbar {
    justify-content: center;
  }

  .flm-super-tabs {
    top: 0;
    border-radius: 22px;
  }

  .flm-super-tabs__button {
    min-width: 48%;
    padding: 12px 14px;
    font-size: 14px;
  }

  .flm-category__content {
    padding: 20px 17px;
  }

  .flm-item {
    padding: 13px 0;
    gap: 5px 10px;
  }

  .flm-item__name {
    font-size: 14px;
  }

  .flm-item__description,
  .flm-price-options__row {
    font-size: 12px;
  }

  .flm-item__price {
    font-size: 14px;
  }

  .flm-modal__panel {
    width: min(92vw, 430px);
    max-height: 62vh;
  }

  .flm-modal__image {
    max-height: 50vh;
  }
}

@media (max-width: 420px) {
  .flm-category-nav__chip {
    font-size: 12px;
    padding: 8px 12px;
  }

  .flm-category h3 {
    font-size: 20px;
  }

  .flm-item__title-line {
    gap: 6px 10px;
  }

  .flm-item__price {
    margin-left: 6px;
  }
}

/* Fase 27A-F1: enlace al documento oficial de alérgenos */
.flm-allergen-image__pdf {
  display: inline-block;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.flm-allergen-legend {
  margin-top: 28px;
}
.flm-allergen-legend > summary {
  cursor: pointer;
  font-weight: 700;
}
.flm-allergen-legend__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 18px;
  margin-top: 12px;
}
.flm-allergen-legend__row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: baseline;
}
