/* Catálogo público afiliado */
body.af-cat-standalone {
  margin: 0;
  min-height: 100vh;
  background: #f5f5f5;
}
body.af-cat-standalone.site-public::before,
body.af-cat-standalone .site-bg-layer {
  display: none !important;
}
.af-cat-page { position: relative; min-height: 100vh; padding: 16px 0 40px; }
.af-cat-page__bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.96));
}
.af-cat-page.af-cat-bg--clasico .af-cat-page__bg { background: linear-gradient(180deg, rgba(248,244,236,.95), rgba(255,255,255,.98)); }
.af-cat-page.af-cat-bg--elegante .af-cat-page__bg { background: linear-gradient(180deg, rgba(26,26,46,.08), rgba(255,255,255,.96)); }
.af-cat-page.af-cat-bg--moderno .af-cat-page__bg { background: linear-gradient(180deg, rgba(227,242,253,.9), rgba(255,255,255,.98)); }
.af-cat-page.af-cat-bg--natural .af-cat-page__bg { background: linear-gradient(180deg, rgba(232,245,233,.92), rgba(255,255,255,.98)); }
.af-cat-page.af-cat-bg--custom .af-cat-page__bg {
  background-color: #111;
  background-image: var(--af-cat-custom-bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 1;
}
.af-cat-shell { position: relative; z-index: 1; }
.af-cat-breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.82rem; margin: 16px 0; color: #666; }
.af-cat-breadcrumb a { color: inherit; text-decoration: none; }
.af-cat-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px 22px;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  margin-bottom: 20px;
}
.af-cat-hero__brand {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
  background: #f8f9fb;
  border: 1px solid #eceff3;
  border-radius: 14px;
}
.af-cat-hero__logo {
  width: 85%;
  height: 85%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.af-cat-hero__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  align-self: center;
  text-align: left;
}
.af-cat-hero__text h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.8vw, 1.65rem);
  line-height: 1.2;
  color: #1a1a2e;
  text-align: left;
  width: 100%;
}
.af-cat-hero__rubro {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #6b7280;
  letter-spacing: .02em;
  font-weight: 500;
  text-align: left;
  width: 100%;
}
.af-cat-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 16px;
  margin-top: 8px;
  width: 100%;
}
.af-cat-hero__visits {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.af-cat-hero__status { margin: 0; font-size: 0.85rem; font-weight: 600; }
.af-cat-hero__status--open { color: #2e7d32; }
.af-cat-hero__status--closed { color: #c62828; }
.af-cat-hero__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-self: center;
  justify-content: flex-end;
}

.af-cat-hero__actions .afiliado-qr-btn i {
  margin-right: 4px;
}
.af-cat-toolbar { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; margin-bottom: 18px; }
.af-cat-toolbar--acordeon { grid-template-columns: 1fr auto; }
.af-cat-toolbar--acordeon .af-cat-input--combo-cat { display: none; }
.af-cat-page--searching .af-cat-input--combo-cat { display: none; }
.af-cat-input {
  padding: 10px 12px; border: 1px solid #ddd; border-radius: 10px; background: #fff; font-size: 0.92rem;
}
.af-cat-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.af-cat-layout > * { min-width: 0; }
.af-cat-layout--sin-pedido { grid-template-columns: 1fr; }
.af-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
#af-cat-grid[hidden],
#af-cat-accordion[hidden] {
  display: none !important;
}
.af-cat-block {
  background: #fff;
  border-radius: 14px;
  padding: 16px 16px 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.af-cat-block__title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
  text-align: left;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}
.af-cat-blocks { display: flex; flex-direction: column; gap: 16px; }
.af-cat-accordion { display: flex; flex-direction: column; gap: 22px; }
.af-cat-accordion__item {
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}
.af-cat-accordion__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.af-cat-accordion__head:hover { background: #fafafa; }
.af-cat-accordion__title { flex: 1; font-weight: 700; font-size: 1rem; color: #1a1a2e; }
.af-cat-accordion__count {
  font-size: 0.78rem; color: #888; background: #f3f3f3; border-radius: 999px;
  padding: 2px 10px; min-width: 1.5rem; text-align: center;
}
.af-cat-accordion__icon { color: #999; transition: transform .2s; font-size: 0.85rem; }
.af-cat-accordion__item.is-open .af-cat-accordion__icon { transform: rotate(180deg); }
.af-cat-accordion__body {
  display: none;
  padding: 14px 0 0;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.af-cat-accordion__body.is-open {
  display: grid;
}
.af-cat-card {
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.06);
  display: flex; flex-direction: column;
}
.af-cat-card__media {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: #f3f3f3;
}
.af-cat-card__img {
  position: absolute;
  inset: auto;
  left: 0;
  top: 50%;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
  object-fit: cover;
  object-position: center center;
  display: block;
}
.af-cat-card__ph { height: 160px; display: grid; place-items: center; background: #f3f3f3; color: #bbb; font-size: 2rem; }
.af-cat-card__body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.af-cat-card__tipo { font-size: 0.7rem; text-transform: uppercase; color: #999; }
.af-cat-card h3 { margin: 0; font-size: 1rem; }
.af-cat-card__attrs, .af-cat-card__desc { font-size: 0.82rem; color: #666; margin: 0; }
.af-cat-card__price { color: var(--color-brand-gold, #c9a227); font-weight: 700; margin: 0; }
.af-cat-card .dir-btn { margin-top: auto; align-self: center; }
.af-cat-cart {
  position: sticky; top: 16px; background: #fff; border-radius: 14px; padding: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  min-width: 0;
  box-sizing: border-box;
}
.af-cat-cart h2 { margin: 0 0 12px; font-size: 1.05rem; }
.af-cat-cart label { display: block; margin-bottom: 6px; font-size: 0.88rem; }
.af-cat-cart__list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 280px; overflow: auto; }
.af-cat-cart__item { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eee; font-size: 0.88rem; }
.af-cat-cart__qty { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.af-cat-cart__qty button {
  width: 26px; height: 26px; border: 1px solid #ddd; border-radius: 6px; background: #fafafa; cursor: pointer;
}
.af-cat-cart__total { margin: 0 0 10px; }
.af-cat-cart textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
  resize: vertical;
  font: inherit;
}
.af-cat-cart__wa { width: 100%; justify-content: center; }
.af-cat-cart__wa:disabled { opacity: .55; cursor: not-allowed; }
.af-cat-cart__hint { font-size: 0.8rem; color: #c62828; margin: 8px 0 0; }
.af-cat-empty { text-align: center; color: #888; padding: 24px; }

/* Vista carta / PDF (?imprimir=1) — formato A4 */
.af-cat-page--print {
  padding: 16px 12px 28px;
  background: transparent;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.af-cat-page--print .af-cat-shell {
  max-width: 210mm;
  margin: 0 auto;
}
.af-cat-page--print .af-cat-page__bg {
  display: block;
  opacity: 1;
}
.af-cat-print-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 210mm;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.9);
  padding: 14mm 13mm 12mm;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.1);
  color: #1a1a2e;
  box-sizing: border-box;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.af-cat-print-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--color-brand-gold, #c9a227);
}
.af-cat-print-header__logo-wrap {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px solid #eceff3;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
}
.af-cat-print-header__logo {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}
.af-cat-print-header__text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.af-cat-print-header__text h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
  color: #1a1a2e;
  text-align: left;
}
.af-cat-print-header__rubro {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: #6b7280;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: left;
}
.af-cat-print-header__horario {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: #2e7d32;
  font-weight: 600;
  text-align: left;
}
.af-cat-print-sections { min-height: 80px; }
.af-cat-print-loading,
.af-cat-print-empty {
  text-align: center;
  color: #888;
  padding: 24px 12px;
  margin: 0;
}
.af-cat-print-section + .af-cat-print-section { margin-top: 12px; }
.af-cat-print-section__title {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1a2e;
  text-align: left;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
}
.af-cat-print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}
.af-cat-print-card {
  display: flex;
  flex-direction: column;
  padding: 7px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  break-inside: avoid;
  page-break-inside: avoid;
}
.af-cat-print-card__img-wrap {
  position: relative;
  margin-bottom: 5px;
  height: 96px;
  overflow: hidden;
  border-radius: 6px;
}
.af-cat-print-card__img-wrap img {
  position: absolute;
  inset: auto;
  left: 0;
  top: 50%;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
  object-fit: cover;
  object-position: center center;
  border-radius: 6px;
  display: block;
  border: 1px solid #eee;
}
.af-cat-print-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.af-cat-print-card__name {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.af-cat-print-card__price {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-brand-gold, #b8941f);
}
.af-cat-print-card__attrs,
.af-cat-print-card__desc {
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.25;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.af-cat-print-footer {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  text-align: left;
  font-size: 0.72rem;
  color: #6b7280;
}
.af-cat-print-footer p { margin: 0 0 3px; }
.af-cat-print-footer__url { font-size: 0.65rem; color: #9ca3af; word-break: break-all; }

@media (max-width: 900px) {
  .af-cat-layout, .af-cat-layout--sin-pedido { grid-template-columns: 1fr; }
  .af-cat-cart { position: static; }
  .af-cat-toolbar, .af-cat-toolbar--acordeon { grid-template-columns: 1fr; }
  .af-cat-hero {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand text"
      "actions actions";
  }
  .af-cat-hero__brand { grid-area: brand; }
  .af-cat-hero__text { grid-area: text; }
  .af-cat-hero__actions {
    grid-area: actions;
    justify-content: flex-start;
    width: 100%;
    padding-top: 4px;
    border-top: 1px solid #f0f0f0;
  }
}
@media (max-width: 520px) {
  .af-cat-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "text"
      "actions";
  }
  .af-cat-hero__brand { margin: 0; justify-self: start; }
  .af-cat-hero__text { align-items: flex-start; text-align: left; }
  .af-cat-hero__meta { justify-content: flex-start; }
  .af-cat-hero__actions { justify-content: flex-start; }
}
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
  body.af-cat-standalone {
    background: transparent !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .af-cat-page--print {
    padding: 0 !important;
    background: transparent !important;
    min-height: auto;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .af-cat-page--print .af-cat-shell {
    max-width: none;
    width: 100%;
  }
  .af-cat-page--print .af-cat-page__bg {
    display: block !important;
    position: fixed;
    inset: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .af-cat-print-sheet {
    width: 100%;
    max-width: 190mm;
    margin: 0 auto;
    padding: 10mm 11mm;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.88);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .af-cat-print-section {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }
  .af-cat-print-card {
    break-inside: avoid;
    page-break-inside: avoid;
    background: rgba(255, 255, 255, 0.96);
  }
}
