/*
 * ECO-4855 — review system styles
 *
 * Scope:
 *   - /review.php landing page (.review-landing)
 *   - Account order-details QR block (.eco4855-review-qr)
 *   - Account order-details Mark-as-Received form (.eco4855-mark-received)
 *   - Inline Write/Edit Review forms (.eco4855-inline-form)
 *   - Inline toggle button (.btn-review-toggle)
 *   - Printable-invoice QR (.eco4855-invoice-qr)
 */

/* =========================================================================
   Landing page container
   ========================================================================= */
.review-landing {
    max-width: 760px;
    margin: 32px auto;
    padding: 0 16px;
    font-family: 'Lato', Arial, sans-serif;
    color: #222;
}

/* --- header --------------------------------------------------------------
   Note: skin1_hifi/css/header.css line 183 has a global `header { background:
   #E8E8E8 }` rule that paints every <header> element on the page. We override
   it back to transparent here. Same story with h1: general.css line 57 sets
   all headings to blue (#1B6CCB) — we restore the dark grey we want.
*/
.review-landing-header {
    background: transparent;
    border-bottom: 1px solid #e8e8e8;
    padding: 0 0 16px;
    margin: 0 0 24px;
}

.review-landing-header h1,
.review-landing .review-landing-state h2,
.review-landing-item-title {
    color: #111;
    font-family: 'Lato', Arial, sans-serif;
}

.review-landing-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.2;
}

.review-landing-orderno {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.review-landing-intro {
    font-size: 15px;
    line-height: 1.5;
    color: #555;
    margin: 0;
}

/* --- expired / invalid state -------------------------------------------- */
.review-landing-state {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 28px;
    text-align: center;
}

.review-landing-state h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #111;
}

.review-landing-state p {
    font-size: 14px;
    color: #555;
    margin: 0 0 16px;
}

.review-landing-resend {
    margin-top: 12px;
}

/* --- product list -------------------------------------------------------- */
.review-landing-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: review-step;
}

.review-landing-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 20px;
    margin: 0 0 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.review-landing-item-thumb {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    background: #f6f6f6;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-landing-item-thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.review-landing-item-content {
    flex: 1 1 auto;
    min-width: 0;
}

.review-landing-item-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 14px;
    color: #222;
    line-height: 1.35;
    word-wrap: break-word;
}

/* =========================================================================
   Per-product review form (landing + inline variants share styles)
   ========================================================================= */
.review-form-token,
.review-form-inline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-form-token label,
.review-form-inline label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    gap: 4px;
}

.review-form-token select,
.review-form-token input[type="text"],
.review-form-token textarea,
.review-form-inline select,
.review-form-inline input[type="text"],
.review-form-inline textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #222;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.review-form-token select:focus,
.review-form-token input[type="text"]:focus,
.review-form-token textarea:focus,
.review-form-inline select:focus,
.review-form-inline input[type="text"]:focus,
.review-form-inline textarea:focus {
    border-color: #1B6CCB;
    outline: none;
    box-shadow: 0 0 0 3px rgba(69, 138, 184, 0.15);
}

.review-form-token textarea,
.review-form-inline textarea {
    resize: vertical;
    min-height: 80px;
}

.review-form-token select,
.review-form-inline select {
    max-width: 160px;
}

/* --- star rating picker (replaces the rating <select>) ------------------ */
.review-form-token .review-rating-field,
.review-form-inline .review-rating-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.review-rating-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    font-size: 40px;
    line-height: 1;
    user-select: none;
}

/* Keep radios in the DOM so `required` validation can focus them, but hide
   them visually. display:none would strip them from the a11y tree and from
   native form-validation focus. */
.review-rating-stars input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.review-rating-stars label {
    display: inline-block;
    /* Override `.review-form-token label { font-size: 13px }` above so the
       star picks up the 40px set on .review-rating-stars. */
    font-size: inherit;
    line-height: 1;
    color: #d0d0d0;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.1s ease;
}

/* Row-reverse: a checked input's following DOM siblings are the stars to
   its visual LEFT — the ones we want filled. */
.review-rating-stars label:hover,
.review-rating-stars label:hover ~ label,
.review-rating-stars input[type="radio"]:checked ~ label {
    color: #f5a623;
}

.review-rating-stars input[type="radio"]:focus-visible + label {
    outline: 2px solid #1B6CCB;
    outline-offset: 2px;
    border-radius: 2px;
}

.review-form-token button[type="submit"],
.review-form-inline button[type="submit"] {
    align-self: flex-start;
    background: #1B6CCB;
    color: #fff;
    border: 0;
    border-radius: 4px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.review-form-token button[type="submit"]:hover,
.review-form-inline button[type="submit"]:hover {
    background: #124a8a;
}

.review-form-inline .btn-link {
    background: none;
    border: 0;
    color: #666;
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.review-form-inline .btn-link:hover {
    color: #222;
}

/* =========================================================================
   QR block (account order details)
   ========================================================================= */
.eco4855-review-qr {
    background: #fafafa;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 20px;
    margin: 16px 0;
    text-align: center;
}

.eco4855-review-qr h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #111;
    font-family: 'Lato', Arial, sans-serif;
}

.eco4855-review-qr p {
    font-size: 13px;
    color: #555;
    margin: 0 0 12px;
}

.eco4855-review-qr img {
    display: block;
    margin: 0 auto 12px;
    width: 180px;
    height: 180px;
}

.eco4855-review-qr .btn,
.eco4855-review-qr a.btn-primary {
    display: inline-block;
    background: #1B6CCB;
    color: #fff;
    padding: 10px 22px;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
}

.eco4855-review-qr .btn:hover,
.eco4855-review-qr a.btn-primary:hover {
    background: #134e92;
    color: #fff;
}

/* =========================================================================
   Mark-as-Received button on account order details
   ========================================================================= */
.eco4855-mark-received {
    margin: 12px 0 20px;
}

.eco4855-mark-received button {
    background: #fff;
    color: #1B6CCB;
    border: 1px solid #3984da;
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.eco4855-mark-received button:hover {
    background: #144e91;
    color: #fff;
}

/* =========================================================================
   Per-product Write/Edit toggle button + inline form
   ========================================================================= */
.btn-review-toggle {
    background: #fff;
    color: #1B6CCB;
    border: 1px solid #1B6CCB;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
    margin: 8px 0;
}

.btn-review-toggle:hover {
    background: #1B6CCB;
    color: #fff;
}

.eco4855-inline-form {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px;
    margin: 8px 0;
}

/* =========================================================================
   Already-reviewed read-only display (landing page)
   ========================================================================= */
.review-already-submitted {
    background: #f3f8f4;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    padding: 14px 16px;
}

.review-already-label {
    margin: 0 0 10px;
    font-size: 14px;
    color: #2e7d32;
}

.review-already-rating {
    font-size: 18px;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.review-already-rating .star-filled {
    color: #f5a623;
}

.review-already-rating .star-empty {
    color: #d0d0d0;
}

.review-already-title {
    margin: 4px 0;
    font-size: 15px;
    color: #222;
}

.review-already-text {
    margin: 4px 0 0;
    color: #444;
    line-height: 1.5;
    font-size: 14px;
    white-space: pre-wrap;
}

/* =========================================================================
   "Reviewed" badge on the account order-details product row
   ========================================================================= */
.review-already-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    margin: 8px 0;
    cursor: default;
}

/* =========================================================================
   Printable-invoice QR
   ========================================================================= */
.eco4855-invoice-qr {
    text-align: center;
    margin-top: 24px;
    page-break-inside: avoid;
}

.eco4855-invoice-qr p {
    margin: 6px 0;
}

.eco4855-invoice-qr p:first-child {
    font-weight: 700;
    font-size: 14px;
}

.eco4855-invoice-qr img {
    width: 160px;
    height: 160px;
    margin: 6px 0;
}

.eco4855-invoice-qr p:last-child {
    font-size: 11px;
    color: #666;
    word-break: break-all;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 640px) {
    .review-landing {
        margin: 16px auto;
    }

    .review-landing-header h1 {
        font-size: 22px;
    }

    .review-landing-state h2 {
        font-size: 19px;
    }

    .review-landing-item {
        flex-direction: column;
        padding: 16px;
        gap: 14px;
    }

    .review-landing-item-thumb {
        flex: 0 0 auto;
        width: 100%;
        height: 200px;
    }

    .review-landing-item-thumb img {
        max-height: 200px;
    }

    .eco4855-review-qr img {
        width: 140px;
        height: 140px;
    }
}
