/* Лендинг: один экран на телефоне, шит «подробнее», без скролла страницы. */

/* Превью продукта в #productDetail: арт + prev/next */
html[data-theme] .product-detail-panel {
    max-height: min(86vh, 720px);
}
html[data-theme] .product-detail-close {
    z-index: 3;
}
html[data-theme] .product-detail-art {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    width: 100%;
    height: 200px;
    margin: 0 0 16px;
    border-radius: 16px;
    background:
        radial-gradient(ellipse at 20% 40%, rgba(168, 85, 247, 0.28), transparent 58%),
        radial-gradient(ellipse at 80% 70%, rgba(124, 92, 252, 0.2), transparent 55%),
        #0b1020;
    touch-action: pan-x;
}
html[data-theme] #productDetailArt {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    border-radius: 16px;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    touch-action: none;
}
html[data-theme] #productDetailArt:not([src]) {
    opacity: 0;
}
html[data-theme] .product-detail-art #productDetailArt {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    transform-origin: center center;
    will-change: transform;
}
html[data-theme] .product-detail-art.is-playing #productDetailArt {
    animation: productArtKen 22s ease-in-out infinite alternate;
}
html[data-theme] .product-detail-art::after {
    content: "";
    position: absolute;
    inset: -30%;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 28%, rgba(192, 132, 252, 0.2), transparent 68%),
        linear-gradient(to top, rgba(18, 24, 42, 0.45), transparent 42%);
    opacity: 0.7;
}
html[data-theme] .product-detail-art.is-playing::after {
    animation: productArtDrift 16s ease-in-out infinite alternate;
}
html[data-theme] .product-detail-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(10, 14, 26, 0.48);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    appearance: none;
    -webkit-appearance: none;
    font-size: 0;
    line-height: 0;
    touch-action: manipulation;
}
html[data-theme] .product-detail-prev {
    left: 10px;
}
html[data-theme] .product-detail-next {
    right: 10px;
}
html[data-theme] .product-detail-nav::before {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    display: block;
}
html[data-theme] .product-detail-prev::before {
    transform: rotate(-135deg);
    margin-left: 3px;
}
html[data-theme] .product-detail-next::before {
    transform: rotate(45deg);
    margin-right: 3px;
}
html[data-theme] .product-detail-nav:hover {
    background: rgba(124, 92, 252, 0.42);
    border-color: rgba(216, 180, 254, 0.45);
}
html[data-theme] .product-detail-nav:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
html[data-theme="light"] .product-detail-art {
    background:
        radial-gradient(ellipse at 20% 40%, rgba(124, 92, 252, 0.2), transparent 58%),
        #eef2ff;
}
html[data-theme="light"] .product-detail-art::after {
    background:
        linear-gradient(115deg, transparent 28%, rgba(139, 92, 246, 0.16), transparent 68%),
        linear-gradient(to top, rgba(255, 255, 255, 0.35), transparent 42%);
}
html[data-theme="light"] .product-detail-nav {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

@keyframes productArtKen {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.08) translate(-2.2%, 1.6%); }
}
@keyframes productArtDrift {
    0% { transform: translate(-6%, 2%) rotate(0deg); opacity: 0.55; }
    100% { transform: translate(8%, -5%) rotate(7deg); opacity: 0.88; }
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme] .product-detail-art.is-playing #productDetailArt,
    html[data-theme] .product-detail-art.is-playing::after {
        animation: none;
    }
}


@media (max-width: 768px) {
    html,
    body,
    .page {
        height: 100dvh;
        overflow: hidden;
    }
    html[data-theme],
    html[data-theme] body,
    html[data-theme] .page {
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        overflow-x: hidden;
        overflow-y: hidden;
    }
    html[data-theme] body {
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        overscroll-behavior: none;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    html[data-theme] .header {
        top: 8px;
        width: calc(100% - 16px);
        height: 48px;
        z-index: 100;
    }

    html[data-theme] .main {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        flex-wrap: nowrap;
        width: 100%;
        min-height: 0;
        height: auto;
        margin-top: 64px;
        padding: 0;
        overflow: hidden;
    }

    html[data-theme] .hero-section {
        flex: 1 1 38%;
        min-height: 0;
        max-height: 42%;
        padding: 0;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    html[data-theme] .hero-content {
        padding: 8px 12px;
        max-width: 100%;
        max-height: 100%;
    }
    html[data-theme] .hero-content .brand {
        font-size: 28px;
        letter-spacing: 2px;
        margin-bottom: 2px;
    }
    html[data-theme] .hero-content .tagline {
        min-height: 0;
        margin-bottom: 4px;
        gap: 0;
    }
    html[data-theme] .hero-content .tagline .product {
        font-size: 18px;
        letter-spacing: 2px;
    }
    html[data-theme] .hero-content .tagline .product span {
        font-size: 20px;
    }
    html[data-theme] .hero-content .tagline .desc {
        font-size: 12px;
        min-height: 0;
        letter-spacing: 0.4px;
        line-height: 1.3;
    }
    html[data-theme] .hero-content .badge {
        margin-top: 8px;
        min-height: 44px;
        padding: 10px 22px;
        font-size: 13px;
        letter-spacing: 0.12em;
    }
    html[data-theme] .hero-slide {
        max-width: min(70%, 220px);
        max-height: 58%;
    }

    html[data-theme] .login-section {
        flex: 1 1 58%;
        min-height: 0;
        padding: 6px 12px 8px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
    }
    html[data-theme] .login-box {
        max-width: 100%;
        max-height: 100%;
        min-height: 0;
        width: 100%;
        padding: 14px 14px 12px;
        border-radius: 18px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
    html[data-theme] .auth-tabs {
        position: sticky;
        top: 0;
        z-index: 2;
        margin-bottom: 12px;
        background: var(--bg-input);
    }
    html[data-theme] .auth-tab {
        font-size: 14px;
        padding: 10px 0;
        min-height: 40px;
    }
    html[data-theme] .auth-form .form-group {
        margin-bottom: 10px;
    }
    html[data-theme] .auth-form .form-group > label,
    html[data-theme] .login-form .form-group > label {
        font-size: 11px;
        margin-bottom: 4px;
    }
    html[data-theme] .auth-form input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]),
    html[data-theme] .login-form input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]) {
        padding: 12px 14px;
        font-size: 16px;
        min-height: 44px;
        border-radius: 12px;
    }
    html[data-theme] .login-box label.remember-me {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: auto;
        min-height: 0;
        min-width: 0;
        margin: 0;
        padding: 0;
        font-size: 13px;
        font-weight: 400;
        text-transform: none;
        letter-spacing: 0;
    }
    html[data-theme] .login-box label.remember-me input[type="checkbox"] {
        width: 16px;
        height: 16px;
        min-width: 16px;
        min-height: 16px;
        max-width: 16px;
        max-height: 16px;
        margin: 0;
        padding: 0;
    }
    html[data-theme] .form-options {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 12px;
        margin: 0 0 12px;
        font-size: 13px;
    }
    html[data-theme] .login-btn {
        padding: 12px;
        font-size: 16px;
        min-height: 44px;
        border-radius: 12px;
    }

    html[data-theme] .footer {
        flex-shrink: 0;
        height: calc(28px + env(safe-area-inset-bottom, 0px));
        padding: 0 12px env(safe-area-inset-bottom, 0px);
        overflow: hidden;
    }
    html[data-theme] .footer p {
        font-size: 10px;
        letter-spacing: 1px;
    }

    /* Шит продукта: снизу, на весь экран по ширине */
    html[data-theme] #productDetail {
        align-items: flex-end;
        justify-content: stretch;
        padding: 0;
        background: rgba(8, 12, 24, 0.55);
    }
    html[data-theme] .product-detail-panel {
        max-width: none;
        width: 100%;
        max-height: min(88dvh, 100%);
        padding: 14px 18px calc(20px + env(safe-area-inset-bottom, 0px));
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
    }
    html[data-theme] .product-detail-panel::before {
        content: "";
        display: block;
        width: 36px;
        height: 4px;
        margin: 0 auto 12px;
        border-radius: 99px;
        background: rgba(148, 163, 184, 0.45);
    }
    html[data-theme] .product-detail-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
    }
    html[data-theme] .product-detail-title {
        font-size: 22px;
        padding-right: 44px;
        margin-bottom: 12px;
    }
    html[data-theme] .product-detail-about {
        font-size: 14px;
        touch-action: pan-y;
    }
    html[data-theme] .product-detail-art,
    html[data-theme] #productDetailArt {
        height: 148px;
        border-radius: 14px;
        margin-bottom: 12px;
    }
    html[data-theme] .product-detail-nav {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 768px) and (max-height: 700px) {
    html[data-theme] .header {
        top: 6px;
        height: 44px;
    }
    html[data-theme] .main {
        margin-top: 56px;
    }
    html[data-theme] .hero-section {
        flex-basis: 34%;
        max-height: 36%;
    }
    html[data-theme] .hero-content .brand {
        font-size: 22px;
        letter-spacing: 1px;
    }
    html[data-theme] .hero-content .tagline .product,
    html[data-theme] .hero-content .tagline .product span {
        font-size: 16px;
    }
    html[data-theme] .hero-content .badge {
        min-height: 40px;
        padding: 8px 18px;
        font-size: 12px;
        margin-top: 6px;
    }
    html[data-theme] .product-detail-art,
    html[data-theme] #productDetailArt {
        height: 120px;
    }
    html[data-theme] .login-box {
        padding: 10px 12px;
        border-radius: 16px;
    }
    html[data-theme] .auth-tabs {
        margin-bottom: 8px;
    }
    html[data-theme] .auth-tab {
        padding: 8px 0;
        min-height: 36px;
        font-size: 13px;
    }
    html[data-theme] .footer {
        height: calc(24px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    html[data-theme] .main {
        flex-direction: row;
        margin-top: 52px;
    }
    html[data-theme] .hero-section {
        flex: 1 1 46%;
        max-height: none;
    }
    html[data-theme] .login-section {
        flex: 1 1 54%;
        padding: 6px 10px 6px 6px;
    }
    html[data-theme] #productDetail {
        align-items: stretch;
        justify-content: flex-end;
    }
    html[data-theme] .product-detail-panel {
        width: min(420px, 100%);
        max-height: 100%;
        height: 100%;
        margin-left: auto;
        border-radius: 16px 0 0 16px;
        padding: 20px 18px 16px;
    }
    html[data-theme] .product-detail-panel::before {
        display: none;
    }
    html[data-theme] .product-detail-art,
    html[data-theme] #productDetailArt {
        height: 132px;
    }
}

html[data-theme="light"] .product-detail-panel::before {
    background: rgba(100, 116, 139, 0.45);
}

@media (hover: none) {
    html .hero-content .badge:hover {
        transform: none;
    }
    html[data-theme] .product-detail-close:hover {
        background: rgba(124, 92, 252, 0.16);
    }
    html[data-theme="light"] .product-detail-close:hover {
        background: rgba(91, 33, 182, 0.1);
    }
    html[data-theme] .product-detail-nav:hover {
        background: rgba(10, 14, 26, 0.48);
        border-color: rgba(255, 255, 255, 0.18);
    }
}
