/* ── Widget: Product Reviews ─────────────────────────────────── */

.cw-product-reviews {
    width: 100%;
    background-color: #ffffff;
}

/* ── Header ──────────────────────────────────────────────────── */
.cw-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
}

.cw-reviews-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.cw-reviews-global {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.cw-reviews-global-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.cw-reviews-global-number {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.cw-reviews-stars {
    color: #c8a96e;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}

.cw-reviews-global-count {
    font-size: 13px;
    color: #9e9e9e;
}

/* ── Lista ───────────────────────────────────────────────────── */
.cw-reviews-list {
    display: flex;
    flex-direction: column;
}

/* ── Reseña individual ───────────────────────────────────────── */
.cw-review-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw-review-item:not(:last-child) {
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 28px;
    margin-bottom: 28px;
}

/* Línea 1: Nombre + Badge */
.cw-review-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cw-review-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.cw-review-verified {
    font-size: 11px;
    color: #2e7d32;
    background-color: #e8f5e9;
    border-radius: 12px;
    padding: 3px 10px;
    line-height: 1.4;
    white-space: nowrap;
    font-weight: 500;
}

/* Línea 2: estrellas + fecha */
.cw-review-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cw-review-meta .cw-reviews-stars svg {
    width: 14px;
    height: 14px;
}

.cw-review-date {
    font-size: 13px;
    color: #9e9e9e;
    white-space: nowrap;
}

/* Texto */
.cw-review-text-wrap {
    margin-top: 4px;
}

.cw-review-text {
    font-size: 14px;
    color: #444444;
    line-height: 1.6;
}

.cw-review-read-more {
    color: #c8a96e;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
}

.cw-review-read-more:hover {
    text-decoration: underline;
}

.cw-review-text-full {
    display: block;
    animation: cw-reviews-fadein 0.25s ease;
}

@keyframes cw-reviews-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ¿Útil? */
.cw-review-helpful {
    margin-top: 6px;
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #9e9e9e;
    cursor: pointer;
    font-family: inherit;
    align-self: flex-start;
    transition: color 150ms ease, background-color 150ms ease;
}

/* outline siempre desactivado */
.cw-review-helpful:focus,
.cw-review-helpful:focus-visible {
    outline: none;
}

/* hover solo cuando NO está activo */
.cw-review-helpful:not(.is-active):hover,
.cw-review-helpful:not(.is-active):focus,
.cw-review-helpful:not(.is-active):focus-visible {
    color: #1a1a1a;
    background-color: transparent;
}

.cw-review-helpful.is-active {
    color: #c8a96e;
    font-weight: 500;
    background-color: #f0f0f0;
}

/* Sin reseñas / ya revisado */
.cw-reviews-empty,
.cw-reviews-already-msg {
    margin: 0;
    font-size: 14px;
    color: #9e9e9e;
}

.cw-reviews-already-msg {
    font-style: italic;
}

/* ── Botón "Ver Todas las Reseñas" ───────────────────────────── */
.cw-reviews-load-more-wrap {
    margin-top: 32px;
}

.cw-reviews-load-more {
    display: block;
    width: 100%;
    height: 52px;
    background: transparent;
    border: 1.5px solid #c8a96e;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    color: #c8a96e;
    font-weight: 500;
    font-family: inherit;
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.cw-reviews-load-more:hover {
    background-color: #c8a96e;
    color: #ffffff;
    border-color: #c8a96e;
}

.cw-reviews-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Formulario ──────────────────────────────────────────────── */
.cw-reviews-form-wrap {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid #eeeeee;
}

.cw-form-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Selector de estrellas */
.cw-star-picker {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.cw-star-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: transform 150ms ease;
}

.cw-star-btn:hover,
.cw-star-btn:focus,
.cw-star-btn:focus-visible {
    transform: scale(1.1);
    background-color: transparent;
    border-radius: 6px;
    outline: none;
}

.cw-star-btn svg {
    fill: #e8e0d5;
    stroke: #e8e0d5;
    stroke-width: 0;
    transition: fill 150ms ease, stroke 150ms ease;
}

.cw-star-btn.is-hover svg,
.cw-star-btn.is-selected svg {
    fill: #c8a96e;
    stroke: #c8a96e;
}

/* Inputs */
.cw-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.cw-form-input,
.cw-form-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1.5px solid #eeeeee;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a1a;
    background: #ffffff;
    outline: none;
    transition: border-color 200ms ease;
    font-family: inherit;
}

.cw-form-input:focus,
.cw-form-textarea:focus {
    border-color: #c8a96e;
}

/* Anula estilos del tema que sobreescriben el borde de inputs (input[type] tiene mayor especificidad) */
.cw-review-form input.cw-form-input {
    border: 1.5px solid #eeeeee;
    border-radius: 8px;
}

.cw-review-form input.cw-form-input:focus {
    border-color: #c8a96e;
    outline: none;
}

.cw-form-input::placeholder,
.cw-form-textarea::placeholder {
    color: #bbbbbb;
}

.cw-form-textarea {
    resize: vertical;
    min-height: 100px;
    margin-bottom: 12px;
    display: block;
}

.cw-form-submit {
    display: block;
    width: 100%;
    height: 48px;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 200ms ease;
}

.cw-form-submit:hover {
    background: #333333;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .cw-reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .cw-reviews-global {
        align-items: flex-start;
    }

    .cw-form-row {
        grid-template-columns: 1fr;
    }
}
