/* ================================================================
 * HMS Category Bestsellers — compact inline design
 * Uses HMS design tokens from landing.css (--hms-*)
 * Mobile-first. No dependencies.
 * ================================================================ */

/* ---------- Section wrapper — compact ---------- */
.hms-bestsellers {
    margin: 0 0 20px 0;
    padding: 16px 20px;
    background: var(--hms-bg-soft, #f7f7f5);
    border: 1px solid var(--hms-border, #e5e5e0);
    border-radius: 12px;
}

/* ---------- Header — single line ---------- */
.hms-bestsellers__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.hms-bestsellers__badge {
    display: inline-block;
    padding: 2px 10px;
    background: var(--hms-primary, #7b9f35);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 999px;
    line-height: 1.6;
    flex-shrink: 0;
}

.hms-bestsellers__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--hms-text, #1a1a1a);
    line-height: 1.2;
    margin: 0;
}

.hms-bestsellers__subtitle {
    font-size: 12px;
    color: var(--hms-text-muted, #5a5a5a);
    margin: 0;
    margin-left: auto;
    white-space: nowrap;
}

/* ---------- FlexSlider overrides ---------- */
.hms-bestsellers__slider.flexslider {
    margin: 0 0 12px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: none;
    position: relative;
    overflow: visible;
}

/* Nav arrows — circular, outside the viewport */
.hms-bestsellers__slider .flex-direction-nav {
    position: static;
}

.hms-bestsellers__slider .flex-direction-nav a {
    position: absolute;
    top: 50%;
    width: 34px;
    height: 34px;
    margin-top: -40px;
    background: var(--hms-bg-card, #fff);
    border: 1px solid var(--hms-border, #e5e5e0);
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
    opacity: 1;
    text-indent: -9999px;
    z-index: 10;
    display: block;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.hms-bestsellers__slider .flex-direction-nav a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--hms-text, #1a1a1a);
    border-bottom: 2px solid var(--hms-text, #1a1a1a);
    text-indent: 0;
    font-size: 0;
}

.hms-bestsellers__slider .flex-direction-nav a.flex-prev {
    left: -8px;
}

.hms-bestsellers__slider .flex-direction-nav a.flex-prev::before {
    transform: translate(-40%, -50%) rotate(135deg);
}

.hms-bestsellers__slider .flex-direction-nav a.flex-next {
    right: -8px;
}

.hms-bestsellers__slider .flex-direction-nav a.flex-next::before {
    transform: translate(-60%, -50%) rotate(-45deg);
}

.hms-bestsellers__slider .flex-direction-nav a:hover {
    border-color: var(--hms-primary, #7b9f35);
    box-shadow: 0 2px 8px rgba(0,0,0,0.14);
}

.hms-bestsellers__slider .flex-direction-nav .flex-disabled {
    display: none !important;
}

/* ---------- Product card — uniform height ---------- */
.hms-bestsellers__slider .flex-viewport {
    overflow: hidden !important;
}

.hms-bestsellers__slider .slides {
    display: flex !important;
    align-items: stretch !important;
}

.hms-bestsellers__slider .slides li {
    height: auto !important;
    display: flex !important;
}

.hms-bestsellers__card {
    display: flex;
    flex-direction: column;
    background: var(--hms-bg-card, #ffffff);
    border: 1px solid var(--hms-border, #e5e5e0);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 200ms ease, transform 200ms ease;
    height: 100%;
    width: 100%;
}

.hms-bestsellers__card:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

/* ---------- Card image — fixed height, white bg ---------- */
.hms-bestsellers__card-image {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
}

.hms-bestsellers__card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

/* Star rank badge — tiny */
.hms-bestsellers__card-rank {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--hms-primary, #7b9f35);
    color: #fff;
    border-radius: 999px;
}

.hms-bestsellers__card-rank svg {
    width: 10px;
    height: 10px;
}

/* ---------- Card body — tight ---------- */
.hms-bestsellers__card-body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.hms-bestsellers__card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--hms-text, #1a1a1a);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em; /* always reserves 2 lines */
}

/* ---------- Rating — small ---------- */
.hms-bestsellers__card-rating {
    display: flex;
    align-items: center;
    gap: 1px;
}

.hms-bestsellers__card-rating svg {
    width: 11px;
    height: 11px;
}

.hms-bestsellers__card-review-count {
    font-size: 11px;
    color: var(--hms-text-muted, #5a5a5a);
    margin-left: 3px;
}

/* ---------- Price — compact ---------- */
.hms-bestsellers__card-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--hms-text, #1a1a1a);
    margin-top: auto;
}

.hms-bestsellers__card-price del {
    color: var(--hms-text-muted, #5a5a5a);
    font-weight: 400;
    font-size: 11px;
}

.hms-bestsellers__card-price ins {
    text-decoration: none;
    color: var(--hms-accent, #b14f4f);
}

/* ---------- Trust signals — single compact line ---------- */
.hms-bestsellers__trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    padding-top: 10px;
    border-top: 1px solid var(--hms-border, #e5e5e0);
}

.hms-bestsellers__trust-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--hms-text-muted, #5a5a5a);
    white-space: nowrap;
}

.hms-bestsellers__check {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* ---------- Tablet ---------- */
@media (max-width: 768px) {
    .hms-bestsellers__header {
        flex-wrap: wrap;
    }

    .hms-bestsellers__subtitle {
        margin-left: 0;
        width: 100%;
    }

    .hms-bestsellers__slider .flex-direction-nav a.flex-prev { left: 2px; }
    .hms-bestsellers__slider .flex-direction-nav a.flex-next { right: 2px; }
    .hms-bestsellers__slider .flex-direction-nav a { width: 28px; height: 28px; margin-top: -34px; }
}

/* ---------- Small mobile ---------- */
@media (max-width: 480px) {
    .hms-bestsellers {
        padding: 12px 14px;
        border-radius: 8px;
    }

    .hms-bestsellers__card-image {
        max-height: 110px;
    }

    .hms-bestsellers__title {
        font-size: 0.95rem;
    }
}
