/**
 * Catálogo embebido — estilos por defecto (.cfc-*).
 * Sobrescribe con variables CSS o con clases Webflow vía catalogo-config.js.
 */
:root {
  --cfc-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --cfc-radius: 12px;
  --cfc-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --cfc-border: 1px solid rgba(15, 23, 42, 0.08);
  --cfc-primary: #0f172a;
  --cfc-accent: #2563eb;
  --cfc-muted: #64748b;
  --cfc-surface: #ffffff;
  --cfc-bg: #f8fafc;
}

.cfc-catalogo {
  font-family: var(--cfc-font);
  color: var(--cfc-primary);
  box-sizing: border-box;
}

div#catalogo-app {
  grid-row-gap: 0px;
}

.cfc-catalogo *,
.cfc-catalogo *::before,
.cfc-catalogo *::after {
  box-sizing: border-box;
}

.cfc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.cfc-header-title {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cfc-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: var(--cfc-border);
  border-radius: var(--cfc-radius);
  background: var(--cfc-surface);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.cfc-cart-btn:hover {
  background: var(--cfc-bg);
}

.cfc-cart-btn:active {
  transform: scale(0.98);
}

.cfc-cart-btn svg {
  width: 22px;
  height: 22px;
}

.cfc-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--cfc-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cfc-badge.cfc-hidden {
  display: none;
}

.cfc-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 900px) {
  .cfc-body {
    flex-direction: row;
    align-items: flex-start;
  }
}

.cfc-sidebar-wrap {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.cfc-sidebar-wrap.cfc-sidebar-visible {
  display: flex;
}

@media (min-width: 900px) {
  .cfc-sidebar-wrap.cfc-sidebar-visible {
    flex-shrink: 0;
    width: 220px;
    position: sticky;
    top: 1rem;
  }
}

.cfc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  border: var(--cfc-border);
  border-radius: var(--cfc-radius);
  background: var(--cfc-surface);
  box-shadow: var(--cfc-shadow);
}

.cfc-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: var(--cfc-border);
  border-radius: 8px;
  background: var(--cfc-surface);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.cfc-filter-toggle:hover {
  background: var(--cfc-bg);
}

.cfc-filter-toggle svg {
  width: 20px;
  height: 20px;
}

.cfc-sidebar-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cfc-muted);
}

.cfc-promo-card {
  border-radius: var(--cfc-radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.cfc-promo-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--cfc-radius);
}

.cfc-asesor-card {
  padding: 1rem;
  border-radius: var(--cfc-radius);
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid rgba(37, 99, 235, 0.15);
  text-align: center;
}

.cfc-asesor-text {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--cfc-primary);
}

.cfc-asesor-sub {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--cfc-muted);
  line-height: 1.4;
}

.cfc-main {
  flex: 1;
  min-width: 0;
}

.cfc-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.cfc-search-input-wrap {
  flex: 1;
  min-width: 180px;
}

.cfc-search-input-wrap .cfc-input {
  width: 100%;
}

.cfc-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cfc-filter-group--wide {
  grid-column: 1 / -1;
}

.cfc-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cfc-muted);
}

.cfc-input,
.cfc-select,
textarea.cfc-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: var(--cfc-border);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: var(--cfc-surface);
  font-family: inherit;
  resize: vertical;
}

.cfc-input:focus,
.cfc-select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 0;
}

.cfc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

.cfc-toolbar label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--cfc-muted);
}

.cfc-toolbar select {
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: var(--cfc-border);
}

.cfc-grid-wrap{
  width: 100%;
}

.cfc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .cfc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cfc-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cfc-card {
  border: var(--cfc-border);
  border-radius: var(--cfc-radius);
  overflow: hidden;
  background: var(--cfc-surface);
  box-shadow: var(--cfc-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.cfc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
}

.cfc-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1e293b;
}

.cfc-card-thumb-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cfc-card-thumb-img.cfc-thumb-broken {
  display: none !important;
}

.cfc-card-thumb-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.3;
  word-break: break-word;
}

.cfc-modal-hero {
  margin: -1rem -1.25rem 1rem;
  border-radius: 0;
  overflow: hidden;
  background: #1e293b;
}

.cfc-modal-hero img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

.cfc-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cfc-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.cfc-card-sub {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--cfc-muted);
}

.cfc-card-price {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.cfc-price-promo {
  color: #059669;
  margin-right: 0.35rem;
}

.cfc-price-old {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cfc-muted);
  text-decoration: line-through;
}

.cfc-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: var(--cfc-border);
}

.cfc-page-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: var(--cfc-border);
  background: var(--cfc-surface);
  cursor: pointer;
  font-size: 0.875rem;
}

.cfc-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cfc-page-info {
  font-size: 0.875rem;
  color: var(--cfc-muted);
}

.cfc-loading,
.cfc-empty,
.cfc-error {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--cfc-muted);
}

.cfc-error {
  color: #b91c1c;
}

/* Modal */
.cfc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: cfc-fade-in 0.2s ease;
}

@media (min-width: 640px) {
  .cfc-modal-backdrop {
    align-items: center;
    padding: 1.5rem;
  }
}

@keyframes cfc-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cfc-modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  background: var(--cfc-surface);
  border-radius: var(--cfc-radius) var(--cfc-radius) 0 0;
  box-shadow: var(--cfc-shadow);
  animation: cfc-slide-up 0.25s ease;
}

@media (min-width: 640px) {
  .cfc-modal {
    border-radius: var(--cfc-radius);
  }
}

@keyframes cfc-slide-up {
  from {
    transform: translateY(100%);
    opacity: 0.9;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 640px) {
  @keyframes cfc-slide-up {
    from {
      transform: translateY(16px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

.cfc-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0;
}

.cfc-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.cfc-modal-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--cfc-muted);
}

.cfc-modal-close:hover {
  background: var(--cfc-bg);
  color: var(--cfc-primary);
}

.cfc-modal-body {
  padding: 1rem 1.25rem;
}

.cfc-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 0.9375rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.cfc-detail-row dt {
  color: var(--cfc-muted);
  font-weight: 500;
}

.cfc-detail-row dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.cfc-modal-footer {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cfc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: var(--cfc-border);
  background: var(--cfc-surface);
  transition: background 0.15s ease;
}

.cfc-btn:hover {
  background: var(--cfc-bg);
}

.cfc-btn-primary {
  background: var(--cfc-accent);
  color: #fff;
  border-color: transparent;
}

.cfc-btn-primary:hover {
  background: var(--cfc-primary);
}

.cfc-btn-secondary {
  background: var(--cfc-bg);
}

/* Cart drawer */
.cfc-cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cfc-cart-backdrop.cfc-open {
  opacity: 1;
  pointer-events: auto;
}

.cfc-cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10002;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--cfc-surface);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.15);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
}

.cfc-cart-panel.cfc-open {
  transform: translateX(0);
}

.cfc-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: var(--cfc-border);
}

.cfc-cart-head h2 {
  margin: 0;
  font-size: 1.125rem;
}

.cfc-cart-scroll {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.25rem;
}

.cfc-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: var(--cfc-border);
  font-size: 0.875rem;
}

.cfc-cart-item strong {
  display: block;
  margin-bottom: 0.25rem;
}

.cfc-cart-foot {
  padding: 1rem 1.25rem 1.5rem;
  border-top: var(--cfc-border);
  background: var(--cfc-bg);
}

.cfc-cart-form .cfc-form-row {
  margin-bottom: 0.75rem;
}

.cfc-form-row label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--cfc-muted);
}

.cfc-form-row input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: var(--cfc-border);
  font-size: 0.9375rem;
}

.cfc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.cfc-modal-open,
body.cfc-cart-open {
  overflow: hidden;
}

/* Lightbox — imagen a pantalla completa */
.cfc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10010;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: cfc-fade-in 0.2s ease;
  cursor: zoom-out;
}

.cfc-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.cfc-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cfc-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
