/* "تجربه خریداران محصول" tab (template/feedback/tab-product.php). Scoped to .wpfb;
   colors follow the site's main color (--main-color, else Woodmart --wd-primary-color). */

/* Tab title icon (setting feedbacktab_icon), drawn with a mask so it takes the tab color. */
.wpfb-tab-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-inline-end: 6px;
    vertical-align: -3px;
    background-color: currentColor;
    -webkit-mask: var(--wpfb-icon) center / contain no-repeat;
    mask: var(--wpfb-icon) center / contain no-repeat;
}
.wpfb-icon-chat   { --wpfb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3Cpath d='M8 9h8M8 13h5'/%3E%3C/svg%3E"); }
.wpfb-icon-star   { --wpfb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 2.5l2.94 6.4 7.01.73-5.24 4.73 1.48 6.9L12 17.7l-6.19 3.56 1.48-6.9L2.05 9.63l7.01-.73z'/%3E%3C/svg%3E"); }
.wpfb-icon-badge  { --wpfb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
.wpfb-icon-heart  { --wpfb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21.2l8.8-8.8a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E"); }
.wpfb-icon-thumbs { --wpfb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v11H3V10z'/%3E%3Cpath d='M7 10l4-8a3 3 0 0 1 3 3v4h5.5a2 2 0 0 1 2 2.3l-1.4 8a2 2 0 0 1-2 1.7H7'/%3E%3C/svg%3E"); }
.wpfb-icon-bag    { --wpfb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3E%3Cpath d='M3 6h18M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E"); }
.wpfb-tab-count { font-weight: 400; opacity: .75; }

.wpfb {
    --wpfb-accent: var(--main-color, var(--wd-primary-color, #e2125d));
    --wpfb-star: #f5a623;
    --wpfb-text: #1f2937;
    --wpfb-muted: #6b7280;
    --wpfb-line: #eceef1;
    --wpfb-soft: #f7f8fa;
    color: var(--wpfb-text);
    text-align: start;
}
.wpfb *, .wpfb *::before, .wpfb *::after { box-sizing: border-box; }

.wpfb-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 24px; }
.wpfb-title { margin: 0 0 6px; font-size: 19px; font-weight: 800; line-height: 1.5; color: var(--wpfb-text); }
.wpfb-sub { margin: 0; font-size: 13px; line-height: 1.8; color: var(--wpfb-muted); }
.wpfb-verified { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #e7f6ee; color: #0f9d58; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.wpfb-verified svg { width: 16px; height: 16px; }

/* Stars: a filled copy over an empty one, cut to the rating. */
.wpfb-stars { display: inline-flex; gap: 2px; }
.wpfb-star { position: relative; display: inline-block; width: 16px; height: 16px; }
.wpfb-star svg { display: block; width: 16px; height: 16px; fill: #e3e5e8; }
.wpfb-star-fill { position: absolute; inset-block: 0; inset-inline-start: 0; overflow: hidden; }
.wpfb-star-fill svg { fill: var(--wpfb-star); }
.wpfb-stars.is-large .wpfb-star, .wpfb-stars.is-large .wpfb-star svg { width: 20px; height: 20px; }

/* Summary: average and how the stars are spread. */
.wpfb-summary { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; align-items: center; margin: 0 0 28px; padding: 24px 28px; border: 1px solid var(--wpfb-line); border-radius: 16px; background: var(--wpfb-soft); }
.wpfb-score { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.wpfb-score strong { font-size: 40px; font-weight: 800; line-height: 1; color: var(--wpfb-text); }
.wpfb-score > span:last-child { font-size: 12px; color: var(--wpfb-muted); }
.wpfb-bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.wpfb-bars li { display: grid; grid-template-columns: 42px minmax(0, 1fr) 32px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--wpfb-muted); }
.wpfb-bar-label { display: inline-flex; align-items: center; gap: 4px; }
.wpfb-bar-label svg { width: 13px; height: 13px; fill: var(--wpfb-star); }
.wpfb-bar { height: 8px; overflow: hidden; border-radius: 999px; background: #e9ebee; }
.wpfb-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--wpfb-star); }
.wpfb-bar-count { text-align: end; }

/* Experiences */
.wpfb-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.wpfb-item { display: flex; flex-direction: column; gap: 12px; padding: 22px; border: 1px solid var(--wpfb-line); border-radius: 16px; background: #fff; transition: box-shadow .2s, border-color .2s; }
.wpfb-item[hidden] { display: none; }
.wpfb-item:hover { border-color: #e1e4e8; box-shadow: 0 8px 24px rgba(17, 24, 39, .06); }
.wpfb-item-head { display: flex; align-items: center; gap: 14px; }
.wpfb-avatar { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; background: color-mix(in srgb, var(--wpfb-accent) 12%, #fff); color: var(--wpfb-accent); font-size: 17px; font-weight: 800; }
.wpfb-who { flex: 1; min-width: 0; }
.wpfb-who strong { display: block; font-size: 14px; font-weight: 700; line-height: 1.5; }
.wpfb-buyer { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: #0f9d58; }
.wpfb-buyer svg { width: 12px; height: 12px; }
.wpfb-date { flex: 0 0 auto; font-size: 12px; color: var(--wpfb-muted); white-space: nowrap; }
.wpfb-text { margin: 0; font-size: 14px; line-height: 2; color: #374151; overflow-wrap: anywhere; }

.wpfb-more { display: block; margin: 24px auto 0; padding: 10px 22px; border: 1px solid var(--wpfb-line); border-radius: 999px; background: #fff; color: var(--wpfb-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.wpfb-more:hover { border-color: var(--wpfb-accent); color: var(--wpfb-accent); }

/* Nothing yet */
.wpfb-empty { padding: 44px 24px; border: 1px dashed #dfe2e6; border-radius: 16px; text-align: center; background: var(--wpfb-soft); }
.wpfb-empty-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; margin-bottom: 12px; border-radius: 50%; background: #fff; color: var(--wpfb-accent); box-shadow: 0 4px 14px rgba(17, 24, 39, .06); }
.wpfb-empty-icon svg { width: 28px; height: 28px; }
.wpfb-empty h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.wpfb-empty p { max-width: 460px; margin: 0 auto; font-size: 13px; line-height: 1.9; color: var(--wpfb-muted); }

@media (max-width: 768px) {
    .wpfb-summary { grid-template-columns: 1fr; gap: 20px; padding: 22px 20px; }
    .wpfb-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .wpfb-item { transition: none; }
}
