/* src/product-detail.css — Estilos refinados, proporcionales y limpios para la ficha de producto Kareo */

/* 1. Meta y Calificación en cabecera */
.product-rating-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 12px;
}

.product-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-icon-svg {
  display: inline-block;
  vertical-align: middle;
}

.rating-val {
  font-size: 12px;
  font-weight: 700;
  color: #1a3c58;
}

.rating-qty {
  font-size: 11px;
  color: #698294;
}

.rating-qty-link {
  font-size: 11.5px;
  color: #557288;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.rating-qty-link:hover {
  color: var(--accent, #165b91);
  text-decoration: underline;
}

.badge-verified-buyer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #1b6838;
  background: #edf8f1;
  border: 1px solid #c8eed6;
  padding: 2px 7px;
  border-radius: 12px;
  line-height: 1.2;
}

.rate-now-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #165b91);
  cursor: pointer;
  text-decoration: underline;
  margin-left: 2px;
}

.rate-now-link:hover {
  color: #0f4066;
}

/* 2. Visualización simplificada: clic para ampliar */
.product-visual-column {
  display: flex;
  flex-direction: column;
}

.product-zoom-container {
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.product-zoom-container img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.product-magnifier-lens {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  pointer-events: none;
  display: none;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.95), 0 8px 24px rgba(10, 30, 50, 0.3);
  border: 2px solid #ffffff;
  z-index: 10;
  background-color: #ffffff;
  will-change: left, top, background-position;
}

@media (max-width: 768px) {
  .product-magnifier-lens {
    width: 136px;
    height: 136px;
    border: 2.5px solid #ffffff;
    box-shadow: 0 0 0 2px rgba(22, 91, 145, 0.35), 0 12px 32px rgba(10, 30, 50, 0.45);
  }
}

.zoom-hint-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  border: 1px solid #d4e2ec;
  color: var(--accent, #165b91);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.15s ease;
  z-index: 5;
}

.zoom-hint-btn:hover {
  background: #ffffff;
  border-color: var(--accent, #165b91);
  transform: scale(1.08);
}

.product-original-desc {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted, #556e80);
  margin-bottom: 14px;
}

/* 3. Ficha técnica colapsable */
.compact-tech-spec-details {
  background: #ffffff;
  border: 1px solid #e1ecf3;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
  transition: all 0.2s ease;
}

.compact-tech-spec-details[open] {
  box-shadow: 0 4px 18px rgba(18, 55, 85, 0.05);
}

.tech-spec-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  gap: 12px;
  background: #fbfdfe;
  transition: background 0.15s ease;
}

.tech-spec-summary::-webkit-details-marker,
.tech-spec-summary::marker {
  display: none;
}

.tech-spec-summary::after,
.compact-tech-spec-details[open] .tech-spec-summary::after {
  content: none !important;
  display: none !important;
}

.tech-spec-summary:hover {
  background: #f4f8fb;
}

.tech-spec-summary:hover .tech-spec-heading {
  color: var(--accent, #165b91);
}

.tech-spec-chevron {
  color: #637d90;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.compact-tech-spec-details[open] .tech-spec-chevron {
  transform: rotate(180deg);
}

.tech-spec-heading {
  font-size: 13px;
  font-weight: 600;
  color: #1a4263;
  margin: 0;
}

.tech-spec-grid {
  padding: 14px 18px;
  border-top: 1px solid #edf4f8;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  background: #ffffff;
}

.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #f4f8fa;
}

.spec-term {
  font-size: 11px;
  color: #637d90;
  flex-shrink: 0;
}

.spec-value {
  font-size: 11.5px;
  font-weight: 500;
  color: #1a3346;
  text-align: right;
  margin: 0;
}

.spec-source-link {
  color: var(--accent, #165b91);
  text-decoration: none;
}

.spec-source-link:hover {
  text-decoration: underline;
}

/* 4. Botones de acción nivelados con porte idéntico */
.product-detail-layout {
  align-items: start;
}

.product-detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 18px 0 14px;
}

.product-detail-actions .button {
  flex: 1 1 200px;
  min-height: 48px;
  height: 48px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.1px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 !important;
  box-sizing: border-box;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1;
}

/* Botón 1: Compra única (Carrito) */
.product-detail-actions .button-cart,
.product-detail-actions .button:not(.button-box):not(.button-rx-pending) {
  background: var(--accent, var(--ocean));
  color: #ffffff;
  border: 1.5px solid var(--accent, var(--ocean)) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent, var(--ocean)), transparent 75%);
}

.product-detail-actions .button-cart:hover:not(:disabled),
.product-detail-actions .button:not(.button-box):not(.button-rx-pending):hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent, var(--ocean)), black 15%);
  border-color: color-mix(in srgb, var(--accent, var(--ocean)), black 15%) !important;
  transform: translateY(-1px);
}

.product-detail-actions .button-cart span,
.product-detail-actions .button:not(.button-box):not(.button-rx-pending) span {
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

/* Botón 2: Armar mi caja familiar */
.product-detail-actions .button-box {
  background: var(--soft, #edf8ff) !important;
  color: var(--accent, var(--ocean)) !important;
  border: 1.5px solid color-mix(in srgb, var(--accent, var(--ocean)), white 70%) !important;
  box-shadow: none;
}

.product-detail-actions .button-box:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent, var(--ocean)), white 82%) !important;
  border-color: var(--accent, var(--ocean)) !important;
  transform: translateY(-1px);
}

.product-detail-actions .button-box.in-box {
  background: var(--accent, var(--ocean)) !important;
  color: #ffffff !important;
  border-color: var(--accent, var(--ocean)) !important;
}

.product-detail-actions .button-box .box-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* En celulares / PWA: ambos botones con porte idéntico al 100% */
@media (max-width: 650px) {
  .product-detail-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .product-detail-actions .button {
    width: 100%;
    flex: none;
    min-height: 48px;
    height: 48px;
    justify-content: center;
  }
}

/* 5. Calificaciones y Reseñas con separación compacta y alineación armónica */
.page-product .product-detail-page {
  padding-left: 6% !important;
  padding-right: 6% !important;
  padding-bottom: 12px !important;
}

.product-reviews-wrapper {
  max-width: 1120px;
  margin: 10px auto 0 !important;
  padding: 0 6% 24px !important;
  box-sizing: content-box;
  width: auto;
  border-top: none;
}

@media (max-width: 760px) {
  .page-product .product-detail-page {
    padding-left: 5% !important;
    padding-right: 5% !important;
    padding-bottom: 6px !important;
  }

  .product-reviews-wrapper {
    margin: 8px auto 0 !important;
    padding: 0 5% 18px !important;
  }
}

.product-reviews-details {
  background: #ffffff;
  border: 1px solid #e1ecf3;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.product-reviews-details[open] {
  box-shadow: 0 4px 18px rgba(18, 55, 85, 0.05);
}

.reviews-summary-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  gap: 12px;
  background: #fbfdfe;
  transition: background 0.15s ease;
}

.reviews-summary-toggle::-webkit-details-marker,
.reviews-summary-toggle::marker {
  display: none;
}

.reviews-summary-toggle::after,
.product-reviews-details[open] .reviews-summary-toggle::after {
  content: none !important;
  display: none !important;
}

.reviews-summary-toggle:hover {
  background: #f4f8fb;
}

.reviews-summary-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reviews-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a4263;
}

.reviews-chevron {
  color: #637d90;
  transition: transform 0.2s ease;
}

.product-reviews-details[open] .reviews-chevron {
  transform: rotate(180deg);
}

.reviews-body-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.reviews-body-title {
  font-size: 15px;
  font-weight: 700;
  color: #163e60;
  margin: 0;
}

.reviews-login-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #f6fafd;
  border: 1px solid #dbe8f1;
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.login-gate-copy strong {
  display: block;
  font-size: 12.5px;
  color: #153e5e;
  margin-bottom: 2px;
}

.login-gate-copy p {
  font-size: 11px;
  color: #5d778a;
  margin: 0;
}

.button-login-gate {
  background: #ffffff;
  color: var(--accent, #165b91);
  border: 1.5px solid var(--accent, #165b91);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.button-login-gate:hover {
  background: var(--accent, #165b91);
  color: #ffffff;
}

.reviews-details-body {
  padding: 16px 18px;
  border-top: 1px solid #edf4f8;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reviews-policy-card {
  background: #f8fbfe;
  border: 1px solid #e2ecf3;
  border-radius: 8px;
  padding: 12px 14px;
}

.policy-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.guarantee-compact-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #15803d;
  font-weight: 600;
}

.rate-restriction-note {
  font-size: 10.5px;
  color: #6a8294;
  font-weight: 500;
}

.reviews-policy-text {
  font-size: 11.5px;
  line-height: 1.55;
  color: #4a667c;
  margin: 0;
}

.reviews-empty-state {
  padding: 8px 4px;
}

.reviews-empty-copy {
  font-size: 12px;
  color: #647f93;
  margin: 0;
  line-height: 1.5;
}

.reviews-compact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-compact-card {
  background: #ffffff;
  border: 1px solid #e7eff5;
  border-radius: 10px;
  padding: 12px 16px;
}

.review-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.review-author-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-compact-author {
  font-size: 12px;
  color: #173852;
}

.review-date-stars-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-compact-date {
  font-size: 10.5px;
  color: #7b94a6;
}

.review-compact-comment {
  font-size: 12px;
  line-height: 1.55;
  color: #2c465c;
  margin: 0;
}

/* 5. Modal Lightbox simplificado (Clic para ampliar y cerrar) */
.zoom-lightbox-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(10, 25, 40, 0.88);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
}

.zoom-lightbox-dialog[open] {
  display: flex;
}

.zoom-lightbox-dialog::backdrop {
  background: rgba(10, 25, 40, 0.88);
  backdrop-filter: blur(8px);
}

.zoom-close-icon-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 10000;
}

.zoom-close-icon-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.08);
}

.zoom-canvas-area {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  cursor: pointer;
}

.zoom-canvas-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

/* 7. Modal de Calificación con Verificación de Compra */
.rating-modal-dialog {
  width: 90vw;
  max-width: 400px;
  border: none;
  border-radius: 16px;
  padding: 0;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 20, 50, 0.3);
  overflow: hidden;
}

.rating-modal-dialog::backdrop {
  background: rgba(10, 25, 40, 0.6);
  backdrop-filter: blur(3px);
}

.rating-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #edf3f7;
}

.rating-dialog-header h3 {
  margin: 0;
  font-size: 14.5px;
  color: #163e60;
}

.icon-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #7b94a6;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-close-btn:hover {
  color: #244158;
}

.rating-dialog-body {
  padding: 18px 20px;
}

.verification-notice-box {
  background: #f7f9fb;
  border: 1px solid #e1ebf2;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.verification-notice-box.is-verified {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.notice-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #173852;
  margin-bottom: 4px;
}

.verification-notice-box.is-verified .notice-title-row {
  color: #166534;
}

.notice-icon {
  display: flex;
  align-items: center;
}

.notice-text {
  font-size: 11px;
  line-height: 1.45;
  color: #557286;
  margin: 0;
}

.code-input-row {
  display: flex;
  gap: 6px;
}

.code-input-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #cbdde9;
  border-radius: 8px;
  font-size: 12px;
}

.code-subtext {
  display: block;
  font-size: 10px;
  color: #7b94a6;
  margin-top: 6px;
}

.code-feedback {
  margin-top: 8px;
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 6px;
  display: none;
}

.code-feedback.error {
  display: block;
  background: #fdf2f2;
  color: #b02a37;
  border: 1px solid #f8d7da;
}

.code-feedback.success {
  display: block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.stars-picker-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.star-pick-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.rating-submission-form .field {
  margin-bottom: 12px;
}

.rating-submission-form label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #244158;
  margin-bottom: 4px;
}

.rating-submission-form input[type="text"],
.rating-submission-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbdde9;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
}

.rating-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.rating-form-actions .button {
  flex: 1;
  padding: 9px 14px;
  font-size: 12px;
}

.rating-form-actions .secondary {
  padding: 9px 14px;
  font-size: 12px;
}

@media (max-width: 650px) {
  .product-rating-meta-row {
    margin-bottom: 8px;
  }
  .spec-row {
    flex-direction: column;
    gap: 2px;
  }
  .spec-value {
    text-align: left;
  }
}
