/* ═══════════════════════════════════════════════════════════
   YALOSHOP — Brands Carousel  v5.51
   Responsive · RTL-safe · SEO-friendly · Dark-mode ready
   ═══════════════════════════════════════════════════════════ */

/* ── Section wrapper ──────────────────────────────────── */
.ybrands-section {
    padding: 40px 0 0;
}

/* ── Header ───────────────────────────────────────────── */
.ybrands-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.ybrands-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ybrands-header-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--clr-primary) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--clr-primary);
    flex-shrink: 0;
}
.ybrands-title {
    font-size: clamp(18px, 2.5vw, 22px);
    font-weight: 800;
    color: var(--clr-text);
    margin: 0 0 2px;
    line-height: 1.2;
}
.ybrands-subtitle {
    font-size: 13px;
    color: var(--clr-text-3);
    margin: 0;
}
.ybrands-see-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--clr-primary);
    text-decoration: none;
    padding: 8px 16px;
    border: 1.5px solid color-mix(in srgb, var(--clr-primary) 30%, transparent);
    border-radius: var(--radius-lg);
    transition: background .2s, border-color .2s, transform .2s;
    white-space: nowrap;
}
.ybrands-see-all:hover {
    background: color-mix(in srgb, var(--clr-primary) 8%, transparent);
    border-color: var(--clr-primary);
    transform: translateX(-2px);
}
[dir=rtl] .ybrands-see-all:hover { transform: translateX(2px); }

/* ── Track wrapper ────────────────────────────────────── */
.ybrands-track-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.ybrands-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 4px 12px;
    flex: 1;
    cursor: grab;
    list-style: none;
}
.ybrands-track:active  { cursor: grabbing; }
.ybrands-track::-webkit-scrollbar { display: none; }

/* ── Brand Card ───────────────────────────────────────── */
.ybrands-item {
    flex-shrink: 0;
    width: 130px;
    border-radius: var(--radius-xl);
    background: var(--clr-surface);
    border: 1.5px solid var(--clr-border);
    overflow: hidden;
    transition: border-color .25s, transform .25s, box-shadow .25s;
    position: relative;
}
.ybrands-item:hover {
    border-color: var(--clr-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--clr-primary) 20%, transparent);
}
.ybrands-item--featured {
    border-color: color-mix(in srgb, var(--clr-primary) 40%, transparent);
    background: color-mix(in srgb, var(--clr-primary) 4%, var(--clr-surface));
}

/* ── Inner link — fills entire card ──────────────────── */
.ybrands-item-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0 0 8px;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}

/* ── Logo area ────────────────────────────────────────── */
.ybrands-logo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--clr-surface-2);
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background .25s;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.ybrands-item:hover .ybrands-logo-wrap {
    background: color-mix(in srgb, var(--clr-primary) 6%, var(--clr-surface-2));
}
.ybrands-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s cubic-bezier(.4,0,.2,1), filter .25s;
    filter: grayscale(20%);
}
/* Default brand placeholder — fills card fully, no padding, natural crop */
.ybrands-logo-default {
    object-fit: cover;
    padding: 0;
    filter: grayscale(15%) opacity(.85);
}
.ybrands-item:hover .ybrands-logo-img {
    transform: scale(1.04);
    filter: grayscale(0);
}
.ybrands-item:hover .ybrands-logo-default {
    filter: grayscale(0) opacity(1);
}
.ybrands-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    color: var(--clr-primary);
    letter-spacing: .02em;
    background: color-mix(in srgb, var(--clr-primary) 10%, transparent);
    transition: background .25s;
}
.ybrands-item:hover .ybrands-logo-placeholder {
    background: color-mix(in srgb, var(--clr-primary) 16%, transparent);
}

/* ── Featured star badge ──────────────────────────────── */
.ybrands-featured-badge {
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--clr-primary);
    color: #fff;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--clr-primary) 40%, transparent);
}

/* ── Brand name ───────────────────────────────────────── */
.ybrands-info {
    width: 100%;
    padding: 8px 8px 0;
    text-align: center;
}
.ybrands-name {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--clr-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s;
}
.ybrands-item:hover .ybrands-name { color: var(--clr-primary); }

/* ── Navigation arrows ────────────────────────────────── */
.ybrands-arrow {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--clr-surface);
    border: 1.5px solid var(--clr-border);
    color: var(--clr-text);
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.ybrands-arrow:hover {
    background: var(--clr-primary);
    border-color: var(--clr-primary);
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--clr-primary) 35%, transparent);
}
@media (min-width: 768px) { .ybrands-arrow { display: flex; } }

/* ── Progress dots ────────────────────────────────────── */
.ybrands-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}
.ybrands-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--clr-border);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: width .25s, border-radius .25s, background .25s;
}
.ybrands-dot.active {
    width: 20px;
    border-radius: 3px;
    background: var(--clr-primary);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 480px) {
    .ybrands-item { width: 110px; }
    .ybrands-logo-placeholder { font-size: 18px; }
}
@media (min-width: 1024px) {
    .ybrands-item { width: 140px; }
    .ybrands-logo-placeholder { font-size: 24px; }
}

/* ── Dark mode ────────────────────────────────────────── */
body.dark-mode .ybrands-logo-wrap {
    background: color-mix(in srgb, var(--clr-primary) 8%, var(--clr-surface-2));
}
body.dark-mode .ybrands-logo-placeholder {
    background: color-mix(in srgb, var(--clr-primary) 14%, var(--clr-surface-2));
}

/* ── Brand Page Hero Logo — v6.48 ──────────────────────────────────────────
 * Unified with carousel (.ybrands-logo-wrap / .ybrands-logo-img):
 * object-fit:cover + aspect-ratio:16/9 — logo fills the frame fully,
 * no padding, natural crop. Same visual language as the carousel cards.
 * ─────────────────────────────────────────────────────────────────────── */
.brand-hero-logo-wrap {
    position: relative;
    width: 180px;
    aspect-ratio: 16 / 9;
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.brand-hero-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s cubic-bezier(.4,0,.2,1), filter .25s;
    filter: grayscale(10%);
}
.brand-hero-logo-img--default {
    filter: grayscale(15%) opacity(.85);
}
.brand-hero-logo-img--fallback {
    object-fit: cover;
    padding: 0;
}
.brand-hero-logo-initials {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
    color: var(--clr-primary);
    letter-spacing: .04em;
    background: color-mix(in srgb, var(--clr-primary) 10%, transparent);
}
/* Dark mode */
body.dark-mode .brand-hero-logo-wrap {
    background: color-mix(in srgb, var(--clr-primary) 8%, var(--clr-surface-2));
    border-color: var(--clr-border);
}
body.dark-mode .brand-hero-logo-initials {
    background: color-mix(in srgb, var(--clr-primary) 14%, var(--clr-surface-2));
}
/* Responsive: shrink on mobile */
@media (max-width: 480px) {
    .brand-hero-logo-wrap { width: 120px; }
}
