/*
 * Mega theme — big-retailer storefront on top of storefront-market.css.
 * Scoped to html[data-theme="mega"]. Black & white with a bright cyan accent:
 * cyan announcement bar, black category bar, pill search and buttons,
 * dense product cards with bold prices and deal tags.
 * Cyan (#00a8d8) is only used behind dark text or as decoration; text in the
 * accent colour uses the darker --mega-cyan-ink for contrast.
 */

html[data-theme="mega"] {
    --sf-mk-gap: 14px;
    --sf-mk-radius: 12px;
    --mega-cyan: var(--theme-color-secondary, #00a8d8);
    --mega-cyan-ink: #007a9c;
}

html[data-theme="mega"] a {
    color: var(--mega-cyan-ink);
}

/* ---------- Announcement bar: cyan, black text ---------- */

html[data-theme="mega"] .sf-ticker {
    background: var(--mega-cyan);
    color: #111111;
    border-bottom: 0;
    font-weight: 600;
}

/* ---------- Masthead ---------- */

html[data-theme="mega"] .sf-masthead {
    border-bottom: 0;
}

html[data-theme="mega"] .sf-masthead-row {
    min-height: 76px;
}

html[data-theme="mega"] .sf-masthead .sf-search {
    max-width: 640px;
}

html[data-theme="mega"] .sf-masthead .sf-search-input {
    height: 46px;
    border: 0;
    border-radius: 999px;
    border-start-end-radius: 0;
    border-end-end-radius: 0;
    background: var(--theme-color-surface);
    padding-inline-start: 22px;
}

html[data-theme="mega"] .sf-masthead .sf-search-input:focus {
    background: #ffffff;
    box-shadow: inset 0 0 0 2px var(--mega-cyan);
}

html[data-theme="mega"] .sf-search-btn {
    border-radius: 0 999px 999px 0;
    background: #111111;
}

[dir="rtl"][data-theme="mega"] .sf-search-btn {
    border-radius: 999px 0 0 999px;
}

html[data-theme="mega"] .sf-action:hover {
    background: var(--theme-color-surface);
    color: #111111;
}

html[data-theme="mega"] .sf-cart-badge {
    background: var(--mega-cyan);
    color: #111111;
    border-color: #ffffff;
}

/* ---------- Category bar: black ---------- */

@media (min-width: 992px) {
    html[data-theme="mega"] .sf-catbar {
        background: #111111;
        border-bottom: 0;
    }

    html[data-theme="mega"] .sf-catbar-link,
    html[data-theme="mega"] .sf-catbar-secondary .sf-catbar-link {
        color: #ffffff;
        font-weight: 600;
        border-bottom-width: 3px;
    }

    html[data-theme="mega"] .sf-catbar-link:hover,
    html[data-theme="mega"] .sf-catbar-link.active {
        color: var(--mega-cyan);
        border-bottom-color: var(--mega-cyan);
    }

    html[data-theme="mega"] .sf-catbar-link.is-all {
        color: #111111;
        background: var(--mega-cyan);
        border-radius: 999px;
        border-bottom-color: transparent;
        padding: 0.35rem 0.9rem;
        margin-block: 0.35rem;
    }
}

/* ---------- Page ---------- */

html[data-theme="mega"] .sf-main:has(.sf-home) {
    background: #ffffff;
}

html[data-theme="mega"] .sf-block {
    margin-top: 2.25rem;
}

html[data-theme="mega"] .sf-row-title {
    font-size: clamp(1.25rem, 1rem + 0.9vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.01em;
}

[dir="rtl"][data-theme="mega"] .sf-row-title {
    letter-spacing: 0;
}

html[data-theme="mega"] .sf-row-meta {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--mega-cyan);
    color: #111111;
    font-size: 0.75rem;
    font-weight: 700;
}

html[data-theme="mega"] .sf-row-link {
    color: #111111;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ---------- Hero ---------- */

html[data-theme="mega"] .sf-hero-main {
    border-radius: var(--theme-radius-lg);
}

html[data-theme="mega"] .sf-hero-main .swiper-hero,
html[data-theme="mega"] .sf-hero-main .hero-slide {
    height: clamp(260px, 36vw, 460px);
}

html[data-theme="mega"] .sf-hero-tag {
    border-radius: 999px;
    background: var(--mega-cyan);
    color: #111111;
}

html[data-theme="mega"] .sf-btn-light {
    border-radius: 999px;
    padding: 0.65rem 1.6rem;
}

html[data-theme="mega"] .sf-promo-tile,
html[data-theme="mega"] .sf-promo-tile:hover {
    border-radius: var(--theme-radius-lg);
    background: #111111;
    color: #ffffff;
    box-shadow: none;
}

html[data-theme="mega"] .sf-promo-tile.is-alt,
html[data-theme="mega"] .sf-promo-tile.is-alt:hover {
    background: var(--mega-cyan);
    color: #111111;
}

html[data-theme="mega"] .sf-promo-tile .sf-promo-tag {
    border-radius: 999px;
    background: var(--mega-cyan);
    color: #111111;
    font-weight: 700;
}

html[data-theme="mega"] .sf-promo-tile.is-alt .sf-promo-tag {
    background: #111111;
    color: #ffffff;
}

/* ---------- Category chips: rounded squares with a cyan ring on hover ---------- */

html[data-theme="mega"] .sf-chip-media {
    border-radius: 18px;
    border: 0;
    background: var(--theme-color-surface);
}

html[data-theme="mega"] .sf-chip:hover .sf-chip-media,
html[data-theme="mega"] .sf-chip:focus-visible .sf-chip-media {
    box-shadow: 0 0 0 3px var(--mega-cyan);
}

html[data-theme="mega"] .sf-chip-label {
    font-weight: 600;
}

/* ---------- Product card ---------- */

html[data-theme="mega"] .sf-product-card {
    border: 1px solid var(--theme-color-border);
    border-radius: var(--sf-mk-radius);
}

html[data-theme="mega"] .sf-product-card:hover {
    border-color: #111111;
}

html[data-theme="mega"] .sf-product-card .sf-product-media {
    background: #ffffff;
    border-bottom: 0;
}

html[data-theme="mega"] .sf-product-card .sf-product-title {
    font-size: 0.86rem;
    font-weight: 500;
}

html[data-theme="mega"] .sf-price-value {
    font-size: 1.2rem;
    font-weight: 800;
}

html[data-theme="mega"] .sf-price-currency {
    color: #111111;
    font-weight: 700;
}

html[data-theme="mega"] .sf-product-perks {
    color: var(--theme-color-success);
    font-weight: 500;
}

html[data-theme="mega"] .sf-flag {
    border-radius: 6px;
    font-weight: 700;
}

html[data-theme="mega"] .sf-flag.is-rank {
    background: var(--mega-cyan);
    color: #111111;
}

html[data-theme="mega"] .sf-flag.is-warning {
    background: var(--theme-color-danger);
}

html[data-theme="mega"] .sf-product-card .sf-product-actions .btn {
    border-radius: 999px;
}

html[data-theme="mega"] .sf-product-card .sf-product-actions .btn-primary {
    background: #111111;
    border-color: #111111;
}

html[data-theme="mega"] .sf-product-card .sf-product-actions .btn-primary:hover,
html[data-theme="mega"] .sf-product-card .sf-product-actions .btn-primary:focus-visible {
    background: var(--mega-cyan);
    border-color: var(--mega-cyan);
    color: #111111;
}

/* ---------- Budget tiers ---------- */

html[data-theme="mega"] .sf-budget-card {
    border: 0;
    border-radius: var(--theme-radius-lg);
    background: var(--theme-color-surface);
}

html[data-theme="mega"] .sf-budget-card:hover {
    background: var(--theme-color-primary-soft);
}

html[data-theme="mega"] .sf-budget-amount {
    font-weight: 800;
}

/* ---------- Reasons, brands, newsletter ---------- */

html[data-theme="mega"] .sf-reason {
    border: 0;
    border-radius: var(--theme-radius-lg);
    background: var(--theme-color-surface);
}

html[data-theme="mega"] .sf-reason > .bi {
    background: #111111;
    color: var(--mega-cyan);
}

html[data-theme="mega"] .sf-brands .sf-brand-logo {
    border: 0;
    background: var(--theme-color-surface);
    border-radius: var(--theme-radius-md);
}

html[data-theme="mega"] .sf-newsletter {
    border: 0;
    border-radius: var(--theme-radius-lg);
    background: #111111;
    color: rgba(255, 255, 255, 0.82);
}

html[data-theme="mega"] .sf-newsletter .sf-row-title {
    color: #ffffff;
}

html[data-theme="mega"] .sf-newsletter-form .form-control {
    border: 0;
    border-radius: 999px;
}

html[data-theme="mega"] .sf-newsletter-form .btn {
    border-radius: 999px;
    background: var(--mega-cyan);
    border-color: var(--mega-cyan);
    color: #111111;
    font-weight: 700;
}

html[data-theme="mega"] .btn {
    border-radius: var(--theme-button-radius, 999px);
}

/* ---------- Page-builder tiles used by the Mega Store template ---------- */

/* Promo / collection tiles: image boxes become cards with a label strip */
html[data-theme="mega"] .bpr-widget--imagebox .bpr-ib {
    background: var(--theme-color-surface);
    border-radius: var(--theme-radius-lg);
    overflow: hidden;
    padding: 0 0 14px;
}

html[data-theme="mega"] .bpr-widget--imagebox .bpr-ib > div:last-child {
    padding-inline: 14px;
}

html[data-theme="mega"] .bpr-widget--imagebox .bpr-ib p {
    display: inline-block;
    margin-top: 6px !important;
    padding: 2px 10px;
    border-radius: 999px;
    background: #111111;
    color: #ffffff !important;
    font-size: 0.75rem;
    font-weight: 700;
}

html[data-theme="mega"] .bpr-widget--features .bpr-f > div {
    border-radius: var(--theme-radius-lg) !important;
}

/* Product rows scroll sideways on every screen size, like a big retailer's shelves */
html[data-theme="mega"] .sf-rail:not(.sf-rail--grid) {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 4 * var(--sf-mk-gap)) / 5);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #111111 var(--theme-color-surface);
}

html[data-theme="mega"] .sf-rail:not(.sf-rail--grid) > .sf-rail-item {
    scroll-snap-align: start;
}

@media (max-width: 1199.98px) {
    html[data-theme="mega"] .sf-rail:not(.sf-rail--grid) {
        grid-auto-columns: calc((100% - 3 * var(--sf-mk-gap)) / 4);
    }
}

@media (max-width: 991.98px) {
    html[data-theme="mega"] .sf-rail:not(.sf-rail--grid) {
        grid-auto-columns: calc((100% - 2 * var(--sf-mk-gap)) / 3);
    }
}

@media (max-width: 767.98px) {
    html[data-theme="mega"] .sf-rail:not(.sf-rail--grid) {
        grid-auto-columns: 46%;
    }
}
