/**
 * SmileTech tech UX layer
 * - Anthracite header / cool gray surfaces (replaces cream/mauve feel)
 * - Left category tree (Tech Store–inspired, SmileTech branded)
 * - Slim top utility nav (no horizontal category mega-menu)
 */

/* ── Surfaces ─────────────────────────────────────── */
.bg-cream,
.section-padding.bg-cream {
    background-color: var(--clr-bg-alt) !important;
}

.top-bar {
    background: var(--clr-dark) !important;
}

.site-header {
    background: var(--clr-bg) !important;
    border-bottom: 1px solid var(--clr-border);
}

.nav-bar {
    background: var(--clr-bg-alt) !important;
    border-bottom: 1px solid var(--clr-border);
}

.site-footer {
    background: var(--clr-secondary) !important;
}

.breadcrumb-section {
    background: var(--clr-bg-alt) !important;
}

/* ── Slim top nav (no category dump) ──────────────── */
.nav-bar .main-nav {
    gap: 0.25rem;
}

.nav-bar .st-all-cats-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--clr-primary);
    color: var(--clr-dark);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    border: none;
    cursor: pointer;
    margin-right: 0.75rem;
    white-space: nowrap;
}

.nav-bar .st-all-cats-btn:hover {
    background: var(--clr-primary-hover);
    color: var(--clr-dark);
}

.nav-bar .main-nav > li > a.is-promo {
    color: var(--clr-promo) !important;
    font-weight: var(--fw-semibold);
}

/* Force promo color even if inline styles linger */
.nav-bar .main-nav a[href*="tag=sale"] {
    color: var(--clr-promo) !important;
}

/* ── Page layout with left category rail ──────────── */
.st-layout {
    display: grid;
    grid-template-columns: var(--cat-sidebar-width) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.st-cat-sidebar {
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    z-index: 5;
}

.st-cat-sidebar-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--clr-secondary);
    padding: 0.35rem 1rem 0.75rem;
    margin: 0;
    border-bottom: 2px solid var(--clr-primary);
}

.st-cat-tree {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
}

.st-cat-tree > li {
    border-bottom: 1px solid var(--clr-border-light);
}

.st-cat-tree > li:last-child {
    border-bottom: none;
}

.st-cat-row {
    display: flex;
    align-items: stretch;
}

.st-cat-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem 0.65rem 1rem;
    color: var(--clr-text);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.st-cat-link:hover,
.st-cat-link.is-active {
    background: rgba(255, 209, 0, 0.15);
    color: var(--clr-dark);
}

.st-cat-link.is-active {
    border-left: 3px solid var(--clr-primary);
    padding-left: calc(1rem - 3px);
    font-weight: var(--fw-semibold);
}

.st-cat-toggle {
    width: 36px;
    border: none;
    background: transparent;
    color: var(--clr-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-cat-toggle:hover {
    color: var(--clr-dark);
    background: var(--clr-bg-alt);
}

.st-cat-toggle[aria-expanded="true"] i {
    transform: rotate(90deg);
}

.st-cat-toggle i {
    transition: transform var(--transition-fast);
    font-size: 0.75rem;
}

.st-cat-children {
    list-style: none;
    margin: 0;
    padding: 0 0 0.35rem 0;
    display: none;
    background: var(--clr-bg-alt);
}

.st-cat-children.is-open {
    display: block;
}

.st-cat-children a {
    display: block;
    padding: 0.45rem 1rem 0.45rem 1.75rem;
    font-size: var(--fs-sm);
    color: var(--clr-text-light);
    text-decoration: none;
}

.st-cat-children a:hover,
.st-cat-children a.is-active {
    color: var(--clr-dark);
    background: rgba(255, 209, 0, 0.2);
}

/* Mobile category drawer */
.st-cat-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 1040;
}

.st-cat-drawer-backdrop.is-open {
    display: block;
}

.st-cat-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 88vw);
    background: var(--clr-bg);
    z-index: 1050;
    transform: translateX(-105%);
    transition: transform var(--transition-base);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.st-cat-drawer.is-open {
    transform: translateX(0);
}

.st-cat-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--clr-secondary);
    color: #fff;
}

.st-cat-drawer-header h3 {
    margin: 0;
    font-size: var(--fs-md);
    color: #fff;
    font-family: var(--ff-body);
}

.st-cat-drawer-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
}

/* Shop sidebar tree polish */
.shop-sidebar .st-cat-sidebar {
    position: static;
    max-height: none;
    border: none;
    padding: 0;
}

.shop-sidebar .filter-group h4 {
    color: var(--clr-secondary);
}

/* Product cards — tech feel */
.product-card {
    border-color: var(--clr-border);
}

.product-card-title a {
    color: var(--clr-secondary);
}

.product-card-title a:hover {
    color: var(--clr-info);
}

.product-badge.badge-sale {
    background: var(--clr-promo);
}

.product-card-price .current-price {
    color: var(--clr-secondary);
}

/* Hero CTA already uses primary yellow via tokens */

/* Brands strip */
.st-brands-section {
    background: var(--clr-bg);
    border-top: 1px solid var(--clr-border);
    border-bottom: 1px solid var(--clr-border);
}

.st-brand-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    height: 52px;
    padding: 0 1rem;
    margin: 0.35rem;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    color: var(--clr-secondary);
    font-weight: var(--fw-semibold);
    text-decoration: none;
    background: var(--clr-bg-alt);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.st-brand-chip:hover {
    border-color: var(--clr-primary);
    background: #fff;
    color: var(--clr-dark);
}

/* Homepage promo tiles */
.st-promo-tiles .promo-tile {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    min-height: 160px;
    background: var(--clr-secondary);
    color: #fff;
    text-decoration: none;
    padding: 1.5rem;
}

.st-promo-tiles .promo-tile h3 {
    color: #fff;
    font-size: var(--fs-lg);
    margin-bottom: 0.35rem;
}

.st-promo-tiles .promo-tile span {
    color: var(--clr-primary);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
}

.st-promo-tiles .promo-tile.smartphones { background: linear-gradient(135deg, #0B0F14, #1F2937); }
.st-promo-tiles .promo-tile.laptops { background: linear-gradient(135deg, #1F2937, #4B5563); }
.st-promo-tiles .promo-tile.components { background: linear-gradient(135deg, #0F172A, #334155); }

@media (max-width: 991px) {
    .st-layout {
        grid-template-columns: 1fr;
    }

    .st-layout > .st-cat-sidebar {
        display: none; /* use drawer on tablet/mobile */
    }
}
