/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
    font-family: "Inter", sans-serif;
    background: #0e0f12;
    color: #e4e6eb;
    line-height: 1.6;
    min-height: 100vh;
}

/* CONTAINER */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 18px;
}

/* HEADER */
header {
    text-align: center;
    padding: 40px 0 30px;
}
h1 {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #2a95ff, #003d9a);
    -webkit-background-clip: text;
    color: transparent;
}
.subtitle {
    font-size: 1.2rem;
    opacity: 0.7;
}

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
    padding: 10px 0 40px;
}

.card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 22px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 25px rgba(0,0,0,0.35);
    transition: transform .25s ease, box-shadow .25s ease;
}

.card:active {
    transform: scale(0.97);
}

/* MEDIA */
.card-media {
    height: 300px;
    background: #000;
    overflow: hidden;
    position: relative;
}
.card-media img,
.card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* BADGE */
.price-badge {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    color: #fff;
    font-weight: 600;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.15);
}

/* CONTENT */
.card-body {
    padding: 16px 18px 20px;
}
.card-body h3 {
    font-size: 1.25rem;
    margin-bottom: 6px;
}
.tag {
    background: #2AABEE;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: .85rem;
    font-weight: 600;
    color: #fff;
}

/* DETAILS PAGE */
.detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}
.back-btn {
    display: inline-block;
    margin-bottom: 10px;
    opacity: 0.7;
    text-decoration: none;
    color: #58a6ff;
}
.detail-container h1 {
    margin-top: 10px;
    text-align: center;
    font-size: 2.5rem;
}
.price {
    text-align: center;
    margin: 14px 0 20px;
    font-size: 2.6rem;
    background: linear-gradient(90deg, #58a6ff, #8b5cf6);
    -webkit-background-clip: text;
    color: transparent;
}

/* SWIPER */
.swiper {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 32px;
}
.swiper-slide img,
.swiper-slide video {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    background: #000;
}

/* INFO BLOCKS */
.info {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 26px;
}
.block h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: #58a6ff;
}
.block.warning h3 { color: #f85149; }
.text {
    font-size: 1.15rem;
    line-height: 1.7;
}

/* BUY BUTTON */
.buy-button {
    display: block;
    width: 100%;
    padding: 18px;
    text-align: center;
    color: white;
    background: linear-gradient(90deg, #58a6ff, #8b5cf6);
    border-radius: 20px;
    margin: 40px auto 10px;
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(88,166,255,0.4);
}
.buy-button:active {
    transform: scale(0.97);
}

/* FOOTER */
footer {
    opacity: 0.5;
    text-align: center;
    padding: 40px 0;
}

/* TELEGRAM WEBAPP OPTIMISATION */
@media (max-width: 480px) {
    h1 { font-size: 2.4rem; }
    .card-media { height: 260px; }
    .price { font-size: 2.2rem; }
}
/* Сетка карточек */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.card {
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    position: relative; /* Важно для позиционирования кнопки */
}

.card-media {
    position: relative;
    height: 200px;
    background: #f0f0f0;
}

.card-media img, .card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Кнопка избранного */
.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2; /* Чтобы быть поверх картинки */
}

.fav-btn:hover {
    transform: scale(1.1);
}

.fav-btn.active {
    background: #fff;
    color: red;
}
/* Стили для выпадающего меню */
.dropdown-wrapper {
    position: relative;
    margin-left: 8px; /* Отступ от иконки корзины */
}

.dropdown-menu {
    position: absolute;
    top: 120%; /* Чуть ниже кнопки */
    right: 0;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    z-index: 2000;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 10px 16px;
    color: var(--text-main);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
}