/* AlphaPatterns — Reviews redesign
   Colocar en: wp-content/themes/TU-CHILD-THEME/css/reviews-redesign.css
   (o pegar dentro de <style> en Bricks > Ajustes > CSS global) */

:root{
  --ap-violet: #7864fd;
  --ap-violet-deep: #5f4bdb;
  --ap-teal: #12c1ab;
  --ap-ink: #1c1b2e;
  --ap-ink-soft: #55536b;
  --ap-line: #ececf2;
  --ap-radius: 12px;
  --ap-radius-lg: 20px;
}

.ap-reviews{ max-width:920px; margin:0 auto; }

/* ---------- Summary ---------- */
.ap-summary-wrap{ margin-bottom:32px; }
.ap-summary{
  display:flex; align-items:center; gap:32px;
  background:#fff; border:1px solid var(--ap-line);
  border-radius:var(--ap-radius-lg); padding:28px 32px;
}
.ap-summary-score{
  text-align:center; min-width:110px;
  border-right:1px solid var(--ap-line); padding-right:28px;
}
.ap-summary-score .num{
  font-weight:800; font-size:44px; line-height:1;
  letter-spacing:-0.02em; color:var(--ap-ink);
}
.ap-summary-score .ap-stars-svg{ margin:8px 0 4px; justify-content:center; }
.ap-summary-score .count{ font-size:12.5px; color:var(--ap-ink-soft); }

.ap-bars{ flex:1; display:flex; flex-direction:column; gap:6px; }
.ap-bars .bar-row{ display:flex; align-items:center; gap:10px; font-size:12px; color:var(--ap-ink-soft); }
.ap-bars .label{ width:26px; flex-shrink:0; }
.ap-bars .bar-track{ flex:1; height:6px; border-radius:6px; background:var(--ap-line); overflow:hidden; }
.ap-bars .bar-fill{ height:100%; border-radius:6px; background:linear-gradient(90deg,var(--ap-violet),var(--ap-teal)); }
.ap-bars .pct{ width:32px; text-align:right; flex-shrink:0; }

.ap-badge-pill{
  display:inline-flex; align-items:center; gap:6px;
  background:#f1eefe; color:var(--ap-violet-deep);
  font-weight:600; font-size:12.5px;
  padding:6px 14px; border-radius:999px; white-space:nowrap;
}
.ap-badge-pill svg{ width:12px; height:12px; flex-shrink:0; }
.ap-badge-teal{ background:#e6faf7; color:#0a8f7e; }

/* ---------- Photo strip ---------- */
.ap-photo-section{ margin-bottom:40px; }
.ap-eyebrow{ display:flex; flex-direction:row; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:40px; }
.ap-eyebrow h3{ flex:1; min-width:0; font-size:26px; font-weight:600; color:#212121; margin:0; letter-spacing:-0.01em; text-wrap:pretty; }
.ap-eyebrow .ap-badge-pill{ flex-shrink:0; max-width:110px; white-space:normal; text-align:center; }
@media (min-width: 720px){
  .ap-eyebrow{ align-items:center; }
  .ap-eyebrow h3{ font-size:30px; }
}

/* "Customer reviews" + filtros + selector de orden */
.ap-reviews-toolbar{
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:12px; margin-bottom:16px;
}
.ap-toolbar-title{ text-align:left; font-size:20px; font-weight:600; color:#212121; margin:0; letter-spacing:-0.01em; }
@media (min-width: 720px){
  .ap-toolbar-title{ font-size:26px; }
}

.ap-reviews-controls{ display:flex; align-items:center; gap:8px; flex-wrap:nowrap; }

.ap-review-filters{ display:flex; gap:8px; flex-shrink:0; }

.ap-review-filter-pill,
.ap-review-sort{
  width:auto; /* el tema aplica width:100% a <select> por defecto; sin esto se estira y baja de línea */
  flex-shrink:0; box-sizing:border-box;
  height:34px; line-height:1; /* misma altura exacta que los pills de filtro */
  font-size:13px; font-weight:600; color:var(--ap-ink-soft); font-family:inherit;
  border:1px solid var(--ap-line); border-radius:999px;
  padding:0 16px; background:#fff; cursor:pointer; white-space:nowrap;
}

.ap-review-sort-wrap{ position:relative; display:inline-flex; align-items:center; flex-shrink:0; }
.ap-review-sort{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  padding-right:30px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2355536b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center; background-size:12px;
}
.ap-review-filter-pill.is-active{
  border-color:var(--ap-violet); color:var(--ap-violet-deep);
}

.ap-photo-strip-wrap{ position:relative; }

.ap-photo-scroll{
  display:flex; gap:10px; overflow-x:auto; scroll-snap-type:x proximity;
  scrollbar-width:none; -ms-overflow-style:none; /* ocultar barra: sigue siendo deslizable */
}
.ap-photo-scroll::-webkit-scrollbar{ display:none; }

/* Flechas del slider: superpuestas a las fotos, solo visibles al hover (desktop) */
.ap-strip-nav{
  display:none; position:absolute; top:50%; transform:translateY(-50%); z-index:2;
  width:36px; height:36px; border:none; border-radius:50%;
  background:rgba(20,19,35,.55); align-items:center; justify-content:center;
  cursor:pointer; opacity:0; transition:opacity .15s ease;
}
.ap-strip-nav svg{ width:18px; height:18px; color:#fff; }
.ap-strip-prev{ left:12px; }
.ap-strip-next{ right:12px; }

@media (min-width: 900px){
  .ap-strip-nav{ display:flex; }
  .ap-photo-strip-wrap:hover .ap-strip-nav{ opacity:1; }
}

.ap-photo-thumb{
  position:relative; aspect-ratio:3/4; height:auto;
  /* móvil: ~2 fotos completas + un trozo de la 3ª */
  flex:0 0 calc((100% - 10px) / 2.3);
  border-radius:var(--ap-radius); overflow:hidden; display:block;
  scroll-snap-align:start; border:2px solid transparent;
  transition:transform .15s ease, border-color .15s ease;
}
.ap-photo-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }

@media (min-width: 720px){
  .ap-photo-thumb{
    /* desktop: ~6 fotos completas + un trozo de la 7ª */
    flex-basis:calc((100% - 5*10px) / 6.3);
  }
}
.ap-photo-thumb:hover{ transform:translateY(-3px); border-color:var(--ap-violet); }

/* ---------- Review list ---------- */
.ap-review-list{ list-style:none; margin:0; padding:0; }
.ap-review{ border-bottom:1px solid var(--ap-line); }
.ap-review:last-child{ border-bottom:none; }
.ap-review-body{ padding:22px 4px; scroll-margin-top:20px; }

.ap-review-top{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap; margin-bottom:10px;
}
.ap-top-left{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

.ap-stars-svg{ display:flex; align-items:center; gap:2px; flex-shrink:0; }
.ap-stars-svg svg{ width:17px; height:17px; fill:var(--ap-violet); }
.ap-stars-svg svg.ap-star-empty{ fill:none; stroke:var(--ap-line); stroke-width:1.5; }

.ap-reviewer{ display:flex; align-items:center; gap:6px; flex-shrink:0; }
.ap-avatar{
  flex:0 0 auto; width:18px; height:18px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:8.5px; color:#fff;
}
.ap-name{ font-weight:600; font-size:12.5px; color:var(--ap-ink-soft); }
.ap-date{ font-size:12px; color:#a5a3b6; }
.ap-sep{ color:#d6d4e3; font-size:12px; }

.ap-mini-badge{
  display:inline-flex; align-items:center; gap:4px;
  font-size:10.5px; font-weight:600; padding:3px 9px;
  border-radius:999px; white-space:nowrap; line-height:1.4;
  background:#e6faf7; color:#0a8f7e;
}
.ap-mini-badge svg{ width:10px; height:10px; flex-shrink:0; }

.ap-review-text{ font-size:13.5px; line-height:1.55; color:#3a394f; margin:0; }
.ap-review-text p{ margin:0 0 10px; }
.ap-review-text p:last-child{ margin-bottom:0; }

.ap-review-photos{ display:flex; gap:8px; margin-top:12px; }
.ap-review-photos img{ width:56px; height:56px; object-fit:cover; border-radius:8px; cursor:pointer; }

.ap-etsy-tag{
  display:flex; align-items:center; justify-content:flex-end; gap:5px;
  margin-top:10px; font-size:10.5px; font-weight:500; color:#a5a3b6;
}
.ap-etsy-tag .dot{ width:5px; height:5px; border-radius:50%; background:#f1641e; flex-shrink:0; }

/* ---------- Respuestas del vendedor (comentarios anidados) ---------- */
.ap-review-list .children{
  list-style:none; margin:0 0 0 30px; padding:14px 0 0;
}
.ap-review-list .children .ap-review-body{
  background:#f7f6fc; border-radius:var(--ap-radius); padding:14px 16px;
}
.ap-review-list .children .ap-name::before{ content:"↳ "; color:var(--ap-violet); }

/* ---------- Pagination ---------- */
.ap-pagination{ display:flex; justify-content:center; margin-top:24px; }
.ap-pagination ul{ display:flex; gap:6px; list-style:none; padding:0; margin:0; }
.ap-pagination a, .ap-pagination span{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:32px; height:32px; border-radius:999px;
  font-size:12.5px; font-weight:600; color:var(--ap-ink-soft);
  text-decoration:none;
}
.ap-pagination .current{ background:var(--ap-violet); color:#fff; }
.ap-pagination .disabled{ opacity:.35; pointer-events:none; }
.ap-pagination a svg{ width:14px; height:14px; color:var(--ap-ink-soft); }

@media (max-width: 600px){
  /* rating+estrellas+contador junto a las barras, badge debajo a ancho completo */
  .ap-summary{ flex-direction:row; flex-wrap:wrap; align-items:center; gap:16px; padding:20px; }
  .ap-summary-score{ border-right:1px solid var(--ap-line); padding:0 16px 0 0; min-width:0; }
  .ap-bars{ flex:1; min-width:0; gap:4px; } /* ocupa el resto del ancho disponible, mismo padding que la izquierda */
  .ap-badge-pill{ flex:0 0 100%; justify-content:center; }
  .ap-review-top{ align-items:flex-start; }
  .ap-eyebrow{ margin-bottom:20px; }
  .ap-reviews-controls{ flex-wrap:wrap; } /* en móvil, si no caben, se apilan en vez de desbordar */
}

/* ---------- Photo modal ---------- */
.ap-photo-modal{
  position:fixed; inset:0; z-index:9999;
  display:none; align-items:center; justify-content:center;
}
.ap-photo-modal.is-open{ display:flex; }
.ap-photo-modal-overlay{ position:absolute; inset:0; background:rgba(20,19,35,.82); }

.ap-photo-modal-inner{
  position:relative; z-index:1; width:min(920px, 92vw); max-height:88vh;
  background:#fff; border-radius:var(--ap-radius-lg); overflow:hidden;
  display:flex; flex-direction:column;
}

.ap-photo-modal-header{
  position:relative; flex:0 0 auto;
  display:flex; align-items:center; justify-content:center;
  padding:16px 52px; border-bottom:1px solid var(--ap-line);
}
.ap-photo-modal-title{ margin:0; font-size:14.5px; font-weight:600; color:#212121; text-align:center; text-wrap:pretty; }
.ap-photo-modal-close{
  position:absolute; right:12px; top:50%; transform:translateY(-50%); z-index:2;
  width:32px; height:32px; border-radius:50%; border:none;
  background:transparent; display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.ap-photo-modal-close svg{ width:16px; height:16px; color:var(--ap-ink); }

/* Contenedor de la foto+review que desliza. position:relative para anclar las flechas,
   que así se quedan fijas en el sitio mientras el track desliza por debajo. */
.ap-photo-modal-body{ position:relative; flex:1; min-height:0; overflow:hidden; display:flex; }
.ap-photo-modal-track{ display:flex; width:100%; height:100%; transition:transform .32s ease; }
.ap-photo-modal-slide{
  flex:0 0 100%; max-width:100%; height:100%; overflow-y:auto;
  display:flex; flex-direction:column;
  -webkit-overflow-scrolling:touch; touch-action:pan-y;
}
.ap-photo-modal-media{
  background:#fff; height:62vh; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
}
.ap-photo-modal-media img{ max-width:100%; max-height:100%; object-fit:contain; display:block; }

.ap-photo-modal-review{ padding:16px 20px 32px; display:flex; flex-direction:column; }
.ap-photo-modal-review-top{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.ap-photo-modal-review-top .ap-date{ margin-left:auto; }
.ap-photo-modal-review .ap-review-text{
  flex:none; font-size:14px; line-height:1.6; margin:0 !important;
}
/* más espacio entre el texto de la review y el nombre */
.ap-photo-modal-review .ap-reviewer{ margin-top:14px; }

@media (min-width: 720px){
  /* height fija (no solo max-height): sin esto, height:100% no se resuelve en cascada
     (body→track→slide→foto) y la imagen no queda ni acotada ni centrada. */
  .ap-photo-modal-inner{ height:min(76vh, 620px); max-height:min(76vh, 620px); }
  .ap-photo-modal-slide{ flex-direction:row; }
  /* mismo padding-top que la review, 32 abajo */
  .ap-photo-modal-media{ flex:0 0 60%; height:100%; padding:18px 56px 32px; box-sizing:border-box; }
  .ap-photo-modal-review{ flex:1; padding:18px 22px; overflow-y:auto; }
  .ap-photo-modal-review .ap-review-text{ font-size:13px; }
}

/* Flechas sin recuadro, separadas del padding de la foto */
.ap-photo-modal-nav{
  position:absolute; top:50%; transform:translateY(-50%); z-index:2;
  width:34px; height:34px; border:none; background:transparent;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.ap-photo-modal-prev{ left:10px; }
.ap-photo-modal-next{ left:calc(60% - 44px); }
.ap-photo-modal-nav svg{ width:22px; height:22px; color:var(--ap-ink); }

@media (max-width: 900px){
  .ap-photo-modal-nav{ display:none; } /* en móvil se navega con swipe */
}

@media (max-width: 600px){
  .ap-photo-modal-inner{
    width:100vw; height:100vh; height:100dvh; max-height:100vh; max-height:100dvh;
    border-radius:0;
  }
  .ap-photo-modal-header{ padding:14px 44px; }
  .ap-photo-modal-title{ font-size:13px; }
  /* sin padding en la imagen; el hueco hasta la línea de estrellas lo da
     el padding-top:16px de .ap-photo-modal-review (regla base) */
  .ap-photo-modal-media{ padding:0; }
}

/* ---------- Formulario "Add a review" ---------- */
#review_form_wrapper{ max-width:520px; margin-top:8px; }
#review_form_wrapper #reply-title,
#review_form_wrapper .comment-reply-title{
  font-size:20px; font-weight:600; color:#212121; margin:0 0 6px;
}
#review_form_wrapper .comment-notes{
  font-size:13px; color:var(--ap-ink-soft); margin:0 0 20px;
}
#review_form_wrapper label{
  display:block; font-size:13px; font-weight:600; color:#212121; margin-bottom:6px;
}
#review_form_wrapper .comment-form-author,
#review_form_wrapper .comment-form-email,
#review_form_wrapper .comment-form-rating,
#review_form_wrapper .comment-form-comment{
  margin:0 0 18px;
}
#review_form_wrapper input[type="text"],
#review_form_wrapper input[type="email"],
#review_form_wrapper select#rating,
#review_form_wrapper textarea{
  width:100%; box-sizing:border-box;
  font-size:14px; font-family:inherit; color:var(--ap-ink);
  border:1px solid var(--ap-line); border-radius:var(--ap-radius);
  padding:11px 14px; background:#fff;
}
#review_form_wrapper input[type="text"]:focus,
#review_form_wrapper input[type="email"]:focus,
#review_form_wrapper select#rating:focus,
#review_form_wrapper textarea:focus{
  outline:none; border-color:var(--ap-violet);
}
#review_form_wrapper textarea{ resize:vertical; min-height:120px; }
#review_form_wrapper .comment-form-cookies-consent{
  display:flex; align-items:center; gap:8px;
  font-size:13px; color:var(--ap-ink-soft); margin:0 0 18px;
}
#review_form_wrapper .comment-form-cookies-consent label{
  display:inline; font-size:13px; font-weight:400; margin:0;
}
#review_form_wrapper .comment-form-cookies-consent input{ width:auto; margin:0; }
#review_form_wrapper .form-submit{ margin:4px 0 0; }
#review_form_wrapper #submit{
  appearance:none; -webkit-appearance:none; border:none; cursor:pointer;
  background:var(--ap-violet); color:#fff;
  font-size:14px; font-weight:600; font-family:inherit;
  padding:12px 28px; border-radius:999px;
  transition:background .15s ease;
}
#review_form_wrapper #submit:hover{ background:var(--ap-violet-deep); }
