/* ── Reviews Grid ─────────────────────────────────────────────────────────── */

.tcr-reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 30px 0 20px;
}

@media (max-width: 900px) {
    .tcr-reviews-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .tcr-reviews-grid { grid-template-columns: 1fr; }
}

/* ── Review Card ──────────────────────────────────────────────────────────── */

.tcr-review-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tcr-review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* Stars (display) */
.tcr-review-stars { display: flex; gap: 2px; }

.tcr-star { font-size: 20px; color: #e0e0e0; line-height: 1; }
.tcr-star.filled { color: #f5c518; }

/* Review body wrapper */
.tcr-review-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

/* Review text — clamped to 5 lines */
.tcr-review-text {
    font-size: 15px;
    line-height: 1.65;
    color: #555;
    font-style: italic;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Read more link */
.tcr-read-more {
    display: none;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: color 0.15s;
    align-self: flex-start;
}

.tcr-read-more:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Show "Read more" only when JS detects overflow */
.tcr-read-more.tcr-visible {
    display: inline-block;
}

/* Author row */
.tcr-review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #f4f4f4;
    margin-top: auto;
}

.tcr-author-name {
    font-weight: 600;
    font-size: 14px;
    color: #222;
    display: flex;
    align-items: center;
}

.tcr-review-date { font-size: 13px; color: #aaa; }

/* No reviews */
.tcr-no-reviews {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
    background: #fafafa;
    border-radius: 10px;
    border: 1px dashed #ddd;
    margin-bottom: 20px;
}

/* ── Write a Review button ────────────────────────────────────────────────── */

.tcr-trigger-wrap,
.tcr-standalone-btn {
    display: flex;
    justify-content: center;
    margin: 28px 0 10px;
}

.tcr-open-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    font-family: inherit;
    letter-spacing: 0.2px;
}

.tcr-open-modal-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

.tcr-open-modal-btn:active {
    transform: translateY(0);
}

/* ── Modal Overlay ────────────────────────────────────────────────────────── */

.tcr-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: tcrFadeIn 0.2s ease;
}

.tcr-modal-overlay.tcr-open {
    display: flex;
}

@keyframes tcrFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal Box ────────────────────────────────────────────────────────────── */

.tcr-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow: hidden;        /* clips scrollbar to rounded corners */
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    animation: tcrSlideUp 0.25s ease;
    position: relative;
}

@keyframes tcrSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Modal Header ─────────────────────────────────────────────────────────── */

.tcr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px 18px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;          /* header never shrinks — always visible at top */
}

.tcr-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
}

.tcr-modal-close {
    background: #f4f4f5;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    font-family: inherit;
}

.tcr-modal-close:hover {
    background: #e4e4e7;
    color: #111;
}

/* ── Modal Body ───────────────────────────────────────────────────────────── */

.tcr-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.tcr-modal-body::-webkit-scrollbar { width: 5px; }
.tcr-modal-body::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}
.tcr-modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
.tcr-modal-body::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ── Modal Footer ─────────────────────────────────────────────────────────── */

.tcr-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    margin-top: 4px;
}

.tcr-footer-centered {
    justify-content: center;
}

/* ── Form ─────────────────────────────────────────────────────────────────── */

.tcr-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 500px) {
    .tcr-form-row { grid-template-columns: 1fr; }
}

.tcr-form-group {
    margin-bottom: 18px;
}

.tcr-form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.tcr-required { color: #e53e3e; }

.tcr-field-note {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Inputs */
.tcr-form input[type="text"],
.tcr-form input[type="email"],
.tcr-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #dde0e4;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.tcr-form input[type="text"]:focus,
.tcr-form input[type="email"]:focus,
.tcr-form textarea:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
}

.tcr-form textarea {
    resize: vertical;
    min-height: 100px;
}

/* ── Star rating input ────────────────────────────────────────────────────── */

.tcr-star-input {
    display: flex;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 4px;
}

.tcr-input-star {
    font-size: 34px;
    color: #ddd;
    transition: color 0.1s, transform 0.1s;
    user-select: none;
    line-height: 1;
}

.tcr-input-star:hover  { transform: scale(1.15); }
.tcr-input-star.selected { color: #f5c518; }

.tcr-rating-label {
    color: #888;
    font-style: italic;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.tcr-submit-btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.tcr-submit-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.tcr-cancel-btn {
    display: inline-block;
    background: transparent;
    color: #666;
    border: 1.5px solid #dde0e4;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.tcr-cancel-btn:hover {
    background: #f4f4f5;
    color: #333;
}

/* ── Notices ──────────────────────────────────────────────────────────────── */

.tcr-notice {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.tcr-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.tcr-error {
    background: #fff5f5;
    color: #9b1c1c;
    border: 1px solid #feb2b2;
}

/* ── Full-review modal header ─────────────────────────────────────────────── */

.tcr-read-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tcr-read-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 2px;
}

.tcr-read-author {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.tcr-read-date {
    font-size: 13px;
    color: #aaa;
}

.tcr-read-full-text {
    font-size: 16px;
    line-height: 1.75;
    color: #444;
    font-style: italic;
    margin: 0;
    white-space: pre-wrap;
}

/* ── Prevent body scroll when modal is open ───────────────────────────────── */

body.tcr-modal-active {
    overflow: hidden;
}
