/*
 * BFH Single Perfume Sidebar (sidebar.css)
 *
 * Community Rating, Popular Right Now and the share row. Split from
 * detail.css because the archive and the Elementor sidebar widgets mount
 * these cards without any of the main-column content.
 */

/* -------------------- Community Rating -------------------- */
.bfh-rating-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--bfh-space-3);
    text-align: center;
}

.bfh-rating-summary .bfh-card__title {
    align-self: flex-start;
    text-align: left;
}

/* The score arc is painted with a conic gradient driven by the
   --bfh-rating-percent the template sets inline, so no SVG or JS is needed. */
.bfh-rating-summary__donut {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 148px;
    height: 148px;
    border-radius: var(--bfh-radius-round);
    background: conic-gradient(
        var(--bfh-color-primary) calc(var(--bfh-rating-percent, 0) * 1%),
        var(--bfh-border) 0
    );
}

/* Punches the ring hollow without a second element in the markup. */
.bfh-rating-summary__donut::before {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: var(--bfh-radius-round);
    background-color: var(--bfh-surface);
}

.bfh-rating-summary__score,
.bfh-rating-summary__scale {
    position: relative;
    z-index: var(--bfh-z-base);
}

.bfh-rating-summary__score {
    font-family: var(--bfh-font-serif);
    font-size: var(--bfh-text-3xl);
    font-weight: var(--bfh-font-weight-bold);
    color: var(--bfh-text-primary);
    line-height: 1;
}

.bfh-rating-summary__scale {
    font-size: var(--bfh-text-xs);
    color: var(--bfh-text-muted);
}

.bfh-rating-summary__count {
    margin: 0;
    font-size: var(--bfh-text-sm);
    color: var(--bfh-text-secondary);
}

.bfh-rating-summary__bars {
    display: flex;
    flex-direction: column;
    gap: var(--bfh-space-2);
    width: 100%;
    margin: var(--bfh-space-2) 0 0;
    padding: 0;
    list-style: none;
}

.bfh-rating-summary__row {
    display: grid;
    /* Fixed outer tracks so every bar starts and ends on the same line
       regardless of how wide the star label or percentage renders. */
    grid-template-columns: 34px minmax(0, 1fr) 40px;
    align-items: center;
    gap: var(--bfh-space-3);
}

.bfh-rating-summary__star {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: var(--bfh-text-xs);
    color: var(--bfh-rating-filled);
    font-variant-numeric: tabular-nums;
}

.bfh-rating-summary__track {
    display: block;
    height: 6px;
    background-color: var(--bfh-border);
    border-radius: var(--bfh-radius-pill);
    overflow: hidden;
}

.bfh-rating-summary__bar {
    display: block;
    height: 100%;
    border-radius: var(--bfh-radius-pill);
    background-color: var(--bfh-color-primary);
    transition: width var(--bfh-anim-slow);
}

.bfh-rating-summary__percent {
    font-size: var(--bfh-text-xs);
    color: var(--bfh-text-secondary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* -------------------- Popular Right Now -------------------- */
.bfh-popular__list {
    display: flex;
    flex-direction: column;
    gap: var(--bfh-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: bfh-popular;
}

.bfh-popular__item {
    display: grid;
    grid-template-columns: 20px 56px minmax(0, 1fr);
    align-items: center;
    gap: var(--bfh-space-3);
    padding: var(--bfh-space-2);
    border-radius: var(--bfh-radius-md);
    transition: background-color var(--bfh-anim-fast);
}

.bfh-popular__item:hover {
    background-color: var(--bfh-surface-hover);
}

.bfh-popular__rank {
    font-family: var(--bfh-font-serif);
    font-size: var(--bfh-text-lg);
    font-weight: var(--bfh-font-weight-bold);
    color: var(--bfh-text-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.bfh-popular__item:first-child .bfh-popular__rank {
    color: var(--bfh-color-primary);
}

.bfh-popular__thumb {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: var(--bfh-radius-md);
    overflow: hidden;
    background-color: var(--bfh-surface-hover);
}

.bfh-popular__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bfh-popular__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bfh-surface-hover), var(--bfh-border));
}

.bfh-popular__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bfh-popular__title {
    font-size: var(--bfh-text-sm);
    font-weight: var(--bfh-font-weight-medium);
    color: var(--bfh-text-primary);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--bfh-anim-fast);
}

.bfh-popular__title:hover {
    color: var(--bfh-color-primary);
}

.bfh-popular__brand {
    font-size: var(--bfh-text-xs);
    color: var(--bfh-text-muted);
}

/* -------------------- Share -------------------- */
.bfh-share__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bfh-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.bfh-share__item {
    margin: 0;
}

.bfh-share__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--bfh-surface-hover);
    border: var(--bfh-border-width) solid var(--bfh-border);
    border-radius: var(--bfh-radius-round);
    color: var(--bfh-text-secondary);
    font-family: inherit;
    font-size: var(--bfh-text-sm);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--bfh-anim-fast);
}

.bfh-share__link:hover {
    background-color: var(--bfh-color-primary);
    border-color: var(--bfh-color-primary);
    color: #fff;
    transform: translateY(-2px);
}

.bfh-share__link:focus-visible {
    outline: 2px solid var(--bfh-color-primary);
    outline-offset: 2px;
}

/* Collapsed until the copy handler fills it, so the card does not reserve a
   blank line for a message that may never appear. */
.bfh-share__status {
    margin: var(--bfh-space-3) 0 0;
    font-size: var(--bfh-text-xs);
    color: var(--bfh-color-primary);
}

.bfh-share__status:empty {
    display: none;
}
