/* ==========================================================================
   Electronics Store — Theme Layer
   A clean, modern e-commerce design system loaded after style.css. Defines
   new tokens and components (es-*) and restyles the shared legacy chrome
   (ax-header, hero, footer, product cards) to match — without touching the
   underlying blade markup contracts those legacy rules depend on.
   ========================================================================== */

:root {
    --es-bg: #ffffff;
    --es-surface: #f6f8fb;
    --es-ink: #0f172a;
    --es-ink-soft: #475569;
    --es-muted: #94a3b8;
    --es-border: #e5e9f0;
    --es-primary: #2454e8;
    --es-primary-dark: #1739b0;
    --es-primary-ink: #0b1a52;
    --es-accent: #f59e0b;
    --es-success: #0f9d58;
    --es-danger: #e23744;
    --es-radius-sm: 8px;
    --es-radius: 14px;
    --es-radius-lg: 20px;
    --es-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
    --es-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --es-shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.14);
    --es-max: 1320px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.es-h2 {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--es-ink);
}

.es-eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--es-primary);
}

.es-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--es-primary);
    transition: gap 0.15s ease, color 0.15s ease;
}
.es-link:hover { gap: 10px; color: var(--es-primary-dark); }

/* ==========================================================================
   PROMO BAR
   ========================================================================== */
.ax-promobar { background: var(--es-accent); border-bottom: 0; }
.ax-promobar__msg { color: #26190a; }
.ax-promobar__msg strong { color: #fff !important; }

/* ==========================================================================
   HEADER — simplified single-row chrome (no mega-menu)
   ========================================================================== */
.ax-header__top {
    background: #ffffff;
    border-bottom: 1px solid var(--es-border);
}

.ax-header__inner {
    height: 84px;
    gap: 28px;
}

.ax-logo img { height: 68px; }

/* Flat top-level links, replacing the old mega-menu row */
.ax-toplinks {
    display: flex;
    align-items: center;
    gap: 26px;
    flex: 0 0 auto;
}
.ax-toplinks a {
    position: relative;
    font-size: 14px;
    font-weight: 600;
    color: var(--es-ink-soft);
    white-space: nowrap;
    transition: color 0.15s ease;
}
.ax-toplinks a:hover,
.ax-toplinks a.is-active { color: var(--es-primary); }
.ax-toplinks a.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -26px;
    height: 3px;
    background: var(--es-accent);
    border-radius: 3px 3px 0 0;
}
.ax-toplinks__deal { color: var(--es-accent) !important; }

.ax-search__input {
    border-radius: 10px;
    border: 1px solid var(--es-border);
    background: var(--es-surface);
    color: var(--es-ink);
}
.ax-search__btn { background: var(--es-primary); border-radius: 8px; }
.ax-search__btn:hover { background: var(--es-primary-dark); }

.ax-action, .ax-action--account { color: var(--es-ink-soft); }
.ax-action:hover, .ax-action--account:hover { color: var(--es-primary); }
.ax-login-btn {
    background: var(--es-primary);
    background: linear-gradient(180deg, #3b68ef 0%, var(--es-primary) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(36, 84, 232, 0.22);
}
.ax-login-btn:hover { filter: brightness(1.05); box-shadow: 0 6px 16px rgba(36, 84, 232, 0.3); }
.ax-toggler span { background: var(--es-ink); }

.ax-action__badge { background: var(--es-accent); color: #26190a; }

@media (max-width: 991.98px) {
    .ax-toplinks { display: none; }
}

/* ==========================================================================
   PROMO / AD BANNERS — admin-managed, shown side by side
   ========================================================================== */
.es-promo { padding: 8px 0 32px; background: var(--es-bg); }
.es-promo__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.es-promo__tile {
    display: block;
    border-radius: var(--es-radius);
    overflow: hidden;
    aspect-ratio: 3.4 / 1;
    background: var(--es-surface);
    box-shadow: var(--es-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.es-promo__tile:hover { transform: translateY(-3px); box-shadow: var(--es-shadow); }
.es-promo__tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 767.98px) { .es-promo__grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   CATEGORY RAIL — circular icons, horizontally scrollable
   ========================================================================== */
.es-catrail {
    background: var(--es-bg);
    padding: 36px 0 8px;
}
.es-catrail__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 18px;
}
.es-catrail__headright { display: flex; align-items: center; gap: 18px; }

/* Single scrollable row at every breakpoint — not a wrapping grid — so adding
   more departments never pushes the rail onto a second row. */
.es-catrail__track {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 22px;
    padding: 4px 2px 18px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.es-catrail__track::-webkit-scrollbar { display: none; }
.es-catrail__item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}
.es-catrail__circle {
    width: 124px;
    height: 124px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.es-catrail__circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.es-catrail__item:hover .es-catrail__circle {
    transform: translateY(-4px);
    box-shadow: var(--es-shadow);
    border-color: var(--es-primary);
}
.es-catrail__label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--es-ink-soft);
    line-height: 1.25;
}
.es-catrail__item:hover .es-catrail__label { color: var(--es-primary); }

/* ==========================================================================
   CUSTOMER REVIEWS — real testimonials, horizontally scrollable
   ========================================================================== */
.es-reviews { background: var(--es-surface); padding: 44px 0; }
.es-reviews__track {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.es-reviews__track::-webkit-scrollbar { display: none; }
.es-review-card {
    flex: 0 0 calc((100% - 2 * 18px) / 3);
    background: #fff;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--es-shadow-sm);
}
@media (max-width: 991.98px) { .es-review-card { flex-basis: calc((100% - 18px) / 2); } }
@media (max-width: 575.98px) { .es-review-card { flex-basis: 100%; } }
.es-review-card__stars { display: flex; gap: 3px; color: var(--es-accent); margin-bottom: 14px; }
.es-review-card__stars svg { width: 17px; height: 17px; }
.es-review-card__title { margin: 0 0 8px; font-size: 14.5px; font-weight: 700; color: var(--es-ink); }
.es-review-card__body {
    margin: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--es-ink-soft);
    flex: 1;
}
.es-review-card__foot { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--es-border); }
.es-review-card__avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
    background: var(--es-primary); color: #fff; font-size: 15px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.es-review-card__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.es-review-card__who strong { font-size: 13px; color: var(--es-ink); }
.es-review-card__who a { font-size: 12px; color: var(--es-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   PRODUCT CARDS — refreshed
   ========================================================================== */
.ax-product {
    background: #ffffff;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    box-shadow: var(--es-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.ax-product:hover {
    box-shadow: var(--es-shadow);
    border-color: #c9d4ea;
    transform: translateY(-3px);
}
.ax-product__brand { color: var(--es-primary) !important; font-weight: 700 !important; }
.ax-product__price { color: var(--es-ink) !important; }
.ax-product__off {
    background: rgba(226, 55, 68, 0.1);
    color: var(--es-danger);
    border-radius: 6px;
    padding: 1px 6px;
    font-weight: 700;
}
.ax-product__btn {
    background: var(--es-primary) !important;
    border-color: var(--es-primary) !important;
}
.ax-product__btn:hover { background: var(--es-primary-dark) !important; }

/* ==========================================================================
   SECTION BACKDROPS — alternate white / soft surface for rhythm
   ========================================================================== */
.ax-picks--light { background: var(--es-surface) !important; }
.ax-picks--light::before, .ax-picks--light::after { display: none; }
.ax-sec-title::after { background: var(--es-primary); }

/* Carousel arrows (product strips + category rail) — flat, borderless pills. */
.ax-arrow, .ax-picks--light .ax-arrow {
    border: 0;
    background: var(--es-surface);
    color: var(--es-ink);
}
.ax-arrow--next, .ax-picks--light .ax-arrow--next {
    background: var(--es-primary);
    color: #fff;
}
.ax-arrow:hover, .ax-picks--light .ax-arrow:hover {
    background: var(--es-primary-dark);
    color: #fff;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.ax-footer { background: var(--es-primary-ink); }
.ax-footer__news { background: rgba(255,255,255,0.04); border-radius: var(--es-radius); padding: 22px; }
.ax-footer h3 span { color: var(--es-accent) !important; }
.ax-footer__form button { background: var(--es-primary) !important; }

/* ==========================================================================
   AUTH MODAL — light theme override
   ========================================================================== */
.ax-authm__dialog { background: #fff; color: var(--es-ink); border: 1px solid var(--es-border); box-shadow: var(--es-shadow-lg); }
.ax-authm__close { color: var(--es-muted); }
.ax-authm__close:hover { color: var(--es-ink); }
.ax-authm__brand img { filter: none; }
.ax-authm__tabs { background: var(--es-surface); }
.ax-authm__tab { color: var(--es-ink-soft); }
.ax-authm__tab.is-active { background: var(--es-primary); color: #fff; }
.ax-authm__hint { color: var(--es-ink-soft); }
.ax-authm__hint strong { color: var(--es-ink); }
.ax-authm__label { color: var(--es-ink-soft); }
.ax-authm__inwrap, .ax-authm__input--full, .ax-authm__digit {
    background: var(--es-surface);
    border-color: var(--es-border);
    color: var(--es-ink);
}
.ax-authm__prefix { color: var(--es-ink-soft); border-color: var(--es-border); }
.ax-authm__inwrap:focus-within, .ax-authm__input--full:focus, .ax-authm__digit:focus { border-color: var(--es-primary); }
.ax-authm__btn { background: var(--es-primary); color: #fff; }
.ax-authm__btn:hover { background: var(--es-primary-dark); }
.ax-authm__link { color: var(--es-primary); }
.ax-authm__terms { color: var(--es-muted); }
.ax-authm__terms a { color: var(--es-primary); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 767.98px) {
    .es-catrail__track { gap: 14px; }
    .es-catrail__item { width: 92px; }
    .es-catrail__circle { width: 92px; height: 92px; }
    .es-catrail__headright { gap: 10px; }
    .es-h2 { font-size: 20px; }
}
