/* @import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,700;1,800;1,900&display=swap'); */

:root {
    --fhs-bestsellers-bp-mobile: 1024px;
    --font-primary: 'Noto Sans', 'Nunito Sans', sans-serif;
    --font-semi-bold: 'Noto Sans SemiBold', 'Nunito Sans', sans-serif;
    --font-bold: 'Noto Sans Bold', 'Nunito Sans', sans-serif;
    --font-italic: 'Noto Sans Italic', 'Nunito Sans', sans-serif;
}

.fhs-bestsellers *,
.fhs-bestsellers *::before,
.fhs-bestsellers *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.fhs-bestsellers {
    font-family: var(--font-primary);
    font-weight: 400;
    /* -webkit-font-smoothing: antialiased; */
    width: 100%;
    max-width: 1230px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    /* box-shadow: 0 20px 60px rgba(0,0,0,.10), 0 4px 16px rgba(0,0,0,.06); */
    border: 1px solid #E2E8F0;
    overflow: hidden;
    color: #1E293B;
    margin-top: 16px;
    padding-bottom: 10px;
}

/* ---------- HEADER ---------- */
.fhs-bestsellers-header {
    padding: 24px 24px 0;
    border-bottom: 1px solid #F1F5F9;
    background: #fff;
}

.fhs-bestsellers-header .fhs-bestseller-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fhs-bestsellers-title-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.fhs-bestsellers-title-row svg,
.fhs-bestsellers-title-row img,
.fhs-bestsellers-title-row .icon-flame {
    width: 24px;
    height: 24px;
    color: #ED1E36;
    fill: #ED1E36;
    flex-shrink: 0;
}

.fhs-bestsellers-title-row span {
    font-size: 22px;
    font-weight: 600;
    color: #0F172A;
    line-height: 32px;
    font-family: var(--font-semi-bold);
    flex: 1 1 auto;
}

/* ---------- TABS ---------- */
.fhs-tabs-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.fhs-tab-arrow {
    position: absolute;
    bottom: 12px;
    z-index: 10;
    height: 32px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color .2s;
    color: #94A3B8;
}

.fhs-tab-arrow:hover {
    color: #ED1E36;
}

.fhs-tab-arrow--left {
    left: 0;
    background: linear-gradient(to right, #fff 60%, transparent);
    padding-right: 10px;
}

.fhs-tab-arrow--right {
    right: 0;
    background: linear-gradient(to left, #fff 60%, transparent);
    padding-left: 10px;
}

.fhs-tab-arrow.hidden {
    display: none;
}

.fhs-tab-arrow svg {
    width: 20px;
    height: 20px;
}

.fhs-tabs-scroll {
    display: flex;
    align-items: center;
    gap: 32px;
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    padding: 0 8px 12px;
    flex: 1;
    /* hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.fhs-tabs-scroll::-webkit-scrollbar {
    display: none;
}

.fhs-tab-btn {
    position: relative;
    padding-bottom: 12px;
    background: none;
    border: none;
    font-size: 14px;
    line-height: 20px;
    color: #64748B;
    cursor: pointer;
    white-space: nowrap;
    transition: color .2s;
}

.fhs-tab-btn:hover {
    color: #0F172A;
}

.fhs-tab-btn.active {
    color: #ED1E36;
    font-family: var(--font-bold);
    font-weight: 700;
}

.fhs-tab-btn.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 27px;
    width: 100%;
    height: 3px;
    background: #ED1E36;
    border-radius: 99px;
}

/* ---------- BODY GRID ---------- */
.fhs-bestsellers-body {
    display: grid;
    grid-template-columns: 5fr 7fr;
    height: 550px;
    overflow: hidden;
}

@media (max-width: 1023px) {
    .fhs-bestsellers-body {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* ---------- LEFT PANEL — product list ---------- */
.fhs-bestsellers-list-panel {
    border-right: 1px solid #F1F5F9;
    background: #FDFDFD;
    overflow-y: auto;
    height: 100%;
}

/* custom scrollbar */
.fhs-bestsellers-list-panel::-webkit-scrollbar,
.fhs-bestsellers-detail-panel::-webkit-scrollbar {
    width: 4px;
}

.fhs-bestsellers-list-panel::-webkit-scrollbar-track,
.fhs-bestsellers-detail-panel::-webkit-scrollbar-track {
    background: transparent;
}

.fhs-bestsellers-list-panel::-webkit-scrollbar-thumb,
.fhs-bestsellers-detail-panel::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
}

/* product-item row */
.fhs-product-row {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #F1F5F9;
    cursor: pointer;
    transition: background .15s;
    background: #fff;
    height: 152px;
    text-decoration: none;
    color: inherit;
}

.fhs-product-row:hover {
    background: #F8FAFC;
}

.fhs-product-row.is-selected {
    background: #FEF2F2;
    border-left: 3px solid #ED1E36;
}

.fhs-product-row:last-child {
    border-bottom: none;
}

/* rank number */
.fhs-rank-num {
    width: 3.5rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 24px;
    line-height: 32px;
    letter-spacing: 0%;
    color: #CBD5E1;
    font-family: var(--font-bold);
    font-weight: 700;
}

.fhs-rank-num.is-top3 {
    color: #ED1E36;
}

/* book cover */
.fhs-product-thumb {
    width: 104px;
    height: 104px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 4px;
    margin: 0 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fhs-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* product info */
.fhs-product-info {
    flex: 1;
    min-width: 0;
}

.fhs-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    line-height: 15px;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    font-family: var(--font-semi-bold);
    font-weight: 600;
}

.fhs-product-badge.is-top3 {
    color: #ED1E36;
    background: #FFF9F9;
}

.fhs-product-badge.is-normal {
    color: #94A3B8;
    background: #F1F5F9;
}

.fhs-product-badge svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.fhs-product-name {
    font-size: 14px;
    color: #1E293B;
    line-height: 20px;
    margin-bottom: 8px;
    /* clamp 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fhs-product-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fhs-rating-pill {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #1E293B;
    font-family: var(--font-semi-bold);
    font-weight: 600;
}

.fhs-rating-pill svg {
    width: 13px;
    height: 13px;
    fill: #F59E0B;
    color: #F59E0B;
}

.fhs-sold-count {
    font-size: 12px;
    color: #94A3B8;
}

/* arrow trend indicator */
.fhs-trend-icon {
    font-size: 11px;
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 8px;
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
}

.fhs-trend-icon.up {
    color: #16a34a;
}

.fhs-trend-icon.down {
    color: #dc2626;
}

/* ---------- RIGHT PANEL — detail ---------- */
.fhs-bestsellers-detail-panel {
    height: 100%;
    overflow-y: auto;
    background: #fff;
}

@media (max-width: 1023px) {

    .fhs-bestsellers-list-panel,
    .fhs-bestsellers-detail-panel {
        height: auto;
        max-height: 70vh;
    }
}

.fhs-detail-inner {
    padding: 32px;
}

/* detail header: image + core info */
.fhs-detail-top {
    display: flex;
    gap: 28px;
    margin-bottom: 28px;
}

.fhs-detail-cover-wrap {
    width: 240px;
    flex-shrink: 0;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
}

.fhs-detail-cover-wrap img {
    max-width: 100%;
    max-height: 208px;
    object-fit: contain;
}

.fhs-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fhs-detail-title {
    font-size: 20px;
    color: #0F172A;
    line-height: 25px;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fhs-detail-title:hover {
    color: #ED1E36;
    cursor: pointer;
}

.fhs-detail-rating-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.fhs-detail-rating-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #FFFBEB;
    padding: 3px 8px;
    border-radius: 6px;
}

.fhs-detail-rating-badge svg {
    width: 14px;
    height: 14px;
    fill: #F59E0B;
    color: #F59E0B;
}

.fhs-detail-rating-badge span {
    font-size: 12px;
    line-height: 16px;
    color: #1E293B;
    font-family: var(--font-semi-bold);
    font-weight: 600;
}

.fhs-detail-sold-text {
    font-size: 12px;
    line-height: 16px;
    color: #94A3B8;
}

/* CHỈ thêm border khi phía trước có ratingBadge */
.fhs-detail-rating-badge+.fhs-detail-sold-text {
    padding-left: 14px;
    border-left: 1px solid #F1F5F9;
}

.fhs-detail-author-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 24px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #64748B;
}

.fhs-detail-author-row .meta-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
    max-width: 100%;
}

.fhs-detail-author-row .meta-item svg {
    width: 16px;
    height: 16px;
    color: #ED1E36;
    flex-shrink: 0;
    margin-top: 2px;
}

.fhs-detail-author-row .meta-item strong {
    color: #1E293B;
    word-break: break-word;
    font-family: var(--font-bold);
    font-weight: 700;
}

.fhs-detail-author-row .meta-item:not(:last-child) {
    position: relative;
}

.fhs-desc-text p {
    font-family: var(--font-primary);
    font-weight: 400;
    margin-bottom: 6px;
}

.fhs-desc-text em {
    font-family: var(--font-italic);
    font-weight: 400;
}

.fhs-desc-text strong {
    font-family: var(--font-bold);
    font-weight: 700;
}

@media (min-width: 768px) {
    .fhs-detail-author-row .meta-item:not(:last-child)::after {
        content: "";
        position: absolute;
        right: -12px;
        top: 20%;
        height: 60%;
        width: 1px;
        background-color: #E2E8F0;
    }
}

.fhs-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.fhs-final-price {
    font-size: 24px;
    color: #ED1E36;
    letter-spacing: 0%;
    line-height: 32px;
    font-family: var(--font-bold);
    font-weight: 700;
}

.fhs-original-price {
    font-size: 14px;
    color: #94A3B8;
    text-decoration: line-through;
    line-height: 20px;
}

.fhs-discount-badge {
    background: #ED1E36;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(237, 30, 54, .3);
    font-family: var(--font-semi-bold);
}

.fhs-add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    background: #ED1E36;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    /* box-shadow: 0 4px 16px rgba(237,30,54,.35); */
    transition: background .2s, transform .1s;
}

.fhs-add-to-cart-btn:hover {
    background: #D3152B;
}

.fhs-add-to-cart-btn:active {
    transform: scale(.98);
}

.fhs-add-to-cart-btn svg {
    width: 18px;
    height: 18px;
}

/* bestsellers score row */
.fhs-bestsellers-score-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #64748B;
}

.fhs-bestsellers-score-row strong {
    color: #ED1E36;
    font-size: 16px;
    font-weight: 800;
}

/* description section */
.fhs-desc-section {
    margin-bottom: 8px;
}

.fhs-section-label {
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0%;
    color: #334155;
    padding-bottom: 8px;
    border-bottom: 1px solid #F8FAFC;
    margin-bottom: 10px;
    font-family: var(--font-semi-bold);
    font-weight: 600;
}

.fhs-desc-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.7;
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* reviews section */
.fhs-review-section {
    border-top: 1px solid #F1F5F9;
    padding-top: 16px;
}

.fhs-review-summary {
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.fhs-review-summary-label {
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0%;
    color: #334155;
    font-family: var(--font-semi-bold);
    font-weight: 600;
}

.fhs-review-summary .fhs-review-summary-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.fhs-review-summary .fhs-review-summary-score {
    font-size: 20px;
    color: #0F172A;
}

.fhs-review-summary .fhs-review-summary-score span {
    font-size: 12px;
    line-height: 16px;
    color: #94A3B8;
}

.fhs-stars {
    display: flex;
    gap: 2px;
}

.fhs-stars svg {
    width: 15px;
    height: 15px;
    color: #F59E0B;
}

.fhs-stars svg.filled {
    fill: #F59E0B;
}

.fhs-review-count-text {
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 0%;
    color: #64748B;
}

.fhs-vdivider {
    width: 1px;
    height: 24px;
    background: #E2E8F0;
}

/* individual review */
.fhs-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.fhs-review-item {
    display: flex;
    gap: 20px;
}

.fhs-review-user {
    flex-shrink: 0;
    width: 108px;
}

.fhs-review-user .username {
    font-size: 14px;
    color: #1E293B;
    font-family: var(--font-semi-bold);
    font-weight: 600;
}

.fhs-review-user .date {
    font-size: 12px;
    color: #94A3B8;
    margin-top: 2px;
}

.fhs-review-body {
    flex: 1;
}

.fhs-review-stars {
    display: flex;
    margin-bottom: 8px;
}

.fhs-review-stars svg {
    width: 13px;
    height: 13px;
    color: #F59E0B;
}

.fhs-review-stars svg.filled {
    fill: #F59E0B;
}

.fhs-review-comment {
    font-size: 14px;
    color: #475569;
    line-height: 1.65;
}

.fhs-review-comment.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fhs-review-expand-btn {
    font-size: 11px;
    color: #1677FF;
    font-family: var(--font-semi-bold);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 6px;
}

.fhs-review-expand-btn:hover {
    text-decoration: underline;
}

.fhs-review-actions {
    display: flex;
    gap: 20px;
    margin-top: 12px;
}

.fhs-review-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #94A3B8;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-bold);
    font-weight: 700;
    transition: color .2s;
}

.fhs-review-action-btn svg {
    width: 13px;
    height: 13px;
}

.fhs-review-action-btn:hover,
.fhs-review-action-btn.liked {
    color: #1677FF;
}

.fhs-review-action-btn.liked svg {
    fill: #1677FF;
}

.fhs-view-more-btn {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0%;
    color: #ED1E36;
    background: #FFF9F9;
    border: 1px solid #FECACA;
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
    text-align: center;
    font-family: var(--font-semi-bold);
    font-weight: 600;
}

.fhs-view-more-btn:hover {
    background: #FEE2E2;
}

/* empty reviews */
.fhs-empty-reviews {
    padding: 40px 24px;
    background: #F8FAFC;
    border: 1.5px dashed #E2E8F0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.fhs-empty-reviews svg {
    width: 40px;
    height: 40px;
    color: #CBD5E1;
}

.fhs-empty-reviews p {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0%;
    vertical-align: middle;
    color: #94A3B8;
    font-family: var(--font-italic);
    font-weight: 400;
    font-style: italic;
}

.fhs-empty-view-btn {
    padding: 16px 32px;
    font-size: 12px;
    letter-spacing: .14em;
    color: #ED1E36;
    background: #fff;
    border: 1px solid #FECACA;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
    transition: background .2s;
    text-decoration: none;
    text-transform: uppercase;
}

.fhs-empty-view-btn:hover {
    background: #FFF9F9;
}

/* ---------- SKELETON / LOADING ---------- */
@keyframes shimmer {
    0% {
        background-position: -600px 0;
    }

    100% {
        background-position: 600px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
}

.fhs-skel-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid #F1F5F9;
    min-height: 112px;
}

.fhs-skel-rank {
    width: 44px;
    height: 36px;
    border-radius: 6px;
    flex-shrink: 0;
}

.fhs-skel-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    flex-shrink: 0;
}

.fhs-skel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fhs-skel-line {
    height: 12px;
    border-radius: 6px;
}

/* ---------- "Xem thêm" footer link ---------- */
.fhs-bestsellers-footer {
    padding: 14px 24px;
    border-top: 1px solid #F1F5F9;
    text-align: center;
    background: #FDFDFD;
}

.fhs-bestsellers-footer a {
    font-size: 13px;
    font-weight: 800;
    color: #ED1E36;
    text-decoration: none;
    letter-spacing: .04em;
}

.fhs-bestsellers-footer a:hover {
    text-decoration: underline;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .fhs-bestsellers-body {
        grid-template-columns: 1fr;
    }

    .fhs-bestsellers-list-panel {
        border-right: none;
        height: auto;
        max-height: 400px;
    }

    .fhs-bestsellers-detail-panel {
        height: auto;
    }

    .fhs-detail-top {
        flex-direction: column;
    }

    .fhs-detail-cover-wrap {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    #fhs-bestsellers-detail {
        display: none;
    }
}

@media (max-width: 640px) {
    .fhs-detail-inner {
        padding: 20px 16px;
    }

    .fhs-bestsellers-header {
        padding: 8px 8px 0;
    }

    .fhs-detail-title {
        font-size: 18px;
    }

    .fhs-final-price {
        font-size: 22px;
    }

    .fhs-product-row {
        padding: 8px;
        height: 118px;
    }
}

.fhs-tabs-swiper {
    width: 100%;
    padding: 0 8px 16px;
    padding-right: 30px;
}