/* =========================================================
   Happy Reviews v3 — Frontend Styles
   All circle/layout rules use !important to prevent
   theme stylesheets from overriding them.
   ========================================================= */

/* ── Section wrapper ───────────────────────────────────── */
.hr-section {
    background: var(--hr-bg, #f9f9f9) !important;
    padding: var(--hr-spad, 60px 40px) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Grid: always 4 cols desktop, 2 cols tablet+mobile ─── */
.hr-section .hr-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    list-style: none !important;
    padding: 0 !important;
}

@media (max-width: 900px) {
    .hr-section .hr-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ── Card ──────────────────────────────────────────────── */
.hr-section .hr-card {
    background: var(--hr-cb, #ffffff) !important;
    border-radius: var(--hr-radius, 14px) !important;
    box-shadow: var(--hr-shadow, 0 2px 14px rgba(0,0,0,0.08)) !important;
    padding: var(--hr-cpad, 24px 22px 20px) !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    /* Crucial: card never grows wider than its grid cell */
    min-width: 0 !important;
    width: 100% !important;
}

/* ── Customer row ──────────────────────────────────────── */
.hr-section .hr-card-top {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
    flex-shrink: 0 !important;
}

/* ── Customer avatar — CIRCLE — theme-proof ────────────── */
.hr-section .hr-avatar,
.hr-section img.hr-avatar {
    width:  52px !important;
    height: 52px !important;
    min-width:  52px !important;
    min-height: 52px !important;
    max-width:  52px !important;
    max-height: 52px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    display: block !important;
    border: 2px solid #f0f0f0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Initial fallback circle */
.hr-section .hr-avatar-initial {
    width:  52px !important;
    height: 52px !important;
    min-width:  52px !important;
    border-radius: 50% !important;
    background: #e2e8f0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #667 !important;
    text-transform: uppercase !important;
    flex-shrink: 0 !important;
}

.hr-section .hr-customer-meta {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
    flex: 1 !important;
}

.hr-section .hr-customer-name {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--hr-tx, #1a1a1a) !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
}

.hr-section .hr-verified {
    font-size: 13px !important;
    color: #999 !important;
    line-height: 1.3 !important;
    display: block !important;
}

/* ── Review text ───────────────────────────────────────── */
.hr-section .hr-review-text {
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.65 !important;
    color: var(--hr-tx, #333333) !important;
    margin: 0 !important;
    flex: 1 !important;
    word-break: break-word !important;
}

/* ── Divider ───────────────────────────────────────────── */
.hr-section .hr-divider {
    height: 1px !important;
    background: #ebebeb !important;
    margin: 18px 0 14px !important;
    flex-shrink: 0 !important;
    border: none !important;
}

/* ── Product row ───────────────────────────────────────── */
.hr-section .hr-product-link,
.hr-section .hr-product-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    /* Must NOT stretch beyond card width */
    min-width: 0 !important;
    width: 100% !important;
    flex-shrink: 0 !important;
}

.hr-section .hr-product-link:hover .hr-product-name {
    text-decoration: underline !important;
}

/* ── Product image — CIRCLE — theme-proof ──────────────── */
.hr-section .hr-product-img,
.hr-section img.hr-product-img {
    width:  44px !important;
    height: 44px !important;
    min-width:  44px !important;
    min-height: 44px !important;
    max-width:  44px !important;
    max-height: 44px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    display: block !important;
    border: 1px solid #eee !important;
    background: #f8f8f8 !important;
    padding: 3px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.hr-section .hr-product-img-empty {
    width:  44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 50% !important;
    background: #f0f0f0 !important;
    flex-shrink: 0 !important;
    display: block !important;
}

/* ── Product name: wraps to 2 lines max, never breaks layout */
.hr-section .hr-product-name {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--hr-tx, #333333) !important;
    line-height: 1.4 !important;
    /* Allow wrapping — never let a long title stretch the card */
    white-space: normal !important;
    word-break: break-word !important;
    overflow: hidden !important;
    /* Clamp to 2 lines */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    min-width: 0 !important;
    flex: 1 !important;
    margin: 0 !important;
}
