/*
 * Zehoro Toolkit Pro — Frontend Block Styles
 * Covers: ReviewBox, ProductBox, ProductRoundup, ComparisonTable,
 *         VersusBox, ProductVerdict, CouponBox + editor chrome.
 */

/* ============================================================
   CSS Custom Property fallbacks
   (the free plugin sets these on :root; these are safety nets)
   ============================================================ */
:root {
    --zehoro-primary-color:    #E8A020;
    --zehoro-primary-contrast: #0F1A2E;
    --zehoro-secondary-color:  #1ECFC4;
    --zehoro-text-main:        #3D3730;
    --zehoro-text-muted:       #8A8478;
    --zehoro-border-light:     rgba(15, 26, 46, 0.10);
    --zehoro-radius:           8px;
    --zehoro-spacing:          1.5em;
}

/* ============================================================
   Shared utilities
   ============================================================ */

/* Stars */
.zehoro-star {
    display: inline-block;
    font-size: 1em;
    line-height: 1;
    color: #ddd;
}
.zehoro-star.is-filled {
    color: var(--zehoro-primary-color);
}
.zehoro-star.is-half {
    /* CSS-only half-star via gradient mask */
    background: linear-gradient(
        90deg,
        var(--zehoro-primary-color) 50%,
        #ddd 50%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Score badge */
.zehoro-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width:  3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--zehoro-primary-color);
    color: var(--zehoro-primary-contrast);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.zehoro-score-badge--lg {
    width:  4rem;
    height: 4rem;
    font-size: 1.4rem;
}

/* Buttons */
.zehoro-btn {
    display: inline-block;
    padding: 0.6em 1.4em;
    border-radius: var(--zehoro-radius);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
    border: 2px solid transparent;
    white-space: nowrap;
}
.zehoro-btn:hover {
    opacity: 0.88;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.zehoro-btn--primary {
    background: var(--zehoro-primary-color);
    color: var(--zehoro-primary-contrast);
    border-color: var(--zehoro-primary-color);
}
.zehoro-btn--secondary {
    background: transparent;
    color: var(--zehoro-primary-color);
    border-color: var(--zehoro-primary-color);
}
.zehoro-btn--sm {
    padding: 0.4em 1em;
    font-size: 0.85rem;
}

/* Pros / Cons shared */
.zehoro-pros ul,
.zehoro-cons ul {
    list-style: none;
    padding: 0;
    margin: 0.5em 0 0;
}
.zehoro-pros ul li,
.zehoro-cons ul li {
    padding: 0.25em 0 0.25em 1.6em;
    position: relative;
    font-size: 0.92rem;
    color: var(--zehoro-text-main);
}
.zehoro-pros ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--zehoro-secondary-color);
    font-weight: 700;
}
.zehoro-cons ul li::before {
    content: "✗";
    position: absolute;
    left: 0;
    color: #e05252;
    font-weight: 700;
}

.zehoro-pros-cons__heading {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    padding-bottom: 0.3em;
    border-bottom: 2px solid var(--zehoro-border-light);
}
.zehoro-pros-cons__heading--pros {
    color: var(--zehoro-secondary-color);
}
.zehoro-pros-cons__heading--cons {
    color: #e05252;
}


/* ============================================================
   1. Review Box
   ============================================================ */

.zehoro-review-box {
    border: 1px solid var(--zehoro-border-light);
    border-radius: var(--zehoro-radius);
    padding: var(--zehoro-spacing);
    font-family: inherit;
    color: var(--zehoro-text-main);
    overflow: hidden;
}

/* Header */
.zehoro-review-box__header {
    display: flex;
    align-items: flex-start;
    gap: 1.25em;
    margin-bottom: 1.25em;
}
.zehoro-review-box__image {
    flex-shrink: 0;
    width: 120px;
}
.zehoro-review-box__image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: contain;
}
.zehoro-review-box__header-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}
.zehoro-review-box__product-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--zehoro-text-main);
}
.zehoro-review-box__price {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--zehoro-primary-color);
}

/* Summary */
.zehoro-review-box__summary {
    margin-bottom: 1.25em;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--zehoro-text-muted);
}
.zehoro-review-box__summary p {
    margin: 0;
}

/* Criteria bars */
.zehoro-review-box__criteria {
    margin-bottom: 1.25em;
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}
.zehoro-criterion-bar__label {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.25em;
}
.zehoro-criterion-bar__score {
    color: var(--zehoro-primary-color);
}
.zehoro-criterion-bar__track {
    height: 6px;
    background: var(--zehoro-border-light);
    border-radius: 3px;
    overflow: hidden;
}
.zehoro-criterion-bar__fill {
    height: 100%;
    background: var(--zehoro-primary-color);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.zehoro-criterion-bar__stars {
    margin-top: 0.3em;
    font-size: 0.8rem;
}

/* Pros / Cons layout for ReviewBox */
.zehoro-review-box__pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;
    margin-bottom: 1.25em;
}

/* CTA buttons */
.zehoro-review-box__cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em;
    margin-bottom: 1.25em;
}

/* Verdict strip */
.zehoro-review-box__verdict {
    display: flex;
    align-items: flex-start;
    gap: 0.75em;
    background: rgba(232, 160, 32, 0.08);
    border-left: 4px solid var(--zehoro-primary-color);
    border-radius: 0 var(--zehoro-radius) var(--zehoro-radius) 0;
    padding: 0.75em 1em;
    margin-top: 0.25em;
}
.zehoro-review-box__verdict-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--zehoro-primary-color);
    flex-shrink: 0;
    margin-top: 0.15em;
}
.zehoro-review-box__verdict-text {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--zehoro-text-main);
}


/* ============================================================
   2. Product Box
   ============================================================ */

.zehoro-product-box {
    position: relative;
    border: 1px solid var(--zehoro-border-light);
    border-radius: var(--zehoro-radius);
    overflow: hidden;
    text-align: center;
    background: #fff;
}
.zehoro-product-box__badge {
    position: absolute;
    top: 0.75em;
    right: 0.75em;
    background: var(--zehoro-primary-color);
    color: var(--zehoro-primary-contrast);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25em 0.6em;
    border-radius: 3px;
    z-index: 1;
}
.zehoro-product-box__image {
    padding: 1em 1em 0;
}
.zehoro-product-box__image img {
    max-width: 100%;
    height: 160px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.zehoro-product-box__body {
    padding: 1em 1.25em 1.25em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}
.zehoro-product-box__name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--zehoro-text-main);
}
.zehoro-product-box__stars {
    font-size: 1rem;
}
.zehoro-product-box__price {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--zehoro-primary-color);
}
.zehoro-product-box__pros {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    width: 100%;
}
.zehoro-product-box__pros li {
    font-size: 0.87rem;
    padding: 0.2em 0 0.2em 1.4em;
    position: relative;
    color: var(--zehoro-text-main);
}
.zehoro-product-box__pros li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--zehoro-secondary-color);
    font-weight: 700;
}

/* Rank badges */
.zehoro-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    margin: 0.75em auto 0;
}
.zehoro-rank-badge--1 { background: #FFD700; color: #4a3800; }
.zehoro-rank-badge--2 { background: #C0C0C0; color: #2c2c2c; }
.zehoro-rank-badge--3 { background: #CD7F32; color: #fff; }


/* ============================================================
   3. Product Roundup
   ============================================================ */

.zehoro-product-roundup__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 1em;
    color: var(--zehoro-text-main);
}
.zehoro-product-roundup__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25em;
}
.zehoro-product-roundup--top3 .zehoro-product-box:first-child {
    border-color: #FFD700;
}


/* ============================================================
   4. Comparison Table
   ============================================================ */

.zehoro-comparison-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--zehoro-border-light);
    border-radius: var(--zehoro-radius);
}
.zehoro-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    color: var(--zehoro-text-main);
    min-width: 480px;
}
.zehoro-comparison-table th,
.zehoro-comparison-table td {
    padding: 0.75em 1em;
    text-align: center;
    border-bottom: 1px solid var(--zehoro-border-light);
    vertical-align: middle;
}
.zehoro-comparison-table thead th {
    background: #f8f8f8;
    font-weight: 700;
    vertical-align: bottom;
}
.zehoro-comparison-table__label-col,
.zehoro-comparison-table__criterion {
    text-align: left;
    font-weight: 600;
    background: #fafafa;
    color: var(--zehoro-text-muted);
    font-size: 0.85rem;
}
.zehoro-comparison-table__product-col.is-highlighted,
.zehoro-comparison-table td.is-highlighted {
    background: rgba(232, 160, 32, 0.06);
    border-left: 2px solid var(--zehoro-primary-color);
    border-right: 2px solid var(--zehoro-primary-color);
}
.zehoro-comparison-table thead th.is-highlighted {
    background: rgba(232, 160, 32, 0.12);
    border-left: 2px solid var(--zehoro-primary-color);
    border-right: 2px solid var(--zehoro-primary-color);
    border-top: 3px solid var(--zehoro-primary-color);
}
.zehoro-comparison-table__product-img {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin: 0 auto 0.5em;
}
.zehoro-comparison-table__product-name {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25em;
}
.zehoro-comparison-table__product-price {
    display: block;
    color: var(--zehoro-primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5em;
}
.zehoro-comparison-table tbody tr:last-child td,
.zehoro-comparison-table tbody tr:last-child th {
    border-bottom: none;
}

/* Cell value symbols */
.zehoro-cell--yes {
    color: var(--zehoro-secondary-color);
    font-size: 1.1rem;
    font-weight: 700;
}
.zehoro-cell--no {
    color: #e05252;
    font-size: 1.1rem;
    font-weight: 700;
}


/* ============================================================
   5. Versus Box
   ============================================================ */

.zehoro-versus-box {
    border: 1px solid var(--zehoro-border-light);
    border-radius: var(--zehoro-radius);
    overflow: hidden;
    font-size: 0.93rem;
    color: var(--zehoro-text-main);
}

/* Product header row */
.zehoro-versus-box__header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0;
    background: #f9f9f9;
    border-bottom: 1px solid var(--zehoro-border-light);
}
.zehoro-versus-box__product {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25em 1em;
    text-align: center;
    gap: 0.4em;
}
.zehoro-versus-box__product--left {
    border-right: 1px solid var(--zehoro-border-light);
}
.zehoro-versus-box__product--right {
    border-left: 1px solid var(--zehoro-border-light);
}
.zehoro-versus-box__product.is-winner {
    background: rgba(232, 160, 32, 0.06);
}
.zehoro-versus-box__product-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
}
.zehoro-versus-box__product-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}
.zehoro-versus-box__product-price {
    font-size: 0.9rem;
    color: var(--zehoro-primary-color);
    font-weight: 600;
}
.zehoro-versus-box__vs {
    padding: 0 0.75em;
    font-size: 1rem;
    font-weight: 900;
    color: var(--zehoro-text-muted);
    text-align: center;
    flex-shrink: 0;
}

/* Feature rows */
.zehoro-versus-box__features {
    display: flex;
    flex-direction: column;
}
.zehoro-versus-box__features-header,
.zehoro-versus-box__feature-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    border-bottom: 1px solid var(--zehoro-border-light);
}
.zehoro-versus-box__features-header {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--zehoro-text-muted);
    background: #f9f9f9;
}
.zehoro-versus-box__feature-row:last-child {
    border-bottom: none;
}
.zehoro-versus-box__feature-label,
.zehoro-versus-box__feature-val {
    padding: 0.6em 1em;
    vertical-align: middle;
}
.zehoro-versus-box__feature-label {
    font-weight: 600;
    color: var(--zehoro-text-main);
    font-size: 0.88rem;
}
.zehoro-versus-box__feature-val {
    text-align: center;
    font-size: 0.88rem;
    color: var(--zehoro-text-main);
}
.zehoro-versus-box__feature-row:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* Winner banner */
.zehoro-versus-winner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
    padding: 0.75em 1.25em;
    background: var(--zehoro-primary-color);
    color: var(--zehoro-primary-contrast);
    font-size: 0.92rem;
}
.zehoro-versus-winner__label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.zehoro-versus-winner__name {
    font-weight: 700;
    font-size: 1rem;
}
.zehoro-versus-winner__reason {
    font-size: 0.88rem;
    opacity: 0.85;
    flex-basis: 100%;
}


/* ============================================================
   6. Product Verdict
   ============================================================ */

.zehoro-product-verdict {
    border: 1px solid var(--zehoro-border-light);
    border-radius: var(--zehoro-radius);
    padding: var(--zehoro-spacing);
    color: var(--zehoro-text-main);
}

.zehoro-product-verdict__header {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-bottom: 1em;
}
.zehoro-product-verdict__header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4em;
}
.zehoro-product-verdict__image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}
.zehoro-product-verdict__name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--zehoro-text-main);
}
.zehoro-product-verdict__text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--zehoro-text-muted);
    margin-bottom: 1em;
}
.zehoro-product-verdict__pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;
    margin-bottom: 1em;
}
.zehoro-product-verdict__cta {
    margin-top: 0.25em;
}


/* ============================================================
   7. Coupon Box
   ============================================================ */

.zehoro-coupon-box {
    border: 2px dashed var(--zehoro-primary-color);
    border-radius: var(--zehoro-radius);
    overflow: hidden;
    position: relative;
    font-size: 0.93rem;
    color: var(--zehoro-text-main);
    background: #fff;
}
.zehoro-coupon-box--minimal {
    border-style: solid;
    border-width: 1px;
    border-color: var(--zehoro-border-light);
}

/* Discount badge */
.zehoro-coupon-box__discount-badge {
    background: var(--zehoro-primary-color);
    color: var(--zehoro-primary-contrast);
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    padding: 0.5em 1em;
    letter-spacing: 0.02em;
}

/* Body layout */
.zehoro-coupon-box__body {
    display: flex;
    align-items: flex-start;
    gap: 1em;
    padding: 1.25em;
}
.zehoro-coupon-box__image {
    flex-shrink: 0;
    width: 90px;
}
.zehoro-coupon-box__image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}
.zehoro-coupon-box__content {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    flex: 1;
    min-width: 0;
}
.zehoro-coupon-box__product-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--zehoro-text-main);
}
.zehoro-coupon-box__description {
    font-size: 0.88rem;
    color: var(--zehoro-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Coupon code ticket */
.zehoro-coupon-code {
    display: inline-flex;
    align-items: stretch;
    border: 2px dashed var(--zehoro-primary-color);
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
}
.zehoro-coupon-code__text {
    padding: 0.4em 0.8em;
    font-family: monospace, monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    background: rgba(232, 160, 32, 0.08);
    color: var(--zehoro-primary-color);
    flex: 1;
    min-width: 0;
    word-break: break-all;
}
.zehoro-coupon-code__copy-btn {
    padding: 0.4em 0.9em;
    background: var(--zehoro-primary-color);
    color: var(--zehoro-primary-contrast);
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}
.zehoro-coupon-code__copy-btn:hover {
    opacity: 0.88;
}

/* Expires note */
.zehoro-coupon-box__expires {
    font-size: 0.8rem;
    color: var(--zehoro-text-muted);
    margin: 0;
}


/* ============================================================
   Responsive — stack everything below 640px
   ============================================================ */

@media (max-width: 640px) {

    /* Review Box */
    .zehoro-review-box__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .zehoro-review-box__image {
        width: 100%;
        max-width: 200px;
    }
    .zehoro-review-box__pros-cons {
        grid-template-columns: 1fr;
    }
    .zehoro-review-box__cta-buttons {
        flex-direction: column;
    }
    .zehoro-review-box__verdict {
        flex-direction: column;
        gap: 0.4em;
    }

    /* Product Box */
    .zehoro-product-roundup__list {
        grid-template-columns: 1fr;
    }

    /* Comparison Table — let it scroll horizontally; min-width handles readability */

    /* Versus Box */
    .zehoro-versus-box__header {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    .zehoro-versus-box__product--left {
        border-right: none;
        border-bottom: 1px solid var(--zehoro-border-light);
    }
    .zehoro-versus-box__product--right {
        border-left: none;
        border-top: 1px solid var(--zehoro-border-light);
    }
    .zehoro-versus-box__vs {
        padding: 0.5em;
    }
    .zehoro-versus-box__features-header,
    .zehoro-versus-box__feature-row {
        grid-template-columns: 1fr 1fr 1fr;
        font-size: 0.8rem;
    }

    /* Product Verdict */
    .zehoro-product-verdict__header {
        flex-direction: column;
        align-items: flex-start;
    }
    .zehoro-product-verdict__pros-cons {
        grid-template-columns: 1fr;
    }

    /* Coupon Box */
    .zehoro-coupon-box__body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .zehoro-coupon-box__image {
        width: 120px;
    }
    .zehoro-coupon-code {
        width: 100%;
    }
}


/* ============================================================
   Editor Chrome Styles
   (block editor sidebar + inspector components)
   ============================================================ */

/* Section labels in inspector panels */
.zehoro-section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #757575;
    margin-bottom: 0.5em;
    margin-top: 0.75em;
}

/* Editor notice / info box */
.zehoro-editor-notice {
    background: rgba(30, 207, 196, 0.08);
    border-left: 3px solid var(--zehoro-secondary-color, #1ECFC4);
    border-radius: 3px;
    padding: 0.6em 0.75em;
    font-size: 0.82rem;
    color: #444;
    margin: 0.75em 0;
}

/* Repeatable list editor rows */
.zehoro-list-editor__row {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.35em 0;
    border-bottom: 1px solid #f0f0f0;
}
.zehoro-list-editor__row:last-child {
    border-bottom: none;
}
.zehoro-list-editor__row input[type="text"] {
    flex: 1;
    min-width: 0;
}

/* Criterion score row */
.zehoro-criterion-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.4em 0;
    border-bottom: 1px solid #f0f0f0;
}
.zehoro-criterion-row:last-child {
    border-bottom: none;
}
.zehoro-criterion-row input[type="text"] {
    flex: 2;
    min-width: 0;
}
.zehoro-criterion-row input[type="number"] {
    width: 4.5em;
    flex-shrink: 0;
}

/* CTA button editor row */
.zehoro-btn-editor-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5em;
    align-items: center;
    padding: 0.4em 0;
    border-bottom: 1px solid #f0f0f0;
}
.zehoro-btn-editor-row:last-child {
    border-bottom: none;
}

/* Star picker */
.zehoro-star-picker {
    display: inline-flex;
    gap: 0.2em;
    font-size: 1.2rem;
    cursor: pointer;
    user-select: none;
}
.zehoro-star-picker .zehoro-star {
    cursor: pointer;
    transition: color 0.1s ease;
}
.zehoro-star-picker .zehoro-star:hover,
.zehoro-star-picker .zehoro-star.is-filled {
    color: var(--zehoro-primary-color, #E8A020);
}
