/* Dark theme. Loaded only when $config['menu_theme'] = 'neon'.
   Everything is scoped to body.theme-neon, so the classic design stays untouched.

   System: neutral dark surfaces + hairline borders everywhere;
   red is an accent only (active state, price, title mark). One radius per element size. */

body.theme-neon {
    --bg: #0b090a;
    --surface: #151213;
    --surface-2: #1e1a1b;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #f5f2f2;
    --muted: #9c9596;
    --accent: #e40523;
    --accent-bright: #ff3b55;
    --accent-soft: rgba(228, 5, 35, 0.14);
    --accent-glow: 0 0.25rem 1.25rem rgba(228, 5, 35, 0.35);
    --neon-line: rgba(255, 59, 85, 0.45);
    --neon-glow: 0 0 0.75rem rgba(255, 59, 85, 0.3);
    --neon-glow-strong: 0 0 1.25rem rgba(255, 59, 85, 0.6);
    --radius: 1rem;
    --swiper-navigation-color: var(--accent-bright);

    color-scheme: dark;
    color: var(--text);
    background-color: var(--bg);
    background-image: radial-gradient(70rem 26rem at 50% -8rem, rgba(228, 5, 35, 0.12), transparent 70%);
    background-repeat: no-repeat;
}

/* ---- Tailwind utility colours used in the views ---- */
body.theme-neon .text-black {
    color: var(--text);
}
body.theme-neon .text-\[\#7D7D7D\] {
    color: var(--muted);
}
body.theme-neon .bg-white,
body.theme-neon .bg-white\/90 {
    background-color: var(--surface);
}
body.theme-neon .bg-\[\#F2F2F2\],
body.theme-neon .bg-\[\#F5F5F5\],
body.theme-neon .bg-\[\#f5f5f5\] {
    background-color: #000;
}
body.theme-neon .bg-\[\#7D7D7D\] {
    background-color: var(--line);
}
body.theme-neon .border-\[\#E9E9E9\] {
    border-color: var(--line);
}
body.theme-neon .hover\:bg-\[\#F5F5F5\]:hover,
body.theme-neon .hover\:bg-\[\#E9E9E9\]:hover,
body.theme-neon .hover\:bg-white:hover {
    background-color: var(--surface-2);
}

/* ---- Header ---- */
body.theme-neon #headerMain,
body.theme-neon #headerFixed {
    background-color: rgba(11, 9, 10, 0.9);
    border-bottom: 1px solid var(--neon-line);
    box-shadow: 0 0.125rem 1.25rem rgba(255, 59, 85, 0.22);
}
body.theme-neon #headerFixed {
    background-color: #0b090a;
}
body.theme-neon #openFavorites,
body.theme-neon .js-open-favorites-fixed,
body.theme-neon .js-lang-toggle {
    background-color: var(--surface);
    border-color: var(--neon-line);
    box-shadow: var(--neon-glow);
}
body.theme-neon #openFavorites > img,
body.theme-neon .js-open-favorites-fixed > img {
    filter: invert(1);
}

/* ---- Hero slider ---- */
body.theme-neon .swiper-hero .swiper-slide > div {
    position: relative;
    border: 1px solid var(--neon-line);
}
body.theme-neon .swiper-hero {
    border-radius: var(--radius);
    box-shadow: 0 0 1.5rem rgba(255, 59, 85, 0.25);
}
body.theme-neon .swiper-hero-pagination .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.25);
}
body.theme-neon .swiper-hero-pagination .swiper-pagination-bullet:hover,
body.theme-neon .swiper-hero-pagination .swiper-pagination-bullet-active {
    background: var(--accent-bright);
    box-shadow: 0 0 0.625rem rgba(255, 59, 85, 0.9);
}

/* ---- Slider arrows ---- */
body.theme-neon .swiper-button-prev,
body.theme-neon .swiper-button-next {
    background-color: #1a0a0d;
    border: 1px solid var(--accent-bright);
    box-shadow: 0 0 0.875rem rgba(255, 59, 85, 0.5), inset 0 0 0.5rem rgba(228, 5, 35, 0.25);
    color: var(--accent-bright);
}
body.theme-neon .swiper-button-prev svg,
body.theme-neon .swiper-button-next svg {
    color: var(--accent-bright);
}
body.theme-neon .swiper-button-prev.swiper-button-disabled,
body.theme-neon .swiper-button-next.swiper-button-disabled {
    opacity: 0;
}

/* ---- Categories: photo tiles (photo on top, name below) ---- */
body.theme-neon #section-categories .category-item {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--neon-line);
    border-radius: var(--radius);
    box-shadow: 0 0 0.625rem rgba(255, 59, 85, 0.18);
    transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.15s ease;
}
body.theme-neon #section-categories .category-item > div {
    background-color: #000;
}
body.theme-neon #section-categories .category-item > p {
    color: var(--text);
}
body.theme-neon #section-categories .category-item:active {
    transform: scale(0.97);
}
body.theme-neon #section-categories .category-item.is-active {
    background: linear-gradient(180deg, #2a0a10 0%, #1a070a 100%);
    border: 1px solid var(--accent-bright);
    box-shadow: 0 0 0 1px var(--accent-bright), 0 0 1rem rgba(255, 59, 85, 0.55);
}
/* room for the active glow, which the swiper would otherwise clip */
body.theme-neon .swiper-categories {
    padding: 0.875rem 0.5rem;
    margin: -0.875rem -0.5rem;
}

/* ---- Subcategories: same pill language, one step lighter than categories ---- */
body.theme-neon #subcategories-list .subcat-card {
    min-height: 2.375rem;
    padding: 0.4rem 1rem;
    background: transparent;
    border-color: var(--neon-line);
    color: var(--text);
    box-shadow: none;
}
body.theme-neon #subcategories-list .subcat-card__text {
    font-size: 0.875rem;
}
body.theme-neon #subcategories-list .subcat-card:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
    color: var(--text);
}
body.theme-neon #subcategories-list .subcat-card.is-active,
body.theme-neon #subcategories-list .subcat-card.is-active:hover {
    background: var(--accent-soft);
    border-color: var(--accent-bright);
    color: var(--accent-bright);
    box-shadow: 0 0 0.875rem rgba(255, 59, 85, 0.45);
}

/* ---- Section titles ---- */
body.theme-neon main h2 {
    font-weight: 700;
    letter-spacing: -0.01em;
    text-shadow: 0 0 0.75rem rgba(255, 59, 85, 0.6);
}
body.theme-neon main h2::after {
    content: "";
    display: block;
    width: 2.5rem;
    height: 0.1875rem;
    margin-top: 0.5rem;
    border-radius: 999px;
    background: var(--accent-bright);
    box-shadow: 0 0 0.625rem rgba(255, 59, 85, 0.9);
}
body.theme-neon main h2.text-center::after {
    margin-left: auto;
    margin-right: auto;
}
body.theme-neon .category-products-wrap > div:first-child {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
/* service fee note */
body.theme-neon .category-products-wrap > div:first-child > p {
    margin-top: 0.25rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--neon-line);
    border-radius: 999px;
    font-size: 0.8125rem;
}

/* ---- Product grid ---- */
body.theme-neon main .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

/* ---- Product cards ----
   Neon does not depend on hover (phones/tablets): every card has a steady red outline + glow.
   No endless animations here: they repaint every frame and freeze weak phones. */
body.theme-neon .product-card {
    position: relative;
    overflow: visible;
    background-color: var(--surface);
    border: 1px solid rgba(255, 59, 85, 0.55);
    border-radius: var(--radius);
    box-shadow: var(--neon-glow);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    animation: neon-card-in 0.45s ease-out both;
}
body.theme-neon .product-card:nth-child(2) { animation-delay: 0.05s; }
body.theme-neon .product-card:nth-child(3) { animation-delay: 0.1s; }
body.theme-neon .product-card:nth-child(4) { animation-delay: 0.15s; }
body.theme-neon .product-card:nth-child(n + 5) { animation-delay: 0.2s; }
/* touch / click feedback */
body.theme-neon .product-card:active {
    transform: scale(0.985);
    box-shadow: var(--neon-glow-strong);
}
@media (hover: hover) {
    body.theme-neon .product-card:hover {
        box-shadow: var(--neon-glow-strong);
    }
}
/* photo; static so the heart can sit in the price row of the card */
body.theme-neon .product-card > div:first-child {
    position: static;
    background-color: #000;
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
body.theme-neon .product-card > div:first-child > div.absolute {
    position: static;
    height: 100%;
    min-height: 6.5rem;
}
body.theme-neon .product-card > div:last-child {
    gap: 0.375rem;
    padding: 0.875rem;
}
body.theme-neon .product-card > div:last-child > p:first-child {
    font-size: 0.9375rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
body.theme-neon .product-card > div:last-child > p.line-clamp-2 {
    font-size: 0.8125rem;
    line-height: 1.4;
}
body.theme-neon .product-card > div:last-child > div {
    min-height: 2rem;
    padding-top: 0.5rem;
    padding-right: 2.5rem;
}
body.theme-neon .product-card span.text-black,
body.theme-neon #productPopupPrice {
    color: var(--accent-bright);
    font-size: 1.125rem;
    font-weight: 700;
    text-shadow: 0 0 0.625rem rgba(255, 59, 85, 0.55);
}
body.theme-neon .product-card span.text-\[\#7D7D7D\] {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Heart: bottom-right of the card, in line with the price */
body.theme-neon .product-card .js-favorite-btn {
    top: auto;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 2rem;
    height: 2rem;
    background-color: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: none;
}
body.theme-neon .product-card .js-favorite-btn.is-favorite {
    background-color: var(--accent-soft);
    border-color: rgba(228, 5, 35, 0.5);
}
body.theme-neon .js-favorite-btn .js-favorite-icon {
    width: 1.125rem;
    height: 1.125rem;
}
body.theme-neon .js-favorite-btn .js-favorite-icon-inactive,
body.theme-neon .js-product-popup-fav .js-product-popup-fav-inactive {
    filter: grayscale(1) brightness(3);
    opacity: 0.75;
}

/* ---- Favorites panel and product popup ---- */
body.theme-neon #favoritesSlideover,
body.theme-neon #productPopup {
    background-color: var(--surface);
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.7);
}
body.theme-neon #favoritesSlideover {
    border-left: 1px solid var(--line);
}
body.theme-neon #favoritesOverlay,
body.theme-neon #productPopupOverlay {
    background-color: rgba(0, 0, 0, 0.75);
}
body.theme-neon #closeFavorites img,
body.theme-neon #closeProductPopup img {
    filter: invert(1);
}
body.theme-neon #favoritesPopupContent .js-fav-item p:last-child {
    color: var(--accent-bright);
}
body.theme-neon .js-product-popup-fav.is-favorite {
    background-color: var(--accent-soft);
    border-color: rgba(228, 5, 35, 0.5);
}

/* ---- Footer ---- */
body.theme-neon footer {
    background-color: #070506;
    border-top: 1px solid var(--neon-line);
    box-shadow: 0 -0.125rem 1.25rem rgba(255, 59, 85, 0.18);
}
body.theme-neon footer li > img,
body.theme-neon footer a[href*="s2s.am"] img {
    filter: invert(1);
}

/* ---- Breakpoints (same ones the site uses) ---- */
@media (max-width: 1024px) {
    body.theme-neon main .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 501px) and (max-width: 768px) {
    body.theme-neon main .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 501px) {
    body.theme-neon #productPopup {
        border: 1px solid var(--accent-bright);
        box-shadow: 0 0 2.5rem rgba(255, 59, 85, 0.4);
    }
}

/* Phone: one product per row, photo on the left - readable names, more items per screen */
@media (max-width: 500px) {
    body.theme-neon main .grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.625rem;
    }
    body.theme-neon .product-card {
        flex-direction: row;
        border-radius: 0.875rem;
    }
    body.theme-neon .product-card > div:first-child {
        flex: 0 0 6.75rem;
        width: 6.75rem;
        min-height: 6.75rem;
        aspect-ratio: auto;
        border-radius: calc(0.875rem - 1px) 0 0 calc(0.875rem - 1px);
    }
    body.theme-neon .product-card > div:first-child > img {
        height: 100%;
        min-height: 6.75rem;
    }
    body.theme-neon .product-card > div:last-child {
        min-width: 0;
        padding: 0.75rem;
    }
    body.theme-neon .category-products-wrap h2 {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
    body.theme-neon .category-products-wrap > div:first-child > p {
        margin-top: 0;
        padding: 0.25rem 0.625rem;
        font-size: 0.75rem;
    }
    body.theme-neon .product-card .product-new-label {
        width: 2rem;
        height: 2rem;
    }
    /* chips are swiped by finger; arrows would cover them */
    body.theme-neon .swiper-subcategories-prev,
    body.theme-neon .swiper-subcategories-next {
        display: none;
    }
}

/* ---- Motion ---- */
@keyframes neon-card-in {
    from { opacity: 0; transform: translateY(0.5rem); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    body.theme-neon .product-card {
        animation: none;
    }
}
