/* ═══════════════════════════════════════════════════
   ALV Reviews Widget — Google Reviews
   ═══════════════════════════════════════════════════ */

/* --- Badge flotante (desktop) --- */
.alv-reviews-badge {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  padding: 14px 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  font-family: "Sora", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.alv-reviews-badge:hover {
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
  transform: translateY(-2px);
}

.alv-reviews-badge-google {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.alv-reviews-badge-text {
  font-size: 12px;
  color: #4a5c72;
  white-space: nowrap;
}

.alv-reviews-badge-rating {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #0b1a2b;
}

.alv-reviews-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.alv-reviews-badge-stars {
  display: flex;
  gap: 1px;
}
.alv-reviews-badge-stars svg {
  width: 18px;
  height: 18px;
}

.alv-reviews-badge-count {
  font-size: 12px;
  color: #6b7a8f;
}

/* --- Overlay --- */
.alv-reviews-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 26, 43, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 10050;
  cursor: pointer;
}
.alv-reviews-overlay.active {
  display: block;
}

/* --- Panel de reseñas (desktop: sidebar izquierdo) --- */
.alv-reviews-panel {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 400px;
  height: 100%;
  background: #ffffff;
  z-index: 10051;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  font-family: "Sora", sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.alv-reviews-panel.active {
  display: flex;
  transform: translateX(0);
}

/* --- Panel: header --- */
.alv-reviews-header {
  padding: 24px 24px 20px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.alv-reviews-close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 0 !important;
  border-radius: 50% !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  background: #ffffff !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  line-height: 34px !important;
  text-align: center !important;
  cursor: pointer !important;
  color: #4a5c72 !important;
  transition: background 0.2s, color 0.2s !important;
  padding: 0 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}
.alv-reviews-close:hover {
  background: #f0f4f8 !important;
  color: #0b1a2b !important;
  box-shadow: none !important;
  transform: none !important;
}

.alv-reviews-business-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #0b1a2b;
  margin: 0 0 4px;
  padding-right: 40px;
}

.alv-reviews-subtitle {
  font-size: 13px;
  color: #6b7a8f;
  margin: 0 0 16px;
}

/* --- Panel: Google badge card --- */
.alv-reviews-google-card {
  background: #f6f8fb;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.alv-reviews-google-logo {
  height: 22px;
  margin-bottom: 8px;
}

.alv-reviews-google-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.alv-reviews-google-score {
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #0b1a2b;
}

.alv-reviews-google-stars {
  display: flex;
  gap: 2px;
}
.alv-reviews-google-stars svg {
  width: 20px;
  height: 20px;
}

.alv-reviews-google-count {
  font-size: 13px;
  color: #6b7a8f;
  margin-left: 4px;
}

/* --- Panel: reviews list --- */
.alv-reviews-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  -webkit-overflow-scrolling: touch;
}

/* --- Panel: individual review --- */
.alv-review-item {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.alv-review-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  justify-content: center;
}
.alv-review-stars svg {
  width: 16px;
  height: 16px;
}

.alv-review-text {
  font-size: 14px;
  color: #0b1a2b;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 14px;
}

.alv-review-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.alv-review-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f4f8;
}

.alv-review-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0099cf;
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alv-review-name {
  font-size: 13px;
  font-weight: 600;
  color: #0b1a2b;
}

.alv-review-source {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #6b7a8f;
}
.alv-review-source img {
  width: 16px;
  height: 16px;
}
.alv-review-source a {
  color: #0099cf;
  text-decoration: none;
  font-weight: 500;
}

/* --- Mobile (max-width: 767px) --- */
@media (max-width: 767px) {
  /* Badge: bottom bar horizontal */
  .alv-reviews-badge {
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.1);
  }
  .alv-reviews-badge:hover {
    transform: none;
  }
  .alv-reviews-badge-text {
    display: none;
  }

  /* Panel: fullscreen */
  .alv-reviews-panel {
    width: 100%;
    transform: translateX(-100%);
  }
  .alv-reviews-panel.active {
    transform: translateX(0);
  }
}

/* --- Hide on checkout --- */
#order-opc .alv-reviews-badge,
#order-opc .alv-reviews-overlay,
#order-opc .alv-reviews-panel {
  display: none !important;
}
