/* Muestrario de Proveedores */
.pv-watermark {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.pv-watermark span {
  color: var(--color-neutral);
  opacity: 0.14;
  font-family: var(--font-body);
  font-size: clamp(16px, min(4.5vw, 8vh), 80px);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transform: rotate(-30deg);
}

.pv-hero {
  padding-top: 160px;
  padding-bottom: 48px;
  text-align: center;
}
.pv-hero h1 {
  font-size: clamp(40px, 5vw, 60px);
  color: var(--color-primary);
  font-style: italic;
  margin-bottom: 20px;
}
.pv-hero h1 span { font-style: normal; font-weight: 600; }
.pv-hero p {
  max-width: 560px;
  margin: 0 auto;
  font-size: 17px;
  opacity: 0.85;
}

/* Toolbar */
.pv-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  background-color: rgba(251, 248, 242, 0.92);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(124, 148, 115, 0.15);
}
.pv-toolbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px var(--margin-desktop);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pv-filters-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.pv-search { flex: 2 1 260px; position: relative; }
.pv-node { flex: 1 1 160px; }
.pv-search input, .pv-node select {
  margin-bottom: 0;
  padding: 10px 0;
  font-size: 14px;
}
.pv-search input { padding-left: 28px; }
.pv-search svg {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-primary);
}
.pv-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.pv-chips::-webkit-scrollbar { display: none; }
.pv-chip {
  flex-shrink: 0;
  background: transparent;
  color: var(--color-primary);
  border: 1px solid rgba(124, 148, 115, 0.5);
  border-radius: 9999px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.pv-chip:hover { background-color: rgba(124, 148, 115, 0.1); }
.pv-chip.active {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.pv-chip .count { opacity: 0.7; margin-left: 6px; }

/* Rubro sections */
.pv-main { max-width: 1200px; margin: 0 auto; padding: 56px var(--margin-desktop) 100px; }
.pv-rubro { margin-bottom: 72px; scroll-margin-top: 200px; }
.pv-rubro-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(124, 148, 115, 0.2);
}
.pv-rubro-head svg { width: 32px; height: 32px; color: var(--color-primary); flex-shrink: 0; }
.pv-rubro-head h2 { font-size: 34px; color: var(--color-primary); margin: 0; flex-grow: 1; }
.pv-rubro-head .label-sm { color: var(--color-neutral); opacity: 0.6; }

.pv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}
.pv-card {
  background-color: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.pv-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px -15px rgba(63, 81, 56, 0.15);
}
.pv-cover {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-bg) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.pv-cover img { width: 100%; height: 100%; object-fit: cover; }
.pv-initials {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 56px;
  color: var(--color-primary);
  letter-spacing: 0.04em;
}
.pv-node-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: rgba(251, 248, 242, 0.92);
  color: var(--color-neutral);
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.pv-body { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
.pv-body h3 { font-size: 24px; color: var(--color-primary); margin-bottom: 10px; }
.pv-body p { font-size: 14px; opacity: 0.8; margin: 0 0 20px; flex-grow: 1; }
.pv-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pv-actions .btn-primary { padding: 10px 20px; }
.pv-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(124, 148, 115, 0.5);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.pv-icon-btn:hover { background-color: var(--color-primary); color: #fff; }
.pv-icon-btn svg { width: 18px; height: 18px; }

.pv-empty { text-align: center; padding: 80px 0; display: none; }
.pv-empty h3 { font-size: 32px; color: var(--color-primary); font-style: italic; }

.pv-cta {
  background-color: var(--color-secondary);
  border-radius: 40px;
  padding: 64px 32px;
  text-align: center;
  margin-top: 40px;
}
.pv-cta h2 { font-size: 40px; color: var(--color-neutral); font-style: italic; margin-bottom: 16px; }
.pv-cta p { max-width: 520px; margin: 0 auto 32px; opacity: 0.9; }

@media (max-width: 768px) {
  .pv-hero { padding-top: 120px; }
  .pv-toolbar { top: 62px; }
  .pv-toolbar-inner { padding: 14px var(--margin-mobile); }
  .pv-main { padding: 40px var(--margin-mobile) 80px; }
  .pv-rubro-head h2 { font-size: 26px; }
  .pv-cta { border-radius: 24px; }
}

/* Tarjeta clicable */
.pv-card { cursor: pointer; }
.pv-card:focus-visible { outline: 2px solid var(--color-tertiary); outline-offset: 3px; }

/* Modal de proveedor */
.pv-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(63, 81, 56, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pv-modal[hidden] { display: none; }
.pv-modal.open { opacity: 1; }
.pv-modal-card {
  position: relative;
  background: var(--color-bg);
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  border-radius: 0.5rem 40px 0.5rem 40px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(63, 81, 56, 0.4);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.35s ease;
}
.pv-modal.open .pv-modal-card { transform: none; }
.pv-modal-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  max-height: 90vh;
}
.pv-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(251, 248, 242, 0.92);
  color: var(--color-neutral);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.pv-close:hover { background: var(--color-primary); color: #fff; }

/* Slider */
.pv-slider { position: relative; background: var(--color-secondary); min-height: 420px; }
.pv-slider-empty { display: flex; align-items: center; justify-content: center; }
.pv-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.pv-track::-webkit-scrollbar { display: none; }
.pv-slide { flex: 0 0 100%; scroll-snap-align: center; height: 100%; }
.pv-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(251, 248, 242, 0.9);
  color: var(--color-primary);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.pv-arrow:hover { background: var(--color-primary); color: #fff; }
.pv-arrow.prev { left: 14px; }
.pv-arrow.next { right: 14px; }
.pv-dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.pv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(251, 248, 242, 0.6);
  transition: width 0.3s ease, background-color 0.3s ease;
}
.pv-dot.active { width: 24px; border-radius: 9999px; background: #fff; }

/* Info */
.pv-info {
  padding: 48px 40px 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.pv-logo {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  width: 64px;
  height: 64px;
  box-sizing: border-box;
  padding: 4px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--color-bg);
  box-shadow: 0 4px 16px rgba(63, 81, 56, 0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  color: var(--color-primary);
}
.pv-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.pv-info h2 { font-size: 40px; color: var(--color-primary); margin: 4px 0 8px; }
.pv-info p { opacity: 0.85; margin: 0 0 20px; font-size: 15px; }
.pv-modal-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: auto; }
.pv-modal-actions a { gap: 10px; width: 100%; box-sizing: border-box; }
.pv-modal-actions svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Móvil: hoja inferior */
@media (max-width: 768px) {
  .pv-modal { padding: 0; align-items: flex-end; }
  .pv-modal-card {
    max-width: none;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    overflow-y: auto;
    transform: translateY(100%);
  }
  .pv-modal-body { grid-template-columns: 1fr; max-height: none; }
  .pv-slider { min-height: 0; aspect-ratio: 4/3; }
  .pv-logo { top: 14px; left: 14px; width: 56px; height: 56px; font-size: 21px; }
  .pv-info { padding: 28px 24px 32px; overflow: visible; }
  .pv-info h2 { font-size: 32px; }
  .pv-arrow { width: 36px; height: 36px; }
}

/* Vista de rubros */
a.pv-rubro-card { text-decoration: none; color: inherit; cursor: pointer; }
.pv-rubro-count {
  margin-top: auto;
  padding-top: 20px;
  color: var(--color-primary);
}
.pv-rubro-count span { display: inline-block; transition: transform 0.3s ease; }
.pv-rubro-card:hover .pv-rubro-count span { transform: translateX(6px); }
.pv-rubro-card:focus-visible { outline: 2px solid var(--color-tertiary); outline-offset: 3px; }

/* Vista de un rubro */
.pv-hero-rubro { padding-bottom: 32px; }
.pv-back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 18px;
  border: 1px solid var(--color-neutral);
  border-radius: 999px;
  background-color: var(--color-bg);
  color: var(--color-neutral);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.pv-back svg { width: 20px; height: 20px; flex-shrink: 0; }
.pv-back:hover { background-color: var(--color-neutral); color: var(--color-bg); }
.pv-back:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
.pv-count { margin-left: auto; color: var(--color-neutral); opacity: 0.6; padding-bottom: 12px; }
#pv-view-rubro[hidden], #pv-view-home[hidden] { display: none; }
@media (max-width: 768px) { .pv-count { margin-left: 0; width: 100%; padding-bottom: 0; } }

/* Tarjeta: logo y "Ver más" */
.pv-card-logo {
  position: absolute;
  right: 16px;
  bottom: -28px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  background: #fff;
  box-shadow: 0 8px 20px -6px rgba(63, 81, 56, 0.3);
  z-index: 2;
}
.pv-card-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-cover { overflow: visible; }
.pv-cover > img { border-radius: 0; }
.pv-more { margin-top: auto; color: var(--color-primary); }
.pv-more span { display: inline-block; transition: transform 0.3s ease; }
.pv-card:hover .pv-more span { transform: translateX(6px); }
.pv-card .pv-body { padding-top: 36px; }
.pv-card { overflow: visible; }
.pv-cover { border-radius: 0.5rem 0.5rem 0 0; }
.pv-cover > img { border-radius: 0.5rem 0.5rem 0 0; }

/* Servicios (viñetas) */
.pv-services { margin: 4px 0 20px; }
.pv-services .label-sm { display: block; color: var(--color-primary); margin-bottom: 10px; }
.pv-services ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pv-services li {
  position: relative;
  padding-left: 22px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-neutral);
  opacity: 0.9;
}
.pv-services li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-tertiary);
  box-shadow: 0 0 0 3px rgba(217, 192, 139, 0.25);
}
.pv-card .pv-services { margin-bottom: 24px; }
.pv-card .pv-body > p { flex-grow: 0; margin-bottom: 16px; }

/* El modal se anima con GSAP: se anulan las transiciones CSS previas */
.pv-modal { opacity: 1; transition: none; }
.pv-modal-card { transform: none; transition: none; }

/* Ficha: altura definida para que nunca se corten los botones */
@media (min-width: 769px) {
  .pv-modal-card { height: min(86vh, 700px); max-height: none; }
  @supports (height: 1dvh) { .pv-modal-card { height: min(86dvh, 700px); } }
  .pv-modal-body { height: 100%; max-height: none; grid-template-rows: minmax(0, 1fr); }
  .pv-slider { min-height: 0; height: 100%; }
  .pv-info { min-height: 0; overflow-y: auto; padding-bottom: 0; scrollbar-width: thin; }
  .pv-modal-actions {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding: 16px 0 28px;
    background: linear-gradient(to bottom, rgba(251, 248, 242, 0), var(--color-bg) 22%);
  }
}
@media (max-width: 768px) {
  @supports (height: 1dvh) { .pv-modal-card { max-height: 92dvh; } }
  .pv-modal-card { overscroll-behavior: contain; }
  .pv-info { padding-bottom: 40px; }
}
