/**
 * Storvatt Reviews — front-office bento layout
 *
 * Aligned with Storvatt design system:
 *   primary  : black
 *   gold     : #A58A42
 *   font     : Cera PRO, sans-serif (inherited)
 */

.storvatt-reviews {
    padding: 6rem 0;
    margin-top: 4rem;
    background-color: #f4f4f4;
    font-family: 'Cera PRO', sans-serif;
    font-size: 1.6rem;
}

.storvatt-reviews--product {
    margin-top: 3rem;
    /* Break out of the parent .container on product pages */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.storvatt-reviews--category {
    margin-top: 2.5rem;
}

/* ----- Title ------------------------------------------------------------- */

.storvatt-reviews__title-bar {
    margin-bottom: 2.5rem;
    text-align: center;
}

@media (min-width: 980px) {
    .storvatt-reviews__title-bar {
        text-align: left;
    }
}

.storvatt-reviews__title {
    font-family: 'Cera PRO', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: #000;
    margin: 0;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    line-height: 1;
}

@media (min-width: 980px) {
    .storvatt-reviews__title {
        font-size: 4.2rem;
    }
}

/* ----- Stars (shared) ---------------------------------------------------- */

.storvatt-reviews__stars {
    display: inline-flex;
    gap: 0.125rem;
    line-height: 1;
}

.storvatt-reviews__star {
    color: #d8d8d8;
    font-size: 1.8rem;
}

.storvatt-reviews__stars--lg .storvatt-reviews__star {
    font-size: 2.6rem;
}

.storvatt-reviews__star--filled {
    color: #A58A42;
}

.storvatt-reviews__star--half {
    background: linear-gradient(90deg, #A58A42 50%, #d8d8d8 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ----- Bento grid -------------------------------------------------------- */

.storvatt-bento {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(0, auto);
    gap: 1rem;
}

@media (min-width: 768px) {
    .storvatt-bento {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 980px) {
    .storvatt-bento {
        grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 4fr);
        grid-auto-rows: minmax(140px, auto);
        gap: 1.25rem;
    }
}

.storvatt-bento__cell {
    background: #fff;
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.storvatt-bento__cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(83, 83, 83, 0.12);
}

/* Cell placement on desktop :
 *
 *  ┌──────────────┬───────────────────────────────┐
 *  │  Featured    │  Review #1 (cols 2-3)         │
 *  │  (rows 1-3)  ├───────────────┬───────────────┤
 *  │              │ Stat 98%      │               │
 *  │              ├───────────────┤ Illustration  │
 *  │              │ Review #3     │ (rows 2-3)    │
 *  ├──────────────┼───────────────┴───────────────┤
 *  │ Distribution │  Review #2 (cols 2-3)         │
 *  ├──────────────┴───────────────────────────────┤
 *  │  Review #4 (50%)        │ Review #5 (50%)    │
 *  └─────────────────────────┴────────────────────┘
 *
 * Implementation: rows 2-3 use a "half-height" pattern by splitting the
 * middle area into 2 grid rows where col-3 spans both, col-2 stays single.
 */

@media (min-width: 980px) {
    .storvatt-bento {
        grid-template-rows:
            minmax(140px, auto)   /* row 1 : Review #1 */
            minmax(110px, auto)   /* row 2 : Stat 98% (top half) */
            minmax(110px, auto)   /* row 3 : Review #3 (bottom half) */
            minmax(140px, auto);  /* row 4 : Distribution + Review #2 */
    }
    .storvatt-bento__cell--featured {
        grid-column: 1 / 2;
        grid-row: 1 / 4;
    }
    .storvatt-bento__cell--review-1 {
        grid-column: 2 / 4;
        grid-row: 1 / 2;
    }
    .storvatt-bento__cell--stat {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }
    .storvatt-bento__cell--review-3 {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
    }
    .storvatt-bento__cell--illustration {
        grid-column: 3 / 4;
        grid-row: 2 / 4;
    }
    .storvatt-bento__cell--distribution {
        grid-column: 1 / 2;
        grid-row: 4 / 5;
    }
    .storvatt-bento__cell--review-2 {
        grid-column: 2 / 4;
        grid-row: 4 / 5;
    }
    .storvatt-bento__row-bottom {
        grid-column: 1 / 4;
        grid-row: 5 / 6;
    }
}

/* Bottom row : 2 columns 50/50 over the full bento width */
.storvatt-bento__row-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .storvatt-bento__row-bottom {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 980px) {
    .storvatt-bento__row-bottom {
        gap: 1.25rem;
    }
}

/* ----- Featured cell ----------------------------------------------------- */

.storvatt-bento__featured-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.storvatt-bento__featured-logo {
    width: 3.6rem;
    height: 3.6rem;
    object-fit: contain;
    flex-shrink: 0;
}

.storvatt-bento__featured-source {
    font-size: 1.7rem;
    font-weight: 700;
    color: #000;
}

.storvatt-bento__featured-score-row {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.storvatt-bento__featured-score {
    font-size: 6rem;
    font-weight: 700;
    color: #000;
    line-height: 1;
    letter-spacing: -0.02em;
}

.storvatt-bento__featured-out {
    font-size: 1.7rem;
    color: #777;
    font-weight: 400;
}

.storvatt-bento__featured-count {
    margin: 0;
    font-size: 1.5rem;
    color: #555;
    line-height: 1.5;
}

.storvatt-bento__featured-count strong {
    color: #000;
    font-weight: 700;
}

.storvatt-bento__featured-link {
    align-self: flex-start;
    font-size: 1.4rem;
    font-weight: 700;
    color: #A58A42;
    text-decoration: none;
    margin-top: auto;
    padding-top: 0.5rem;
    transition: color 0.2s ease;
}

.storvatt-bento__featured-link:hover {
    color: #000;
    text-decoration: none;
}

/* ----- Stat cell --------------------------------------------------------- */

.storvatt-bento__cell--stat {
    background: #111;
    justify-content: space-between;
}

.storvatt-bento__stat-label {
    font-size: 1.5rem;
    color: #fff;
    font-weight: 500;
}

.storvatt-bento__stat-value {
    font-size: 5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.02em;
}

.storvatt-bento__stat-value small {
    font-size: 2.6rem;
    color: #C9A85A;
    font-weight: 700;
    margin-left: 0.125rem;
}

.storvatt-bento__stat-sub {
    font-size: 1.4rem;
    color: #fff;
    line-height: 1.45;
}

/* ----- Illustration cell ------------------------------------------------- */

.storvatt-bento__cell--illustration {
    padding: 0;
    overflow: hidden;
    min-height: 140px;
    position: relative;
}

.storvatt-bento__illustration-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 767px) {
    .storvatt-bento__cell--illustration {
        aspect-ratio: 16 / 9;
        min-height: 0;
    }
}

/* ----- Distribution cell ------------------------------------------------- */

.storvatt-bento__cell--distribution {
    gap: 0.5rem;
}

.storvatt-bento__distribution-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 0.5rem;
}

.storvatt-bento__distribution-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.storvatt-bento__distribution-row {
    display: grid;
    grid-template-columns: 3.2rem 1fr 4rem;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.4rem;
}

.storvatt-bento__distribution-label {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    color: #555;
    font-weight: 500;
}

.storvatt-bento__distribution-label .storvatt-reviews__star {
    font-size: 1.5rem;
}

.storvatt-bento__distribution-bar {
    position: relative;
    height: 0.5rem;
    background: #f0f0f0;
    border-radius: 999px;
    overflow: hidden;
}

.storvatt-bento__distribution-fill {
    position: absolute;
    inset: 0 auto 0 0;
    background: #4caf50;
    border-radius: inherit;
    transition: width 0.3s ease;
}

.storvatt-bento__distribution-row[data-star="2"] .storvatt-bento__distribution-fill,
.storvatt-bento__distribution-bar[data-star="2"] .storvatt-bento__distribution-fill {
    background: #ff9800;
}

.storvatt-bento__distribution-bar[data-star="1"] .storvatt-bento__distribution-fill {
    background: #f44336;
}

.storvatt-bento__distribution-count {
    text-align: right;
    color: #555;
    font-variant-numeric: tabular-nums;
}

/* ----- Review cell ------------------------------------------------------- */

.storvatt-bento__cell--review {
    justify-content: space-between;
}

.storvatt-bento__review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.storvatt-bento__review-source-logo {
    width: 2.6rem;
    height: 2.6rem;
    object-fit: contain;
    flex-shrink: 0;
}

.storvatt-bento__review-comment {
    margin: 0;
    color: #000;
    font-size: 1.5rem;
    line-height: 1.55;
    flex-grow: 1;
}

.storvatt-bento__review-foot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid #f4f4f4;
    padding-top: 0.875rem;
}

.storvatt-bento__avatar {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    background: #f4f4f4;
    color: #000;
    font-size: 1.4rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.storvatt-bento__review-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.storvatt-bento__review-author {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
}

.storvatt-bento__review-date {
    font-size: 1.3rem;
    color: #777;
}

/* ----- Mobile tweaks ----------------------------------------------------- */

@media (max-width: 767px) {
    .storvatt-reviews {
        padding: 3rem 0;
    }
    .storvatt-bento__cell {
        padding: 1.25rem;
    }
    .storvatt-bento__featured-score {
        font-size: 4.2rem;
    }
    .storvatt-bento__stat-value {
        font-size: 3.6rem;
    }
}
