/**
 * Basket layout: page shell, the framework's 12-column row grid, the chrome
 * bands (promo strip, header, departments/footer) and the mobile navigation
 * drawer.
 *
 * Bold big-box retail: a clean white canvas, hairline borders, rounded 16px
 * panels, pill controls, a punchy accent, a yellow deal strip and a green
 * savings colour. All values come from the token layer.
 */

* ,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

/* Clean white canvas, both schemes. No texture. */
body {
    margin: 0;
    background-color: var(--ec-bg);
    color: var(--ec-fg);
    font-family: var(--ec-font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

/* Page shell: boxed via --ec-cw (100% when full width) */
.ts-container {
    max-width: var(--ec-cw);
    margin-inline: auto;
    padding-inline: var(--ec-gut);
}

/* Framework rows: a real 12-column grid */
.ts-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--ec-grid-gap);
    align-items: start;
}

.ts-row + .ts-row {
    margin-top: var(--ec-sect-y);
}

.ts-span-1 { grid-column: span 1; }
.ts-span-2 { grid-column: span 2; }
.ts-span-3 { grid-column: span 3; }
.ts-span-4 { grid-column: span 4; }
.ts-span-5 { grid-column: span 5; }
.ts-span-6 { grid-column: span 6; }
.ts-span-7 { grid-column: span 7; }
.ts-span-8 { grid-column: span 8; }
.ts-span-9 { grid-column: span 9; }
.ts-span-10 { grid-column: span 10; }
.ts-span-11 { grid-column: span 11; }
.ts-span-12 { grid-column: span 12; }

/*
 * Responsive collapse rule (SPEC, Layout): below the md breakpoint every
 * column stacks full width. Per-breakpoint spans are a Studio app feature
 * and will refine this.
 */
@media (max-width: 767.98px) {
    .ts-col {
        grid-column: 1 / -1;
    }

    .ts-row + .ts-row {
        margin-top: calc(var(--ec-sect-y) / 2);
    }
}

/* Page shell between the chrome bands */
.ts-shell {
    padding-block: calc(var(--ec-sect-y) / 2) var(--ec-sect-y);
    min-height: 45vh;
}

/* ------------------------------------------------------------------ *
 * Promo bar: the bright yellow deal strip. Dark deal-fg text reads
 * on the yellow in both schemes, so no dark override is needed.
 * ------------------------------------------------------------------ */
.ts-topbar {
    background: var(--ec-deal);
    color: var(--ec-deal-fg);
    font-size: 13px;
    font-weight: 800;
}

.ts-topbar__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    min-height: 2rem;
    padding-block: 8px;
}

.ts-topbar__text {
    margin: 0;
    text-align: center;
}

.ts-topbar__side {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ts-topbar__side--end {
    justify-content: flex-end;
}

.ts-topbar a {
    color: inherit;
    text-decoration: none;
}

.ts-social-links {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ts-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
    border-radius: 999px;
    color: inherit;
    transition: border-color var(--ec-dur-1) var(--ec-ease), background var(--ec-dur-1) var(--ec-ease);
}

.ts-social:hover {
    border-color: currentColor;
    background: color-mix(in srgb, currentColor 12%, transparent);
}

.ts-social svg {
    width: 13px;
    height: 13px;
}

.ts-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.ts-lang {
    padding: 0.15rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: inherit;
    font-weight: 800;
    opacity: 0.8;
    text-decoration: none;
    transition: opacity var(--ec-dur-1) var(--ec-ease), border-color var(--ec-dur-1) var(--ec-ease);
}

.ts-lang:hover {
    opacity: 1;
}

.ts-lang.is-active {
    opacity: 1;
    border-color: color-mix(in srgb, currentColor 50%, transparent);
}

@media (max-width: 639.98px) {
    .ts-topbar__inner {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 0.35rem;
        padding-block: 7px;
    }

    .ts-topbar__side {
        justify-content: center;
    }
}

/* ------------------------------------------------------------------ *
 * Header band: solid white, 70px, hairline underline. Basket is opaque
 * so the sticky header needs no blur; a backdrop-filter here would also
 * make the header the containing block for the fixed off-canvas nav.
 * ------------------------------------------------------------------ */
.ts-header {
    background: var(--ec-surface);
    border-bottom: 1px solid var(--ec-border);
}

.ts-header.is-sticky {
    position: sticky;
    top: 0;
    z-index: 950;
}

.ts-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 70px;
    position: relative;
}

/* Brand: the accent wordmark with a deal-yellow bullet */
.ts-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--ec-accent);
}

.ts-brand__text {
    font-family: var(--ec-font-display);
    font-weight: 800;
    font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.6875rem);
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
    color: var(--ec-accent);
}

.ts-brand__text::after {
    content: "\2022";
    color: var(--ec-deal);
}

.ts-brand__logo {
    max-height: 2.5rem;
    width: auto;
}

.ts-header__nav {
    flex: 1;
    min-width: 0;
}

.ts-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* Header actions (search, account, scheme toggle): 42px pill-cornered icon
   buttons that wash on hover. */
.ts-action {
    appearance: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 42px;
    height: 42px;
    padding-inline: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ec-fg);
    font-family: var(--ec-font-body);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--ec-dur-1) var(--ec-ease), color var(--ec-dur-1) var(--ec-ease),
                filter var(--ec-dur-1) var(--ec-ease);
}

.ts-action:hover {
    background: var(--ec-surface-2);
    color: var(--ec-fg);
}

/* The cart action is the only header action carrying a count badge; the
   ChromeRenderer emits it (drawer button or cart-page link) with the badge
   span inside. :has() promotes ONLY that action into the prominent red pill,
   leaving search / account / scheme as 42px icon buttons. */
.ts-action:has(.ts-action__badge) {
    min-width: 0;
    width: auto;
    height: 44px;
    padding-inline: 18px;
    border-radius: var(--ec-btn-radius);
    background: var(--ec-accent);
    color: var(--ec-accent-fg);
    font-weight: 800;
}

.ts-action:has(.ts-action__badge):hover {
    background: var(--ec-accent);
    color: var(--ec-accent-fg);
    filter: brightness(0.92);
}

/* Count bubble pinned to the cart pill's top-right, in deal yellow */
.ts-action__badge {
    position: absolute;
    top: 3px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--ec-deal);
    color: var(--ec-deal-fg);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

/* The explicit display above would otherwise defeat the hidden attribute
   the ec-bridge toggles on the badge when the cart is empty. */
.ts-action__badge[hidden] {
    display: none;
}

/* Header variants. Centered = single-row 3-column grid, brand in the middle.
   ChromeRenderer emits brand, nav, actions in that DOM order. */
.ts-header--centered .ts-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "nav brand actions";
    align-items: center;
}

.ts-header--centered .ts-brand {
    grid-area: brand;
    justify-self: center;
}

.ts-header--centered .ts-header__nav {
    grid-area: nav;
    justify-self: start;
    flex: none;
}

.ts-header--centered .ts-header__actions {
    grid-area: actions;
    justify-self: end;
    margin-left: 0;
}

.ts-header--minimal .ts-header__inner {
    justify-content: space-between;
}

/* Navigation: styles Joomla's menu module output */
.ts-header__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

.ts-header__nav li {
    position: relative;
}

.ts-header__nav a,
.ts-header__nav .nav-header,
.ts-header__nav .separator {
    display: inline-flex;
    align-items: center;
    padding: 6px 0;
    color: var(--ec-fg);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: color var(--ec-dur-1) var(--ec-ease);
}

.ts-header__nav a:hover {
    color: var(--ec-accent);
}

.ts-header__nav li.active > a,
.ts-header__nav li.current > a {
    color: var(--ec-accent);
    font-weight: 800;
}

/* Desktop dropdowns for nested menu levels: rounded surface cards */
.ts-header__nav li ul {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 960;
    min-width: 13rem;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    background: var(--ec-surface);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    box-shadow: var(--ec-shadow);
}

.ts-header__nav li:hover > ul,
.ts-header__nav li:focus-within > ul {
    display: flex;
}

.ts-header__nav li ul a {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    font-weight: 700;
}

.ts-header__nav li ul a:hover {
    background: var(--ec-surface-2);
    color: var(--ec-fg);
}

/* Hamburger: a bordered 42px icon button, per the design */
.ts-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--ec-border);
    border-radius: 12px;
    background: transparent;
    color: var(--ec-fg);
    cursor: pointer;
    transition: background var(--ec-dur-1) var(--ec-ease), border-color var(--ec-dur-1) var(--ec-ease);
}

.ts-nav-toggle:hover {
    background: var(--ec-surface-2);
    border-color: var(--ec-fg);
}

/* Mobile: hamburger + slide-in navigation drawer */
@media (max-width: 899.98px) {
    .ts-nav-toggle {
        display: inline-flex;
    }

    .ts-header__nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 990;
        width: min(20rem, 85vw);
        padding: 4.5rem 1.5rem 1.5rem;
        background: var(--ec-surface);
        border-left: 1px solid var(--ec-border);
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform var(--ec-dur-3) var(--ec-ease);
    }

    body.ts-nav-open .ts-header__nav {
        transform: none;
    }

    /* Below the sticky header's 950: the nav panel lives inside the header's
       stacking context, so a higher backdrop would paint over the open panel. */
    body.ts-nav-open::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 940;
        background: rgba(20, 22, 28, 0.5);
    }

    body.ts-nav-open {
        overflow: hidden;
    }

    .ts-header__nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .ts-header__nav a {
        width: 100%;
        padding: 12px 10px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .ts-header__nav a:hover {
        background: var(--ec-surface-2);
    }

    .ts-header__nav li ul {
        display: block;
        position: static;
        min-width: 0;
        padding: 0 0 0 0.75rem;
        border: none;
        box-shadow: none;
        background: none;
    }

    /* The nav is off-canvas here, so the grid collapses to brand + actions */
    .ts-header--centered .ts-header__inner {
        grid-template-columns: auto 1fr;
        grid-template-areas: "brand actions";
    }

    .ts-header--centered .ts-brand {
        justify-self: start;
    }
}

/* Tight phones: the action row must never push the nav toggle off screen */
@media (max-width: 639.98px) {
    .ts-header__inner {
        gap: 0.75rem;
        min-height: 62px;
    }

    .ts-header__actions {
        gap: 0.25rem;
    }

    .ts-action {
        min-width: 38px;
        height: 38px;
    }
}

/* ------------------------------------------------------------------ *
 * Footer: a light surface-2 band with a hairline top rule (both schemes),
 * bold Gabarito headings and muted Nunito links.
 * ------------------------------------------------------------------ */
.ts-footer {
    background: var(--ec-surface-2);
    color: var(--ec-fg);
    border-top: 1px solid var(--ec-border);
    padding-block: 3.5rem 1.5rem;
}

.ts-footer a {
    color: var(--ec-fg);
    text-decoration: none;
    transition: color var(--ec-dur-1) var(--ec-ease);
}

.ts-footer a:hover {
    color: var(--ec-accent);
}

.ts-footer,
.ts-footer p,
.ts-footer li {
    font-size: 13px;
}

.ts-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.ts-footer ul a {
    font-weight: 700;
}

/* Column headings as bold uppercase micro-labels */
.ts-footer h5,
.ts-footer .ts-module__title,
.ts-footer .ts-footer__col h5 {
    margin: 0 0 0.9rem;
    font-family: var(--ec-font-body);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
}

.ts-footer p {
    color: var(--ec-fg-2);
    line-height: 1.7;
    font-weight: 600;
}

/* Rich footer: brand block + auto-fit columns */
.ts-footer__cols {
    display: grid;
    grid-template-columns: 1.4fr repeat(auto-fit, minmax(11rem, 1fr));
    gap: 2rem 2.75rem;
    margin-bottom: 2.5rem;
}

.ts-footer__col a,
.ts-footer__brand a {
    text-decoration: none;
}

.ts-footer__brand {
    display: grid;
    align-content: start;
    gap: 0.75rem;
    max-width: 24rem;
}

.ts-footer__brand .ts-brand,
.ts-footer__brand .ts-brand__text {
    font-size: 1.625rem;
    color: var(--ec-accent);
}

.ts-footer__blurb {
    margin: 0;
    max-width: 34ch;
    line-height: 1.7;
    color: var(--ec-fg-2);
    font-weight: 600;
}

.ts-footer__brand .ts-social-links {
    margin-top: 0.25rem;
    color: var(--ec-fg-2);
}

/* Bottom bar: copyright + payments */
.ts-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem 1.75rem;
    margin-top: 2.5rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--ec-border);
}

.ts-footer__copy {
    margin: 2.25rem 0 0;
    padding-top: 1.15rem;
    border-top: 1px solid var(--ec-border);
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
}

/* Inside the bottom bar the border/padding come from the bar itself. */
.ts-footer__bottom .ts-footer__copy {
    margin: 0;
    padding: 0;
    border: 0;
}

.ts-footer .ts-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--ec-font-body);
    font-size: 12px;
    font-weight: 700;
    color: var(--ec-fg-2);
}

.ts-footer .ts-footer__legal a {
    text-decoration: none;
}

/* Payment chips: bordered surface pills */
.ts-footer__pay {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ts-footer__pay li {
    padding: 4px 10px;
    border: 1px solid var(--ec-border);
    border-radius: 8px;
    background: var(--ec-surface);
    color: var(--ec-fg-2);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Accessibility: skip link */
.ts-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--ec-radius) 0;
    background: var(--ec-accent);
    color: var(--ec-accent-fg);
    font-weight: 800;
}

.ts-skip-link:focus {
    left: 0;
}

/* ------------------------------------------------------------------ *
 * Megamenu skin: the Departments menu. A rounded surface panel of
 * department tiles with the friendly Basket look and deal accents.
 * Single-class selectors win over the framework skeleton by source order.
 * ------------------------------------------------------------------ */
.ts-mega[data-width="container"] {
    border-radius: var(--ec-radius);
}

/* "All Departments" trigger: an ink pill that flips to accent on hover */
.ts-mega-toggle {
    border-radius: 999px;
    background: var(--ec-fg);
    color: var(--ec-bg);
    font-weight: 800;
}

.ts-mega-toggle:hover {
    background: var(--ec-accent);
    color: var(--ec-accent-fg);
}

.ts-mega__title {
    font-family: var(--ec-font-display);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--ec-fg);
}

.ts-mega__group {
    color: var(--ec-fg-2);
    font-weight: 800;
    letter-spacing: 0.1em;
}

.ts-mega__links a {
    border-radius: 10px;
    color: var(--ec-fg-2);
    font-weight: 700;
}

.ts-mega__links a:hover {
    background: var(--ec-surface-2);
    color: var(--ec-fg);
}

.ts-mega__cat,
.ts-mega__prod {
    border-radius: var(--ec-radius);
}

.ts-mega__cat:hover,
.ts-mega__prod:hover {
    background: var(--ec-surface-2);
}

.ts-mega__cat-name,
.ts-mega__prod-name {
    font-weight: 800;
    color: var(--ec-fg);
}

.ts-mega__cat-img,
.ts-mega__cat-ph,
.ts-mega__prod-img,
.ts-mega__prod-ph {
    border-radius: var(--ec-img-radius);
}

.ts-mega__cat-ph,
.ts-mega__prod-ph {
    background: var(--ec-accent-soft);
    color: var(--ec-accent);
    font-family: var(--ec-font-display);
    font-weight: var(--ec-disp-weight);
}

.ts-mega__badge {
    border-radius: 999px;
    background: var(--ec-deal);
    color: var(--ec-deal-fg);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: none;
}

.ts-mega__prod-price {
    color: var(--ec-accent);
    font-family: var(--ec-font-display);
    font-weight: 800;
}

.ts-mega__banner {
    border-radius: var(--ec-radius);
    background: var(--ec-accent);
    color: var(--ec-accent-fg);
}

.ts-mega__banner-eyebrow {
    letter-spacing: 0.1em;
    font-weight: 800;
    opacity: 0.9;
}

.ts-mega__banner-title {
    font-family: var(--ec-font-display);
    font-weight: var(--ec-disp-weight);
    font-size: 21px;
    letter-spacing: -0.02em;
}
