@font-face {
    font-family: "JMH Typewriter";
    src: url("../JMH Typewriter.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "JMH Typewriter", "Courier New", monospace;
}

body {
    background: #FFFFFF;
    color: #222;
}

body.catalog-page,
body.archive-page,
body.product-detail-page,
body.checkout-page-body {
    background-color: #FFFFFF;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
        url('../image/bg.png');
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

html {
    scroll-behavior: smooth;
}

/* ===================== ГЛАВНЫЙ ЭКРАН ===================== */

.home-page {
    min-height: 100%;
    overflow: hidden;
    background: #111;
}

.announcement {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    height: 28px;
    overflow: hidden;
    background: #000;
    color: #a0c0b3;
    white-space: nowrap;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
}

.announcement__track {
    display: flex;
    align-items: center;
    width: max-content;
    height: 28px;
    animation: announcement-scroll 80s linear infinite;
    will-change: transform;
}

.announcement__text {
    flex: 0 0 auto;
    padding-right: 40px;
    font-size: 14px;
    line-height: 14px;
    letter-spacing: 0.56px;
}

@keyframes announcement-scroll {
    to {
        transform: translateX(-50%);
    }
}

.home-screen {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
}

.home-screen__scene {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100vw, calc(100vh * 4 / 3));
    width: max(100vw, calc(100svh * 4 / 3));
    aspect-ratio: 4 / 3;
    container-type: inline-size;
    transform: translate(-50%, -50%);
}

.home-screen__background {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center;
}

.home-screen__photo1 {
    position: absolute;
    z-index: 5;
    top: 15%;
    right: 37%;
    width: 27%;
    height: 42%;
}

.home-screen__photo2 {
    position: absolute;
    z-index: 5;
    top: 37%;
    right: 8%;
    width: 30%;
    height: 45%;
}

.home-screen__photo3 {
    position: absolute;
    z-index: 5;
    top: 54%;
    right: 40%;
    width: 32%;
    height: 32%;
}

/* Фото и логотип на главной слегка отъезжают влево вверх при наведении.
   Сдвиг в процентах от размера самой картинки, поэтому эффект одинаков на любом экране.
   Движение намеренно резкое: linear без разгона и торможения. */
.home-screen__photo1,
.home-screen__photo2,
.home-screen__photo3,
.home-screen__logo {
    transition: transform 175ms linear;
    will-change: transform;
}

.home-screen__photo1:hover,
.home-screen__photo2:hover,
.home-screen__photo3:hover,
.home-screen__logo:hover {
    transform: translate(-3%, -4%);
}

/* Фото при наведении поднимается над соседними фото, но не над логотипом. */
.home-screen__photo1:hover,
.home-screen__photo2:hover,
.home-screen__photo3:hover {
    z-index: 6;
}

@media (prefers-reduced-motion: reduce) {

    .announcement__track {
        animation: none;
    }

    .home-screen__photo1,
    .home-screen__photo2,
    .home-screen__photo3,
    .home-screen__logo {
        transition: none;
    }
}

/* Логотип всегда поверх фото, в том числе когда фото поднято наведением. */
.home-screen__logo {
    display: block;
    position: absolute;
    z-index: 7;
    top: 14%;
    right: -2%;
    width: 35%;
    height: 35%;
    object-fit: contain;
}

.home-screen__logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.phone-menu {
    position: absolute;
    top: 20%;
    left: -9%;
    width: 45%;
    aspect-ratio: 1;
}

.phone-menu__device {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.phone-menu__screen {
    position: absolute;
    top: 20.5%;
    left: 36.7%;
    width: 26.5%;
    height: 25%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.235cqw;
    font-family: "Courier New", Courier, monospace;
    font-size: 1.094cqw;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    z-index: 10;
}

.phone-menu__screen * {
    font-family: "Courier New", Courier, monospace;
}

.phone-menu__item {
    position: relative;
    display: block;
    width: 100%;
    padding: 0.313cqw 0.391cqw 0.313cqw 1.406cqw;
    overflow: hidden;
    color: #381109;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px rgba(255, 205, 168, 0.55);
    outline: none;
}

.phone-menu__item::before {
    content: ">";
    position: absolute;
    left: 0.469cqw;
    opacity: 0;
}

.phone-menu__item:hover,
.phone-menu__item:focus-visible,
.phone-menu__item.is-selected {
    color: #2d0b04;
    background: rgba(255, 236, 205, 0.86);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(112, 31, 15, 0.7);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.45), inset 0 -1px rgba(147, 45, 24, 0.25);
    text-shadow: none;
}

.phone-menu__item:hover::before,
.phone-menu__item:focus-visible::before,
.phone-menu__item.is-selected::before {
    opacity: 1;
}

.phone-menu__cart {
    top: calc(50%+50px);
    right: auto;
    left: calc(100% + 30px);
    width: 420px;
    zoom: calc(100cqw / 1280px);
    color: #222;
    font-family: "JMH Typewriter", "Courier New", monospace;
    font-size: 14px;
    font-weight: normal;
    letter-spacing: normal;
    text-transform: none;
}

.phone-menu__cart * {
    font-family: "JMH Typewriter", "Courier New", monospace;
}

/* ===================== ХЕДЕР ===================== */

.header__fear_my_fears__top {
    color: #2A2A2A;
    background: #B6BCC2;
    text-align: center;
    width: 100%;
    margin: 10px 0px;
}

.header__fear_my_fears__middle {
    background:
        linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
        #1a1a1a url('../image/lowersite.png') top center / cover no-repeat;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    color: #fff;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 80px;
    position: relative;
}

.header__fear_my_fears__middle ul {
    display: flex;
    gap: 50px;
    list-style: none;
}

.header__center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header__center img {
    height: 48px;
    filter: brightness(0) invert(1);
}

.header__fear_my_fears__middle li {
    font-size: 17px;
    font-weight: 400;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
}

.header__fear_my_fears__middle a {
    text-decoration: none;
    color: #fff;
}

.header__right {
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 100px;
    position: relative;
}

.cart-icon {
    cursor: pointer;
    text-decoration: none;
    color: #222;
}

.header__fear_my_fears__middle .cart-dropdown {
    color: #222;
}

/* ===================== ВЫПАДАЮЩАЯ КОРЗИНА ===================== */

.cart-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    width: 420px;
    height: auto;
    aspect-ratio: 505 / 823;
    padding: 46% 7% 25%;
    background-image: url('../image/receipt.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.home-page .cart-dropdown {
    background-image: url('../image/receipt2.png');
}

.cart-dropdown.phone-menu__cart {
    top: calc(50% - 130px);
    width: 27cqw;
}

.catalog-page .cart-dropdown,
.archive-page .cart-dropdown,
.product-detail-page .cart-dropdown {
    top: 25px;
    width: 340px;
}

.catalog-page .cart-items,
.archive-page .cart-items,
.product-detail-page .cart-items {
    margin-top: 100px;
}

.catalog-page .cart-footer,
.archive-page .cart-footer,
.product-detail-page .cart-footer {
    padding-right: 10px;
    padding-left: 10px;
}

.cart-dropdown.active {
    display: flex;
}

.cart-header {
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: transparent;
}

#cartClose {
    border: 0;
    background: transparent;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 10px;
    cursor: pointer;
    font-size: 18px;
    color: #F5F5DC;
}

.cart-header span:first-child,
.empty-cart {
    display: none;
}

.cart-items {
    flex: 1;
    min-height: 0;
    margin-top: 60px;
    overflow-y: auto;
    scrollbar-width: none;
}

.cart-items::-webkit-scrollbar {
    display: none;
}

.cart-scroll-controls {
    position: absolute;
    top: 50%;
    right: 2%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1;
}

.cart-scroll-controls[hidden] {
    display: none;
}

.cart-scroll-button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    background: rgba(211, 211, 211, 0.8);
    color: #222;
    line-height: 1;
    cursor: pointer;
}

.cart-scroll-button:disabled {
    opacity: 0.25;
    cursor: default;
}

.cart-item {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    align-items: center;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 12px;
    color: #666;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-qty-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.cart-qty-btn:hover {
    background: #f0f0f0;
}

.cart-item-total {
    font-weight: bold;
    font-size: 13px;
    min-width: 55px;
    text-align: right;
}

.cart-remove {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0 5px;
    transition: 0.2s;
}

.cart-remove:hover {
    color: red;
}

.cart-footer {
    padding: 15px 0 0;
    margin-bottom: 42px;
    border-top: 1px solid #eee;
    background: transparent;
    flex-shrink: 0;
}

.cart-shipping {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 16px;
}

.checkout-btn {
    width: 100%;
    padding: 12px;
    background: black;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.checkout-btn:hover:not(:disabled) {
    background: #333;
}

.checkout-btn:disabled {
    background: #ccc !important;
    color: #888;
    cursor: not-allowed;
}

.empty-cart {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

/* ===================== УВЕДОМЛЕНИЕ (TOAST) ===================== */

.toast-message {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    z-index: 2000;
    font-size: 14px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===================== ГЕРОЙ / БАННЕР ===================== */

.hero_img {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.hero_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===================== СЕТКА ТОВАРОВ ===================== */

.hero__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 30px;
}

main.catalog-page {
    max-width: 1200px;
    min-height: calc(100vh - 180px);
    margin: 0 auto;
    padding: 90px 30px 30px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px 30px;
}

.catalog-empty {
    grid-column: 1 / -1;
    color: #aaa;
    padding: 80px 20px;
    text-align: center;
}

/* Карточка товара */
.product-card {
    background: transparent;
    cursor: pointer;
}

.product-card__image {
    position: relative;
    aspect-ratio: 6 / 7;
    overflow: hidden;
    background: url('../image/photoframe.png') center / 100% 100% no-repeat;
}

/* ===================== ФЛИП ФОТО ПРИ ХОВЕРЕ ===================== */

.default-img {
    position: absolute;
    top: 4%;
    left: 7.5%;
    width: 85.5%;
    height: 79%;
    object-fit: contain;
    transition: opacity 0.3s;
}

.hover-img {
    position: absolute;
    top: 4%;
    left: 7.5%;
    width: 85.5%;
    height: 79%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .hover-img {
    opacity: 1;
}

.product-card:hover .default-img {
    opacity: 0;
}

/* ===================== ТЕКСТ ТОВАРА ===================== */

.product-card__title {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    color: #eee;
    margin-top: 12px;
}

.product-card__price {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 8px 12px;
    color: #eee;
}

.old-price {
    color: #eee;
    text-decoration: line-through;
    font-size: 14px;
    font-weight: normal;
    margin-left: 8px;
}

/* ===================== SOLD OUT ===================== */

.product-card.sold-out .product-card__title,
.product-card.sold-out .product-card__price {
    color: #eee;
}

.product-card__soldout {
    text-align: center;
    color: #eee;
    font-size: 18px;
    font-weight: bold;
    margin: 8px 0 12px;
}

/* ===================== ФУТЕР ===================== */

.footer {
    background:
        linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
        #1a1a1a url('../image/lowersite.png') center / cover no-repeat;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.35);
    color: #fff;
    margin-top: 30px;
    padding: 40px 20px 20px;
}

.footer__content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.footer__links {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer__link {
    color: #ccc;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s;
}

.footer__link:hover {
    color: white;
}

.footer__copyright {
    text-align: center;
    font-size: 10px;
    color: #888;
    padding-top: 15px;
    width: 100%;
}

/* ===================== АРХИВ / КОЛЛЕКЦИИ ===================== */

.archive {
    max-width: 1200px;
    margin: 0px auto;
    padding: 40px 20px;
}

.collection {
    text-align: center;
    margin-bottom: 120px;
}

.collection__title {
    color: #eee;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 120px;
    padding-bottom: 15px;
    display: inline-block;
    width: auto;
    letter-spacing: 2px;
}

/* ===================== СТРАНИЦА ТОВАРА ===================== */

.product-page {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}


.product-container {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
}

/* Галерея */
.product-gallery {
    flex: 1;
    min-width: 300px;
}

.main-image {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.5);
}

.main-image img {
    width: 100%;
    display: block;
    cursor: pointer;
}

.thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
}

.thumbnail.active {
    border-color: black;
}

.thumbnail:hover {
    border-color: #999;
}

.image-viewer[hidden] {
    display: none;
}

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(4px);
}

.image-viewer__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 22px;
    background: rgba(20, 20, 20, 0.82);
    color: #eee;
    font-size: 20px;
    cursor: pointer;
}

.image-viewer__close:hover,
.image-viewer__close:focus-visible {
    border-color: #eee;
    background: #222;
    outline: none;
}

.image-viewer__stage {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 24px;
    touch-action: none;
}

.image-viewer__image {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    object-fit: contain;
    user-select: none;
    cursor: zoom-in;
    transform-origin: center;
    transition: transform 120ms ease-out;
    -webkit-user-drag: none;
}

.image-viewer__image.is-zoomed {
    cursor: zoom-out;
}

.image-viewer__image.is-dragging {
    cursor: grabbing;
    transition: none;
}

body.image-viewer-open {
    overflow: hidden;
}

/* Информация о товаре */
.product-info {
    flex: 1;
    min-width: 300px;
    color: #eee;
}

.product-collection {
    display: inline-block;
    background: rgba(0, 0, 0, 0.45);
    color: #eee;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 15px;
}

.product-title {
    font-size: 32px;
    margin-bottom: 15px;
}

.product-price {
    margin-bottom: 20px;
}

.current-price {
    font-size: 28px;
    font-weight: bold;
}

.product-description {
    margin-bottom: 30px;
}

.product-description h3 {
    margin-bottom: 10px;
}

.product-description p {
    line-height: 1.6;
    color: #eee;
}

.add-to-cart-btn {
    width: 100%;
    padding: 15px;
    background: black;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 30px;
}

.add-to-cart-btn:hover {
    background: #333;
}

.add-to-cart-btn.disabled {
    background: gray;
    cursor: not-allowed;
}

/* Блок выбора размера */
.size-selector {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.size-selector label {
    font-size: 16px;
    font-weight: 500;
    color: #eee;
}

.size-dropdown {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s;
}

.size-dropdown:hover {
    border-color: #999;
}

.size-dropdown:focus {
    outline: none;
    border-color: black;
}

.cart-item-size {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}




/* ===================== СТРАНИЦА ОФОРМЛЕНИЯ ЗАКАЗА ===================== */

.checkout-page {
    width: 100%;
    margin: 40px auto;
    padding: 0 5%;
}

.checkout-container {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.checkout-form {
    flex: 1;
    min-width: 300px;
}

.checkout-title {
    color: #eee;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #eee;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: rgba(204, 204, 204, 0.5);
    color: #ddd;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input::placeholder {
    color: #ddd;
    opacity: 1;
}

.form-group input:focus {
    outline: none;
    border-color: black;
}

.submit-order-btn {
    width: 100%;
    padding: 16px;
    background: black;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 10px;
}

.submit-order-btn:hover:not(:disabled) {
    background: #333;
}

.submit-order-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    color: #888;
}

.checkout-cart {
    --checkout-cart-width: min(450px, calc(100vw - 40px));
    flex: 0 0 var(--checkout-cart-width);
    width: var(--checkout-cart-width);
    min-width: 350px;
    height: auto;
    aspect-ratio: 505 / 823;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    background-image: url('../image/receipt.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding: 207px 31.5px 112.5px;
    overflow: hidden;
}

.checkout-cart-header {
    display: none;
}

.checkout-cart-header h2 {
    font-size: 20px;
    font-weight: bold;
}

.checkout-cart-header span {
    font-size: 14px;
    color: #888;
}

.checkout-cart-items {
    flex: 1;
    min-height: 0;
    max-height: none;

    overflow-y: auto;
    padding: 0;
    scrollbar-width: none;
}

.checkout-cart-items::-webkit-scrollbar {
    display: none;
}

.checkout-empty-cart {
    text-align: center;
    color: #999;
    padding: 40px 0;
    font-size: 16px;
}

.checkout-cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    align-items: center;
}

.checkout-cart-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.checkout-cart-item-info {
    flex: 1;
    min-width: 0;
}

.checkout-cart-item-title {
    font-size: 14px;
    font-weight: bold;
}

.checkout-cart-item-size {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.checkout-cart-item-price {
    font-size: 12px;
    color: #666;
}

.checkout-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.checkout-qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.checkout-qty-btn:hover {
    background: #f0f0f0;
}

.checkout-cart-item-total {
    font-weight: bold;
    font-size: 13px;
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}

.checkout-cart-remove {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0 5px;
    transition: 0.2s;
    flex-shrink: 0;
}

.checkout-cart-remove:hover {
    color: red;
}

.checkout-cart-footer {
    margin-bottom: 55.5px;
    padding: 15px 13px 0;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.checkout-cart-shipping {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    color: #666;
    margin-bottom: 10px;
}

.checkout-cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 15px;
}

/* Модальное окно заказа */
.order-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.order-modal {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.order-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 20px 20px 0 0;
}

.order-modal-header h2 {
    font-size: 24px;
    color: #4CAF50;
}

.order-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: 0.2s;
}

.order-modal-close:hover {
    color: black;
}

.order-modal-body {
    padding: 24px;
}

.order-modal-message {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
    text-align: center;
}

.order-modal-divider {
    border-top: 1px solid #eee;
    margin: 16px 0;
}

.order-modal-body h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
}

.order-modal-info {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 12px 16px;
}

.order-modal-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.order-modal-info-row span:first-child {
    color: #888;
}

.order-modal-info-row span:last-child {
    font-weight: 500;
}

.order-modal-items {
    margin: 10px 0;
}

.order-modal-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.order-modal-item:last-child {
    border-bottom: none;
}

.order-modal-total {
    display: flex;
    justify-content: space-between;
    padding: 16px 0 0;
    border-top: 2px solid #eee;
    margin-top: 10px;
    font-size: 18px;
    font-weight: bold;
}

.order-modal-total-price {
    color: black;
}

.order-modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #eee;
    text-align: center;
}

.order-modal-btn {
    padding: 12px 48px;
    background: black;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.order-modal-btn:hover {
    background: #333;
}

/* Промокод с кнопкой Activate */
.promocode-wrapper {
    display: flex;
    gap: 10px;
}

.promocode-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.promocode-wrapper input:focus {
    outline: none;
    border-color: black;
}

.promocode-activate {
    padding: 12px 24px;
    background: rgb(0, 0, 0);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.promocode-activate:hover {
    background: #333;
}

/* Общая навигация. На мобильных ссылки раскрываются отдельным блоком. */
.header__fear_my_fears__middle {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    padding-inline: clamp(24px, 5vw, 80px);
    z-index: 1100;
}

.header__center {
    position: static;
    transform: none;
}

.header__center a,
.header__right .cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.header__center img { display: block; }
.header__right { justify-self: end; min-width: 0; }
.header__right .cart-icon { gap: 6px; white-space: nowrap; }
.cart-count::before { content: '('; }
.cart-count::after { content: ')'; }
.menu-toggle, .mobile-home-link, .cart-symbol { display: none; }
.header__left a { display: block; padding-block: 12px; }
.header__left a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

button, a, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible,
.product-card:focus-visible { outline: 2px solid #a0c0b3; outline-offset: 4px; }
.product-card, .product-gallery, .product-info, .checkout-form { min-width: 0; }
.product-card__title, .product-title, .product-description, .collection__title { overflow-wrap: anywhere; }
.checkout-form { width: 100%; }
.promocode-wrapper input, .size-dropdown { min-width: 0; }
.phone-menu__item { border-block: 1px solid transparent; }
.order-modal-info-row, .order-modal-item, .order-modal-total { gap: 12px; overflow-wrap: anywhere; }
.order-modal-info-row span, .order-modal-item span, .order-modal-total span { min-width: 0; }

@media (max-width: 1024px) {
    .products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .checkout-container { flex-direction: column; gap: 32px; }
    .checkout-cart { flex: none; align-self: center; position: static; min-width: 0; }
}

@media (max-width: 900px) {
    body.catalog-page, body.archive-page, body.product-detail-page, body.checkout-page-body {
        background-attachment: scroll;
    }

    /* Телефон встречает посетителя целиком, независимо от пропорций экрана. */
    .home-page { overflow: auto; }
    .home-screen { padding-top: 28px; }
    .home-screen__scene {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: calc(100svh - 28px);
        min-height: 520px;
        aspect-ratio: auto;
        transform: none;
    }
    .home-screen__background { position: absolute; inset: 0; object-position: center; }
    .home-screen__photo1, .home-screen__photo2, .home-screen__photo3, .home-screen__logo { display: none; }
    .phone-menu {
        top: calc(50% - 24px);
        left: 50%;
        width: min(184vw, 760px, max(560px, calc((100svh - 44px) * 1.13)));
        transform: translate(-50%, -50%);
    }
    .phone-menu__screen { font-size: clamp(13px, 3.6vw, 18px); gap: 2px; }
    .phone-menu__item {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 8px 6px 8px 20px;
        letter-spacing: 0;
    }
    .phone-menu__item::before { left: 6px; }

    .header__fear_my_fears__middle {
        height: 72px;
        gap: 12px;
        padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    }
    .header__center img { width: 112px; height: 38px; object-fit: contain; }
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 10px;
        border: 1px solid rgba(255, 255, 255, .25);
        border-radius: 4px;
        color: #fff;
        background: rgba(0, 0, 0, .2);
        cursor: pointer;
    }
    .menu-toggle span { width: 22px; height: 1px; background: currentColor; transition: transform .2s, opacity .2s; }
    .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
    .header__left {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 8px 20px 20px;
        background: #14130b;
        border-bottom: 1px solid #63796f;
        box-shadow: 0 18px 24px #0006;
    }
    .header__left.is-open { display: block; }
    .header__left ul { flex-direction: column; gap: 0; }
    .header__left li { border-bottom: 1px solid #ffffff1f; }
    .header__left a { padding: 17px 4px; font-size: 18px; }
    .mobile-home-link { display: block; }
    .header__right .cart-icon { position: relative; min-width: 52px; gap: 5px; }
    .cart-symbol { display: block; width: 24px; height: 24px; flex-shrink: 0; }
    .cart-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .cart-count { font-size: 13px; min-width: 20px; text-align: center; }
    .cart-count::before, .cart-count::after { content: none; }

    main.catalog-page { padding: 32px 20px; min-height: calc(100svh - 240px); }
    .archive { padding: 32px 20px; }
    .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
    .collection { margin-bottom: 48px; }
    .collection:last-child { margin-bottom: 0; }
    .collection__title { font-size: 22px; line-height: 1.4; margin-bottom: 28px; padding-bottom: 0; letter-spacing: 1px; }
    .product-page { margin: 28px auto; }
    .product-container { gap: 28px; }
    .product-title { font-size: 28px; }
    .product-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
    .current-price { font-size: 24px; }

    /* Корзина вынесена в body: transform сцены не влияет на её положение. */
    body.mobile-cart-open { overflow: hidden; }
    .cart-backdrop { position: fixed; inset: 0; z-index: 2400; background: #0009; backdrop-filter: blur(3px); }
    body .cart-dropdown.active, body .cart-dropdown.phone-menu__cart {
        position: fixed;
        top: auto;
        left: 50%;
        right: auto;
        bottom: 0;
        z-index: 2500;
        width: min(100%, 480px);
        height: auto;
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        aspect-ratio: auto;
        padding: 12px 20px max(20px, env(safe-area-inset-bottom));
        transform: translateX(-50%);
        zoom: 1;
        border-radius: 16px 16px 0 0;
        background: #eeece3;
        box-shadow: 0 -12px 50px #0005;
        color: #222;
        font-size: 14px;
        font-weight: normal;
        letter-spacing: normal;
        text-transform: none;
    }
    .cart-header { position: static; flex-shrink: 0; padding-bottom: 8px; border-bottom: 1px dashed #777; }
    .cart-header span:first-child { display: block; font-size: 20px; }
    #cartClose { color: #222; margin: 0 -8px 0 auto; }
    body .cart-dropdown .cart-items { flex: 0 1 auto; min-height: 72px; margin-top: 0; overscroll-behavior: contain; scrollbar-width: thin; }
    .cart-items::-webkit-scrollbar { display: block; width: 3px; }
    body .cart-dropdown .cart-footer { padding: 18px 0 0; margin-bottom: 0; border-top: 1px dashed #777; }
    .empty-cart { display: block; padding: 24px 0; color: #666; }
    body .cart-scroll-controls { display: none; }
    .cart-item, .checkout-cart-item {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 76px;
        grid-template-areas: "image info remove" "quantity quantity total";
        gap: 10px 12px;
        padding: 16px 0;
        border-bottom: 1px solid #0002;
    }
    .cart-item-image, .checkout-cart-item-image { grid-area: image; width: 48px; height: 56px; object-fit: contain; }
    .cart-item-info, .checkout-cart-item-info { grid-area: info; min-width: 0; overflow-wrap: anywhere; }
    .cart-item-title, .checkout-cart-item-title { font-size: 14px; line-height: 1.4; }
    .cart-item-quantity, .checkout-cart-item-quantity { grid-area: quantity; gap: 12px; }
    .cart-item-total, .checkout-cart-item-total { grid-area: total; min-width: 0; overflow-wrap: anywhere; }
    .cart-remove, .checkout-cart-remove { grid-area: remove; justify-self: end; width: 44px; height: 44px; color: #555; }
    .cart-qty-btn, .checkout-qty-btn { width: 44px; height: 44px; font-size: 18px; background: #ffffff80; border-color: #0003; }
    .cart-shipping, .cart-total, .checkout-cart-shipping, .checkout-cart-total { gap: 12px; }
    .cart-total span:last-child, .checkout-cart-total span:last-child { min-width: 0; text-align: right; overflow-wrap: anywhere; }
    .checkout-btn { min-height: 48px; font-size: 16px; }

    .checkout-page { max-width: 680px; padding: 0 20px; margin: 28px auto; }
    .checkout-cart {
        order: -1;
        width: 100%;
        aspect-ratio: auto;
        padding: 20px;
        background: #eeece3;
        border-radius: 4px;
        box-shadow: 0 6px 24px #0004;
        scroll-margin-top: 20px;
    }
    .checkout-cart-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; border-bottom: 1px dashed #777; }
    .checkout-cart-header span { color: #555; }
    .checkout-cart-items { overflow: visible; }
    .checkout-cart-footer { margin: 0; padding: 18px 0 0; border-top: 1px dashed #777; }
    .checkout-cart-total { margin-bottom: 0; }
    .checkout-title { font-size: clamp(24px, 5vw, 32px); line-height: 1.3; margin-bottom: 24px; }
    .form-group input { min-height: 48px; background: #242827cc; color: #fff; border-color: #959d99; }
    .form-group input::placeholder { color: #b6beb9; }
    .form-group { margin-bottom: 20px; }
    .promocode-wrapper { flex-wrap: wrap; }
    .promocode-wrapper input { flex: 1 1 180px; width: 0; }
    .promocode-activate { flex: 1 0 auto; min-height: 48px; }
    .submit-order-btn, .add-to-cart-btn { min-height: 52px; }

    .footer { padding: 28px 20px 20px; }
    .footer__content { gap: 12px; }
    .footer__links { gap: 4px 24px; }
    .footer__link { display: flex; align-items: center; min-height: 44px; font-size: 14px; }
    .footer__copyright { padding-top: 8px; }
    .toast-message { left: 16px; right: 16px; bottom: max(20px, env(safe-area-inset-bottom)); width: fit-content; max-width: calc(100% - 32px); margin-inline: auto; text-align: center; z-index: 4000; }
    .order-modal { max-height: calc(100dvh - 32px); }
}

@media (max-width: 600px) {
    main.catalog-page, .archive { padding: 24px 12px; }
    .products-grid { gap: 24px 10px; }
    .product-card__title { font-size: 14px; line-height: 1.4; margin-top: 8px; }
    .product-card__price { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 8px; font-size: 14px; padding: 8px 0; }
    .product-card__price .old-price { margin-left: 0; font-size: 12px; }
    .product-card__soldout { font-size: 14px; margin-top: 4px; }
    .collection__title { font-size: 20px; }
    .product-page { margin: 20px auto 32px; padding: 0 16px; }
    .product-container { flex-direction: column; gap: 24px; }
    .product-gallery, .product-info { width: 100%; flex: auto; }
    .main-image { border-radius: 12px; }
    .main-image img { aspect-ratio: 1; object-fit: contain; max-height: 70svh; }
    .thumbnails { flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 6px; }
    .thumbnail { width: 64px; height: 64px; flex-shrink: 0; }
    .product-title { font-size: 26px; line-height: 1.2; }
    .product-description { margin-bottom: 24px; }
    .size-selector { flex-wrap: wrap; gap: 10px; }
    .size-dropdown { min-height: 48px; padding-right: 32px; }
    .add-to-cart-btn { margin-bottom: 0; }
    .image-viewer__stage { padding: 12px; }
    .image-viewer__image { max-width: calc(100vw - 24px); max-height: calc(100dvh - 96px); }
    .checkout-page { padding-inline: 16px; }
    .checkout-cart { padding: 16px; }
    .order-modal-header, .order-modal-body, .order-modal-footer { padding: 16px; }
    .order-modal-header h2 { font-size: 20px; }
    .order-modal-close { width: 44px; height: 44px; flex-shrink: 0; }
    .order-modal-info-row, .order-modal-item, .order-modal-total { flex-direction: column; gap: 4px; }
    .order-modal-total { font-size: 16px; }
}

@media (hover: none) {
    .product-card:hover .hover-img { opacity: 0; }
    .product-card:hover .default-img { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .menu-toggle span, .image-viewer__image { transition: none; }
    .toast-message, .order-modal, .order-modal-overlay { animation: none; }
}
