/* La Perfumería · Reseñas en la ficha. Misma card blanca que las pestañas (borde, radio 16, sombra),
   título en LP Display como "Así preparamos tu pedido", estrellas doradas, grises del sitio. */

.lp-resenas {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: clamp(20px, 2.4vw, 32px);
  border: 1px solid #dedfe2;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--gds-shadow, rgba(0, 0, 0, 0.08) 2px 4px 12px);
  color: #111316;
  scroll-margin-top: 96px;
}

.lp-resenas *,
.lp-resenas *::before,
.lp-resenas *::after { box-sizing: border-box; }

.lp-resenas__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 22px;
}

.lp-resenas__title {
  margin: 0;
  font-family: "LP Display", system-ui, sans-serif;
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #111316;
}

.lp-resenas__badge {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #dedfe2;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #3f4247;
  white-space: nowrap;
}

.lp-resenas__layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 32px clamp(28px, 4vw, 64px);
  align-items: start;
}

/* Estrellas (resumen, listado y formulario) */
.lp-resenas__stars {
  display: inline-flex;
  gap: 2px;
  line-height: 0;
}

.lp-resenas__star {
  position: relative;
  display: inline-block;
  color: #e4e0d4;
}

.lp-resenas__star svg {
  display: block;
  fill: currentColor;
}

.lp-resenas__star::after {
  position: absolute;
  inset: 0;
  width: var(--lp-star-fill, 0%);
  overflow: hidden;
  color: #f5b51b;
  content: "";
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E") left center / auto 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E") left center / auto 100% no-repeat;
}

/* Resumen */
.lp-resenas__summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.lp-resenas__score {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lp-resenas__average {
  font-size: 52px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.03em;
}

.lp-resenas__score-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lp-resenas__score-count {
  font-size: 13px;
  color: #686b70;
}

.lp-resenas__score--empty {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.lp-resenas__empty-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #3f4247;
}

.lp-resenas__bars {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-resenas__bar {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #686b70;
}

.lp-resenas__bar-label { white-space: nowrap; }
.lp-resenas__bar-count { text-align: right; }

.lp-resenas__bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #ececee;
}

.lp-resenas__bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #f5b51b;
}

.lp-resenas__write {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #111316;
  border-radius: var(--gds-radius-control, 8px);
  background: #111316;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.lp-resenas__write:hover,
.lp-resenas__write:focus-visible { background: #303236; }
.lp-resenas__write:focus-visible { outline: 2px solid #111316; outline-offset: 2px; }
.lp-resenas__write[aria-expanded="true"] { background: #fff; color: #111316; }

.lp-resenas__hint {
  margin: -6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #686b70;
}

/* Formulario */
.lp-resenas__main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.lp-resenas__form {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid #dedfe2;
  border-radius: 14px;
  background: #f9f9f9;
}

.lp-resenas__form[hidden] { display: none; }

.lp-resenas__form-title {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
}

.lp-resenas__rating {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.lp-resenas__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #111316;
}

.lp-resenas__label small {
  font-weight: 400;
  color: #686b70;
}

.lp-resenas__rating-options {
  display: flex;
  align-items: center;
  gap: 2px;
}

.lp-resenas__rating-option {
  position: relative;
  display: inline-flex;
  padding: 2px;
  color: #d4d1c8 !important;
  cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
}

.lp-resenas__rating-option svg { display: block; fill: currentColor; }
.lp-resenas__rating-option.is-on { color: #f5b51b !important; }
.lp-resenas__rating-option:hover { transform: scale(1.08); }
.lp-resenas__rating-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lp-resenas__rating-option:has(input:focus-visible) { outline: 2px solid #111316; outline-offset: 1px; border-radius: 6px; }

.lp-resenas__rating-text {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #3f4247;
}

.lp-resenas__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lp-resenas__field { display: block; min-width: 0; }

.lp-resenas__field input,
.lp-resenas__field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #dedfe2;
  border-radius: 10px;
  background: #fff;
  color: #111316;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.lp-resenas__field textarea { min-height: 120px; resize: vertical; }

.lp-resenas__field input:focus-visible,
.lp-resenas__field textarea:focus-visible {
  outline: 2px solid #111316;
  outline-offset: 0;
  border-color: #111316;
}

.lp-resenas__website {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.lp-resenas__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lp-resenas__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lp-resenas__submit,
.lp-resenas__cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--gds-radius-control, 8px);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.lp-resenas__submit {
  border: 1px solid #111316;
  background: #111316;
  color: #fff;
}

.lp-resenas__submit:hover { background: #303236; }
.lp-resenas__submit:disabled { cursor: progress; opacity: .7; }

.lp-resenas__cancel {
  border: 1px solid #dedfe2;
  background: #fff;
  color: #3f4247;
}

.lp-resenas__cancel:hover { border-color: #9a9da2; }

.lp-resenas__status {
  margin: 0;
  min-height: 1em;
  font-size: 13px;
  line-height: 1.4;
  color: #686b70;
}

.lp-resenas__status:empty { display: none; }
.lp-resenas__status.is-error { color: #b42318; }
.lp-resenas__status.is-success { color: #00a650; }

.lp-resenas__thanks {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #c8e6d2;
  border-radius: 12px;
  background: #f0faf3;
  color: #00a650;
  font-size: 14px;
  font-weight: 600;
}

/* Listado */
.lp-resenas__list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-resenas__list[hidden] { display: none; }

.lp-resenas__item {
  padding: 16px 18px;
  border: 1px solid #ececee;
  border-radius: 14px;
  background: #fff;
}

.lp-resenas__item[hidden] { display: none; }

.lp-resenas__item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.lp-resenas__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #111316;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
}

.lp-resenas__item-meta {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lp-resenas__item-author {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
}

.lp-resenas__verified {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f7ee;
  color: #00a650;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
}

.lp-resenas__item-date {
  font-size: 12px;
  color: #686b70;
}

.lp-resenas__item-body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: #3f4247;
}

.lp-resenas__more {
  justify-self: start;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #dedfe2;
  border-radius: 999px;
  background: #fff;
  color: #111316;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.lp-resenas__more:hover { border-color: #9a9da2; }

.lp-resenas__placeholder {
  padding: 18px 20px;
  border: 1px dashed #dedfe2;
  border-radius: 14px;
  color: #686b70;
  font-size: 14px;
  line-height: 1.5;
}

.lp-resenas__placeholder p { margin: 0; }

@media (max-width: 1023px) {
  .lp-resenas__layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .lp-resenas__summary {
    padding-bottom: 22px;
    border-bottom: 1px solid #ececee;
  }
}

@media (max-width: 640px) {
  .lp-resenas {
    padding: 18px 16px;
    border-radius: 14px;
    scroll-margin-top: 80px;
  }

  .lp-resenas__header { margin-bottom: 16px; }
  .lp-resenas__average { font-size: 44px; }
  .lp-resenas__fields { grid-template-columns: 1fr; }
  .lp-resenas__form { padding: 16px; }
  .lp-resenas__item { padding: 14px; }
  .lp-resenas__item-head .lp-resenas__stars { margin-left: auto; }
  .lp-resenas__actions .lp-resenas__submit { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-resenas__rating-option,
  .lp-resenas__write { transition: none; }
  .lp-resenas__rating-option:hover { transform: none; }
}

/* Sin reseñas: una invitación corta, no una sección vacía. */
.lp-resenas--vacia .lp-resenas__badge {
  display: none;
}

.lp-resenas--vacia .lp-resenas__layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.lp-resenas--vacia .lp-resenas__summary {
  padding-bottom: 0;
  border-bottom: 0;
  flex-flow: row wrap;
  align-items: center;
  gap: 8px 16px;
}

.lp-resenas--vacia .lp-resenas__empty-copy {
  flex: 1 1 280px;
}

.lp-resenas--vacia .lp-resenas__write {
  width: auto;
  min-height: 44px;
  border-radius: 12px;
  background: #fff;
  color: #111316;
}

.lp-resenas--vacia .lp-resenas__hint {
  flex: 1 1 100%;
  margin: 0;
}

.lp-resenas--vacia .lp-resenas__list[hidden] {
  display: none;
}

.lp-resenas--vacia .lp-resenas__main:not(:has(.lp-resenas__form:not([hidden]))) {
  display: none;
}
