/* ============================================================
   Ton Atelier — Shop Reviews aggregated section
   Full-width: JS positions this correctly regardless of parent layout.
   Inner content is capped at 1080px and centered.
   ============================================================ */

.tac-reviews {
    /* JS (reviews.js: fitFullWidth) sets margin-left + width dynamically to
       break out of the product-summary column and span the full viewport.
       These are just fallback values. */
    margin: 60px 0 40px;
    padding: 60px 40px;
    background: linear-gradient(180deg, #fbf8f4 0%, #f5f0e8 100%);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #0e0e0e;
    -webkit-font-smoothing: antialiased;
}
.tac-reviews-container {
    max-width: 1080px;
    margin: 0 auto;
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* ─── Header ─── */

.tac-reviews-title {
    margin: 0 0 28px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0e0e0e;
    text-align: center;
}

.tac-reviews-summary {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #ececec;
    align-items: center;
}

.tac-reviews-avg {
    text-align: center;
}
.tac-reviews-avg-number {
    display: block;
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #0e0e0e;
    margin-bottom: 6px;
}
.tac-reviews-avg-stars {
    margin-bottom: 8px;
}
.tac-reviews-avg-meta {
    margin: 0;
    font-size: 13px;
    color: #666;
}
.tac-reviews-avg-meta strong { color: #0e0e0e; }
.tac-reviews-verified-pct {
    margin: 10px 0 0;
    font-size: 12px;
    color: #0f6c3e;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tac-reviews-verified-icon {
    display: inline-block;
    background: #0f6c3e;
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
    font-weight: 900;
}

/* Star rating display */
.tac-stars { display: inline-flex; gap: 2px; line-height: 1; }
.tac-star {
    font-size: 22px;
    line-height: 1;
    display: inline-block;
}
.tac-star-full { color: #f0a020; }
.tac-star-empty { color: #d5d5d5; }
.tac-star-half {
    color: #d5d5d5;
    position: relative;
    display: inline-block;
}
.tac-star-half::before {
    content: '★';
    color: #f0a020;
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
}

/* Distribution bars */
.tac-reviews-distribution {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tac-reviews-dist-row {
    display: grid;
    grid-template-columns: 42px 1fr 32px;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: #555;
}
.tac-reviews-dist-label {
    color: #0e0e0e;
    font-weight: 600;
    text-align: right;
    padding-right: 4px;
}
.tac-reviews-dist-bar {
    height: 8px;
    background: #ececec;
    border-radius: 999px;
    overflow: hidden;
}
.tac-reviews-dist-fill {
    height: 100%;
    background: linear-gradient(90deg, #f0a020 0%, #f5b040 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.tac-reviews-dist-count {
    text-align: right;
    color: #888;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

/* ─── Filters ─── */

.tac-reviews-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.tac-reviews-filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tac-reviews-pill {
    background: #fff;
    border: 1.5px solid #ececec;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    line-height: 1.5;
}
.tac-reviews-pill:hover {
    border-color: #999;
    color: #0e0e0e;
}
.tac-reviews-pill-active {
    background: #0e0e0e;
    border-color: #0e0e0e;
    color: #fff;
}
.tac-reviews-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tac-reviews-sort-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}
.tac-reviews-sort-select {
    background: #fff;
    border: 1.5px solid #ececec;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #0e0e0e;
    cursor: pointer;
}

/* ─── Review cards ─── */

.tac-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tac-review-card {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 20px 22px;
    animation: tac-review-in 0.3s ease-out;
}
@keyframes tac-review-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tac-review-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.tac-review-card-head .tac-star {
    font-size: 18px;
}
.tac-review-verified {
    font-size: 11px;
    font-weight: 700;
    color: #0f6c3e;
    background: #e8f5ea;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tac-review-card-body {
    color: #333;
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 12px;
}
.tac-review-card-body p {
    margin: 0 0 8px;
}
.tac-review-card-body p:last-child { margin-bottom: 0; }
.tac-review-card-foot {
    font-size: 12px;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.tac-review-author { color: #0e0e0e; font-weight: 700; }
.tac-review-sep { color: #ccc; padding: 0 2px; }
.tac-review-product a {
    color: #d18810;
    text-decoration: none;
    font-weight: 600;
}
.tac-review-product a:hover { text-decoration: underline; }

/* ─── Load more ─── */

.tac-reviews-load-more-wrap {
    text-align: center;
    margin-top: 24px;
}
.tac-reviews-load-more {
    background: transparent;
    border: 2px solid #0e0e0e;
    color: #0e0e0e;
    padding: 12px 32px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.tac-reviews-load-more:hover {
    background: #0e0e0e;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.tac-reviews-load-more:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.tac-reviews-loading {
    color: #888;
    font-size: 13px;
    padding: 12px;
}

/* Empty state after filtering */
.tac-reviews-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
    background: #fff;
    border-radius: 12px;
    border: 1px dashed #ececec;
}

/* ─── Mobile ─── */

@media (max-width: 720px) {
    .tac-reviews { margin-top: 40px; margin-bottom: 20px; padding: 40px 16px; }
    .tac-reviews-title { font-size: 22px; margin-bottom: 20px; }
    .tac-reviews-summary {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .tac-reviews-avg-number { font-size: 44px; }
    .tac-reviews-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .tac-reviews-sort { justify-content: flex-end; }
    .tac-review-card { padding: 16px 18px; }
    .tac-review-card-body { font-size: 14px; }
}

/* ─── Title stars — inline rating below product name ─── */

.tac-title-rating {
    margin: 4px 0 12px;
}
.tac-title-rating-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    padding: 4px 0;
    transition: opacity 0.15s;
}
.tac-title-rating-link:hover {
    opacity: 0.75;
    text-decoration: none;
    color: inherit;
}
.tac-title-rating-link .tac-star {
    font-size: 18px;
}
.tac-title-rating-num {
    font-size: 15px;
    font-weight: 700;
    color: #0e0e0e;
    letter-spacing: 0.01em;
}
.tac-title-rating-count {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 1px;
}
.tac-title-rating-link:hover .tac-title-rating-count {
    border-bottom-color: #f0a020;
    color: #d18810;
}

@media (max-width: 480px) {
    .tac-title-rating-link { gap: 6px; }
    .tac-title-rating-link .tac-star { font-size: 15px; }
    .tac-title-rating-num { font-size: 13px; }
    .tac-title-rating-count { font-size: 11px; }
}

/* ─── Write-a-review button + form ─── */

.tac-write-review-btn {
    margin-top: 14px;
    background: #0e0e0e;
    color: #fff;
    border: 2px solid #0e0e0e;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.tac-write-review-btn:hover {
    background: #f0a020;
    border-color: #f0a020;
    color: #0e0e0e;
    box-shadow: 0 4px 12px rgba(240, 160, 32, 0.3);
}

.tac-review-form-wrap {
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    margin-top: 24px;
    border: 1px solid #ececec;
    animation: tac-form-slide 0.25s ease-out;
}
@keyframes tac-form-slide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tac-review-form h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.tac-review-form-lede {
    margin: 0 0 20px;
    font-size: 13px;
    color: #666;
}
.tac-review-form-field {
    margin-bottom: 18px;
}
.tac-review-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}
.tac-review-form-row .tac-review-form-field { margin-bottom: 0; }
.tac-review-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #0e0e0e;
    margin-bottom: 6px;
}
.tac-review-form-field input[type="text"],
.tac-review-form-field input[type="email"],
.tac-review-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d5d5d5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tac-review-form-field input:focus,
.tac-review-form-field textarea:focus {
    outline: none;
    border-color: #0e0e0e;
    box-shadow: 0 0 0 3px rgba(240, 160, 32, 0.15);
}
.tac-review-form-field small {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #888;
}
.tac-review-form-field textarea {
    resize: vertical;
    min-height: 96px;
    font-family: inherit;
    line-height: 1.5;
}

/* Star rating input */
.tac-star-input {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.tac-star-input-btn {
    background: transparent;
    border: none;
    padding: 4px 2px;
    font-size: 32px;
    line-height: 1;
    color: #d5d5d5;
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
    font-family: inherit;
}
.tac-star-input-btn:hover {
    transform: scale(1.15);
}
.tac-star-input-btn.tac-star-active {
    color: #f0a020;
}

.tac-review-form-loggedin {
    font-size: 13px;
    color: #666;
    padding: 10px 14px;
    background: #fafafa;
    border-radius: 8px;
    margin: 0 0 18px;
}

.tac-review-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ececec;
}
.tac-review-form-cancel {
    background: transparent;
    border: 2px solid transparent;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}
.tac-review-form-cancel:hover { color: #0e0e0e; }
.tac-review-form-submit {
    background: #0e0e0e;
    color: #fff;
    border: 2px solid #0e0e0e;
    padding: 10px 24px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.tac-review-form-submit:hover {
    background: #f0a020;
    border-color: #f0a020;
    color: #0e0e0e;
    box-shadow: 0 4px 12px rgba(240, 160, 32, 0.3);
}
.tac-review-form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tac-review-form-status {
    margin-top: 12px;
    padding: 0;
    font-size: 13px;
}
.tac-review-form-status.tac-form-error {
    color: #d12d2d;
    padding: 10px 14px;
    background: #fff4f4;
    border-radius: 8px;
    border-left: 3px solid #d12d2d;
}
.tac-review-form-status.tac-form-success {
    color: #0f6c3e;
    padding: 10px 14px;
    background: #e8f5ea;
    border-radius: 8px;
    border-left: 3px solid #0f6c3e;
}

@media (max-width: 640px) {
    .tac-review-form-wrap { padding: 20px 18px; }
    .tac-review-form-row { grid-template-columns: 1fr; }
    .tac-review-form-actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
    .tac-review-form-cancel,
    .tac-review-form-submit { width: 100%; text-align: center; }
}

/* ─── Write-review hint (when not eligible) ─── */

.tac-write-review-hint {
    margin-top: 14px;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
}
.tac-write-review-hint a {
    color: #d18810;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed #d18810;
    padding-bottom: 1px;
}
.tac-write-review-hint a:hover {
    color: #0e0e0e;
    border-bottom-color: #0e0e0e;
}
.tac-hint-thanks {
    color: #0f6c3e;
    font-weight: 600;
}
