/**
 * Avatex post-purchase review request — public page styles.
 *
 * Visual language: same monochrome Apple-style as the existing
 * customer-order-shipped-classic.php email and returns pages.
 */

/* ─────────────────────────────────────────────────────
 * Theme chrome suppression on review pages
 * ─────────────────────────────────────────────────────
 * Hide competing theme elements (page title + breadcrumb) when the
 * shortcode is active. The plugin owns the page identity here — the
 * customer sees our brand header + greeting, not a redundant
 * "LASĂ REVIEW" + "Home > Lasă review" trail.
 */
.avatex-reviews-active .breadcrumbs-container,
.avatex-reviews-active .breadcrumbs-wrapper,
.avatex-reviews-active .heading-title.page-title,
.avatex-reviews-active .entry-title.page-title,
.avatex-reviews-active .page-title-wrapper,
.avatex-reviews-active .woocommerce-breadcrumb,
.avatex-reviews-active .yoast-breadcrumbs {
    display: none !important;
}

/* Tighten the container so our page starts close to the header */
.avatex-reviews-active #main-content,
.avatex-reviews-active .page-container {
    padding-top: 0 !important;
}

.avatex-reviews-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 32px 16px 64px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    color: #1d1d1f;
    -webkit-font-smoothing: antialiased;
}

.avatex-reviews-header {
    text-align: center;
    margin-bottom: 36px;
}

.avatex-reviews-brand {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #1d1d1f;
    margin-bottom: 18px;
}

.avatex-reviews-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.4px;
    line-height: 1.2;
    margin: 0 0 12px;
    color: #1d1d1f;
}

.avatex-reviews-sub {
    font-size: 15px;
    line-height: 1.6;
    color: #6e6e73;
    margin: 0;
}

/* Per-product card */
.avatex-reviews-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.avatex-review-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 200ms ease;
}

.avatex-review-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.avatex-review-card__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.avatex-review-card__img {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    background: #f5f5f7;
    flex-shrink: 0;
}

.avatex-review-card__meta {
    flex: 1;
    min-width: 0;
}

.avatex-review-card__name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 4px;
}

.avatex-review-card__name:hover {
    color: #0071e3;
    text-decoration: underline;
}

.avatex-review-card__hint {
    font-size: 12px;
    color: #86868b;
}

/* Stars — radio buttons styled as clickable stars (RTL flexbox trick for hover spread) */
.avatex-review-card__stars {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 4px;
    margin-bottom: 14px;
    /* Reset native fieldset chrome — semantic stays, visual matches the rest */
    border: 0;
    padding: 0;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    min-width: 0;
}

/* Visually hidden but available to screen readers */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.avatex-review-card__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.avatex-review-card__star {
    cursor: pointer;
    color: #e5e5e7;
    transition: color 100ms ease, transform 100ms ease;
    display: inline-flex;
    line-height: 0;
}

.avatex-review-card__star:hover,
.avatex-review-card__star:hover ~ .avatex-review-card__star,
.avatex-review-card__radio:focus + .avatex-review-card__star {
    color: #ffd60a;
}

.avatex-review-card__star:hover {
    transform: scale(1.1);
}

.avatex-review-card__radio:checked + .avatex-review-card__star,
.avatex-review-card__radio:checked + .avatex-review-card__star ~ .avatex-review-card__star {
    color: #ffd60a;
}

.avatex-review-card__text {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #1d1d1f;
    background: #fafafa;
    resize: vertical;
    min-height: 84px;
    transition: border-color 150ms ease, background 150ms ease;
}

.avatex-review-card__text:focus {
    outline: none;
    border-color: #0071e3;
    background: #fff;
}

.avatex-review-card__text::placeholder {
    color: #a1a1a6;
}

/* Photo uploader */
.avatex-review-card__photos {
    margin-top: 14px;
}

.avatex-review-card__photos-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #0071e3;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 150ms ease;
    user-select: none;
}

.avatex-review-card__photos-btn:hover {
    background: rgba(0, 113, 227, 0.08);
}

.avatex-review-card__photos-hint {
    color: #86868b;
    font-weight: 400;
    font-size: 12px;
}

.avatex-review-card__photos-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.avatex-review-card__photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.avatex-review-photo-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f7;
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.avatex-review-photo-thumb--loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f7;
    position: relative;
}

.avatex-review-photo-thumb--loading::before {
    content: '';
    width: 22px;
    height: 22px;
    border: 2px solid #e5e5e7;
    border-top-color: #0071e3;
    border-radius: 50%;
    animation: avatex-review-spin 0.7s linear infinite;
}

@keyframes avatex-review-spin {
    to { transform: rotate(360deg); }
}

.avatex-review-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatex-review-photo-thumb__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(29, 29, 31, 0.85);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    transition: background 150ms ease;
}

.avatex-review-photo-thumb__remove:hover {
    background: #ff3b30;
}

.avatex-review-card__photos-error {
    color: #ff3b30;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

/* EU disclosure badge on incentivized reviews (product page) */
.avatex-review-incentive-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f5f5f7;
    color: #6e6e73;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 9px;
    border-radius: 12px;
    margin: 8px 0 4px;
    cursor: help;
    line-height: 1.2;
}

.avatex-review-incentive-badge svg {
    flex-shrink: 0;
    color: #86868b;
}

/* Photos rendered under WooCommerce product-page reviews */
.avatex-review-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 4px;
}

.avatex-review-photos__item {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f7;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.avatex-review-photos__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.avatex-review-photos__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Footer + submit */
.avatex-reviews-footer {
    text-align: center;
    margin-top: 28px;
}

.avatex-reviews-submit {
    background: #1d1d1f;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px 40px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    font-family: inherit;
    transition: background 150ms ease, transform 100ms ease;
}

.avatex-reviews-submit:hover {
    background: #0071e3;
}

.avatex-reviews-submit:active {
    transform: scale(0.98);
}

.avatex-reviews-disclaimer {
    font-size: 12px;
    color: #86868b;
    margin: 12px 0 0;
}

.avatex-reviews-help {
    font-size: 13px;
    color: #6e6e73;
    margin: 20px 0 0;
}

.avatex-reviews-help a {
    color: #1d1d1f;
    text-decoration: underline;
}

/* State cards (invalid / expired / completed) */
.avatex-review-state,
.avatex-reviews-state {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    max-width: 480px;
    margin: 0 auto;
}

.avatex-review-state__icon,
.avatex-reviews-state__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    background: #f5f5f7;
    color: #86868b;
}

.avatex-review-state--success .avatex-review-state__icon,
.avatex-reviews-state--success .avatex-reviews-state__icon {
    background: rgba(52, 199, 89, 0.12);
    color: #34c759;
}

.avatex-review-state--error .avatex-review-state__icon {
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
}

.avatex-review-state__title,
.avatex-reviews-state__title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 10px;
    letter-spacing: -0.3px;
    color: #1d1d1f;
}

.avatex-review-state__msg,
.avatex-reviews-state__msg {
    font-size: 15px;
    line-height: 1.6;
    color: #6e6e73;
    margin: 0;
}

.avatex-reviews-state__hint {
    font-size: 13px;
    color: #86868b;
    margin: 16px 0 0;
}

.avatex-review-state__msg a,
.avatex-reviews-state__msg a {
    color: #0071e3;
    text-decoration: none;
}

.avatex-review-state__msg a:hover,
.avatex-reviews-state__msg a:hover {
    text-decoration: underline;
}

/* Thank-you page */
.avatex-reviews-page--thanks .avatex-reviews-header {
    margin-bottom: 24px;
}

.avatex-reviews-thanks__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(52, 199, 89, 0.12);
    color: #34c759;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 16px;
}

/* Reviews summary card */
.avatex-reviews-summary {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.avatex-reviews-summary__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #f5f5f7;
}

.avatex-reviews-summary__count {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: 0.2px;
}

.avatex-reviews-summary__avg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.avatex-reviews-summary__avg-num {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    margin-left: 6px;
}

.avatex-reviews-summary__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.avatex-reviews-summary__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f7;
}

.avatex-reviews-summary__item:last-child {
    border-bottom: 0;
}

.avatex-reviews-summary__product {
    font-size: 14px;
    color: #1d1d1f;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.avatex-reviews-summary__product:hover {
    color: #0071e3;
    text-decoration: underline;
}

.avatex-reviews-summary__rating {
    display: inline-flex;
    gap: 2px;
    flex-shrink: 0;
}

/* Coupon card */
.avatex-reviews-coupon {
    background: linear-gradient(135deg, #1d1d1f 0%, #2a2a2c 100%);
    color: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.avatex-reviews-coupon--pending {
    background: #f5f5f7;
    color: #6e6e73;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.avatex-reviews-coupon__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.avatex-reviews-coupon__code {
    font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 12px;
}

.avatex-reviews-coupon__hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.avatex-reviews-coupon--pending .avatex-reviews-coupon__hint {
    color: #6e6e73;
    font-size: 13px;
}

/* Google CTA card */
.avatex-reviews-google {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.avatex-reviews-google__head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.avatex-reviews-google__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.2px;
}

.avatex-reviews-google__msg {
    margin: 0;
    font-size: 13px;
    color: #6e6e73;
    line-height: 1.5;
}

.avatex-reviews-google__cta {
    display: inline-block;
    background: #4285F4;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    transition: background 150ms ease, transform 100ms ease;
}

.avatex-reviews-google__cta:hover {
    background: #1a73e8;
    color: #fff;
}

.avatex-reviews-google__cta:active {
    transform: scale(0.98);
}

.avatex-reviews-google__toast {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(52, 199, 89, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.28);
    border-radius: 8px;
    font-size: 12px;
    color: #1d1d1f;
    line-height: 1.5;
    animation: avatex-reviews-fade-in 0.25s ease-out;
}

@keyframes avatex-reviews-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.avatex-reviews-thanks__footer {
    text-align: center;
    margin-top: 28px;
}

.avatex-reviews-thanks__shop-link {
    font-size: 13px;
    color: #6e6e73;
    text-decoration: none;
}

.avatex-reviews-thanks__shop-link:hover {
    color: #1d1d1f;
    text-decoration: underline;
}

/* Mobile tweaks */
@media (max-width: 540px) {
    .avatex-reviews-page {
        padding: 20px 12px 48px;
    }
    .avatex-reviews-title {
        font-size: 23px;
    }
    .avatex-review-card {
        padding: 16px 18px;
    }
    .avatex-review-card__img {
        width: 60px;
        height: 60px;
    }
    .avatex-review-card__star svg {
        width: 28px;
        height: 28px;
    }
}
