/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #111;
    color: white;

    overflow-y: auto;               /* ✅ Разрешаем прокрутку */
    scrollbar-width: none;          /* ✅ Firefox: скрыть скроллбар */
    -ms-overflow-style: none;       /* ✅ IE и Edge: скрыть скроллбар */
}

body::-webkit-scrollbar {
    display: none;                  /* ✅ Chrome, Safari: скрыть скроллбар */
}


/* ========== HEADER (shared) ========== */
header {
    background: #1a1a1a;
    padding: 15px 30px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-container img {
    height: 24px;
    width: 24px;
    object-fit: contain;
}


.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.logo::before {
    content: 'MapartShop';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #f39c12;
    white-space: nowrap;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(
            120deg,
            transparent 0%,
            white 40%,
            white 60%,
            transparent 100%
    );
    -webkit-mask-size: 200%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: -100%;
    animation: none;
}

.logo:hover::before {
    animation: shine 1s forwards;
}

@keyframes shine {
    0% {
        -webkit-mask-position: -100%;
    }
    100% {
        -webkit-mask-position: 200%;
    }
}





.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #f39c12;
}

/* ========== HERO SECTION ========== */
.hero {
    text-align: center;
    padding: 80px 20px;
}

.subtitle {
    margin-top: 10px;
    font-size: 18px;
    color: #aaa;
}

/* ========== MAIN CONTAINER ========== */
.container {
    padding: 40px 20px;
    max-width: 1200px;
    margin: auto;
}

/* ========== FILTERS ========== */
.filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.filters label {
    margin-right: 10px;
    font-weight: bold;
}

/* ========== CHECKOUT BUTTON ========== */
.checkout-btn {
    font-size: 20px; /* Ещё больше шрифт */
    font-weight: bold;
    color: white;
    background: #333;
    border: none;
    padding: 14px 28px; /* Ещё больше отступы */
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    display: inline-block;
    overflow: hidden;
    transition: background 0.2s;
    width: 100%; /* Растягивает на всю ширину контейнера */
    box-sizing: border-box; /* Чтобы padding не добавлял ширину */
}

.checkout-btn:hover {
    background: #444;
}

.checkout-btn::before {
    content: 'Checkout';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #f39c12;
    white-space: nowrap;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(
            120deg,
            transparent 0%,
            white 40%,
            white 60%,
            transparent 100%
    );
    -webkit-mask-size: 200%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: -100%;
    animation: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-btn:hover::before {
    animation: shine 1s forwards;
}

/* ========== GALLERY CARDS (maparts) ========== */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.card {
    background: #1f1f1f;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.2s ease;
    width: 100%;
    max-width: 220px;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: scale(1.03);
}

.card-info {
    padding: 15px;
    font-size: 14px;
}

.card-info p {
    margin: 5px 0;
}

.card-img-wrapper {
    width: 100%;
    height: 225px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #1f1f1f;
}

.card-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Прямоугольные карточки для items (1920x1080 пропорции ~16:9) */

.rectangular-card {
    max-width: 320px;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #1f1f1f;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}


.rectangular-card .card-img-wrapper {
    aspect-ratio: 16 / 9;
    background: none;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 180px; /* урезаем по высоте */
    flex-shrink: 0;
}

.rectangular-card .card-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}


/* Само всплывающее окно корзины */
#cart-popup {
    width: 248px;          /* ширина окна корзины */
    max-height: 600px;     /* ограничение по высоте */
    overflow-y: auto;      /* скролл, если товаров слишком много */
    background: #121212;
    border: 1px solid #444;
    border-radius: 12px;
    padding: 12px;
}

/* Карточка в корзине */
#cart-popup .card {
    background: #1f1f1f;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column; /* элементы идут сверху вниз */
    align-items: center;    /* выравнивание по центру */
    gap: 6px;
}

/* Обёртка картинки — без ограничений по высоте */
#cart-popup .card-img-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0; /* убираем лишние отступы */
}

/* Картинка — по умолчанию (обычные предметы) */
#cart-popup .card-img-wrapper img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

/* Для mapart — строго квадрат */
#cart-popup .card.mapart .card-img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;  /* квадратное соотношение */
    overflow: hidden;     /* обрезаем лишнее */
    border-radius: 4px;
    background: none;     /* без фона, чтобы не было полос */
}

#cart-popup .card.mapart .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;  /* вписывает полностью без обрезки; если нужно заполнить и обрезать - смени на cover */
    display: block;
}

/* Текст */
#cart-popup .card-info {
    text-align: center;
    color: #fff;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Блок с кнопками */
#cart-popup .card div:last-child {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 4px;
}

/* Кнопки управления */
#cart-popup button {
    flex: 1;
    margin: 0 2px;
    padding: 6px 0;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: background 0.2s;
}
#cart-popup button:hover {
    background: #555;
}

/* Скрываем скроллбар (Chrome, Safari) */
#cart-popup::-webkit-scrollbar {
    display: none;
}

/* Недоступные товары */
.card.out-of-stock {
    opacity: 0.5;
    pointer-events: none; /* перестраховка */
}

/* ========== CART ICON WITH BADGE ========== */
#cart-icon {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
    display: none; /* изначально скрыто */
}
