/* ── Home "Shop by category" widget (widgets/shop_by_category.blade.php) ──
   Layout A: grouped category cards with product circles.
   Layout B: spotlight banner, sub-category tiles and a rail of compact
   product cards (the shared product card, variant="compact").
   Theme tokens only, so light and dark need no separate rules. */
.sbc-scope .home-section-head { margin-bottom: 16px; }

/* — Layout A: grouped circles — */
.sbc-grouped {
    background: var(--theme-surface-muted);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius-3xl);
}
.sbc-grouped-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.sbc-grouped-column { min-width: 0; }
.sbc-grouped-card {
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius-2xl);
    padding: 16px 14px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s, transform .25s;
}
.sbc-grouped-card:hover { box-shadow: var(--theme-shadow-md); transform: translateY(-3px); }
.sbc-grouped-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sbc-grouped-name { min-width: 0; overflow-wrap: anywhere; font-size: .95rem; font-weight: 700; color: var(--theme-text-strong); margin: 0; }
.sbc-grouped-all,
.sbc-grouped-all:visited { font-size: .78rem; font-weight: 700; color: var(--theme-accent); text-decoration: none; white-space: nowrap; }
.sbc-grouped-all:hover { color: var(--theme-accent-hover); text-decoration: underline; }
.sbc-grouped-banner {
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--theme-radius-lg); overflow: hidden; margin-bottom: 14px; aspect-ratio: 16 / 10;
    background: #ffffff; /* catalogue artwork is drawn on white */
    border: 1px solid var(--theme-border);
}
.sbc-grouped-banner img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .4s; }
.sbc-grouped-card:hover .sbc-grouped-banner img { transform: scale(1.04); }
.sbc-single .sbc-grouped-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; }
.sbc-single .sbc-grouped-top { grid-column: 1 / -1; margin: 0; }
.sbc-single .sbc-grouped-banner { margin: 0; }
.sbc-single .sbc-circle-grid { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin: 0; align-content: center; }
.sbc-circle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; margin-top: auto; }
.sbc-circle-item,
.sbc-circle-item:visited { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; min-width: 0; color: var(--theme-text); }
.sbc-circle-item:hover { text-decoration: none; }
.sbc-circle-img {
    width: 76px; height: 76px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: #ffffff; border: 1px solid var(--theme-border);
    display: flex; align-items: center; justify-content: center; padding: 6px;
}
.sbc-circle-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sbc-circle-item:hover .sbc-circle-img { outline: 2px solid var(--theme-accent); outline-offset: 2px; }
.sbc-circle-name {
    font-size: .78rem; font-weight: 600; color: var(--theme-text-strong); margin: 8px 0 2px; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sbc-price-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; align-items: baseline; font-size: .75rem; color: var(--theme-text-muted); }
.sbc-price-line del { color: var(--theme-text-muted); font-size: .72rem; }
.sbc-price-line strong { color: var(--theme-accent); font-size: .85rem; font-weight: 800; }
.sbc-stock-unavailable { font-size: .72rem; font-weight: 700; color: var(--theme-danger-text); }
.sbc-circle-empty { grid-column: 1 / -1; text-align: center; padding: 18px 8px; color: var(--theme-text-muted); font-size: .82rem; }

/* — Layout B: spotlight — */
.sbc-spot {
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius-3xl);
    box-shadow: var(--theme-shadow-sm);
    padding: 22px;
}
.sbc-spot-controls { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.sbc-arrow {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--theme-border-strong); background: var(--theme-surface); color: var(--theme-text);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: .85rem;
    transition: background .2s, color .2s, border-color .2s;
}
.sbc-arrow:hover { background: var(--theme-primary); border-color: var(--theme-primary); color: var(--theme-on-primary); }
.sbc-arrow:disabled { opacity: .35; cursor: default; }
.sbc-spot-top { display: grid; grid-template-columns: 300px 1fr; gap: 16px; margin-bottom: 22px; align-items: stretch; }
.sbc-spot-banner,
.sbc-spot-banner:visited {
    position: relative; display: flex; flex-direction: column; justify-content: space-between;
    padding: 22px; border-radius: var(--theme-radius-2xl); overflow: hidden; text-decoration: none;
    background: var(--theme-accent-soft); border: 1px solid var(--theme-accent-border);
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.sbc-spot-banner:hover { transform: translateY(-2px); box-shadow: var(--theme-shadow-md); border-color: var(--theme-accent); text-decoration: none; }
.sbc-spot-banner-badge {
    display: inline-flex; align-items: center; width: fit-content; margin-bottom: 8px;
    padding: 3px 10px; border-radius: var(--theme-radius-pill); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    background: var(--theme-accent-strong); color: var(--theme-on-accent);
}
.sbc-spot-banner-title { font-size: 1.3rem; font-weight: 800; color: var(--theme-text-strong); line-height: 1.2; margin: 0 0 6px; }
.sbc-spot-banner-cta { display: inline-flex; align-items: center; margin-top: auto; font-size: .84rem; font-weight: 700; color: var(--theme-accent); }
.sbc-spot-banner:hover .sbc-spot-banner-cta { text-decoration: underline; }
.sbc-spot-banner-media { display: flex; align-items: center; justify-content: center; height: 140px; margin: 10px 0; }
.sbc-spot-banner-media img { width: auto; height: auto; max-width: 100%; max-height: 140px; object-fit: contain; transition: transform .35s; }
.sbc-spot-banner:hover .sbc-spot-banner-media img { transform: scale(1.05); }
.sbc-sub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; align-content: stretch; }
.sbc-sub-tile,
.sbc-sub-tile:visited {
    display: flex; flex-direction: column; align-items: center; text-align: center; height: 100%;
    padding: 14px; border-radius: var(--theme-radius-2xl); text-decoration: none;
    background: var(--theme-surface); border: 1px solid var(--theme-border);
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.sbc-sub-tile:hover { transform: translateY(-3px); box-shadow: var(--theme-shadow-md); border-color: var(--theme-accent); text-decoration: none; }
.sbc-sub-thumb {
    width: 100%; height: 140px; flex-shrink: 0; overflow: hidden; margin-bottom: 12px; padding: 12px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--theme-radius-xl); background: #ffffff; border: 1px solid var(--theme-border);
}
.sbc-sub-thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; transition: transform .35s; }
.sbc-sub-tile:hover .sbc-sub-thumb img { transform: scale(1.06); }
.sbc-sub-name {
    font-size: .92rem; font-weight: 700; color: var(--theme-text-strong); line-height: 1.3; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.sbc-sub-count { margin-top: auto; padding: 3px 12px; border-radius: var(--theme-radius-pill); font-size: .74rem; font-weight: 600; background: var(--theme-neutral-bg); color: var(--theme-neutral-text); }

/* Rail of compact product cards */
.sbc-rail { display: flex; gap: 14px; overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x mandatory; padding: 4px 2px 10px; scrollbar-width: none; }
.sbc-rail::-webkit-scrollbar { display: none; }
.sbc-rail-item { flex: 0 0 calc(16.666% - 12px); min-width: 170px; scroll-snap-align: start; }
.sbc-empty { padding: 28px; text-align: center; color: var(--theme-text-muted); font-size: .85rem; border: 1px dashed var(--theme-border-strong); border-radius: var(--theme-radius-xl); }

@media (max-width: 991px) {
    .sbc-spot-top { grid-template-columns: 1fr; }
    .sbc-spot-banner { min-height: 180px; }
    .sbc-sub-grid { grid-template-columns: repeat(3, 1fr); }
    .sbc-rail-item { flex-basis: calc(33.333% - 10px); min-width: 160px; }
}
@media (max-width: 575px) {
    .sbc-single .sbc-grouped-card { display: flex; }
    .sbc-single .sbc-circle-grid { grid-template-columns: 1fr 1fr; }
    .sbc-sub-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .sbc-rail-item { flex-basis: calc(50% - 7px); min-width: 150px; }
    .sbc-spot { padding: 16px; }
}
