/* ===== МАГАЗИН (portal_shop.css) ===== */

.user-balance {
    display: flex;
    gap: 20px;
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 40px;
    border: 2px solid #b8860b;
    font-size: 18px;
    font-weight: 600;
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffd966;
}

.balance-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Сетка товаров */
.items-grid,
.gifts-grid,
.shop-items-selector .items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

/* Карточка товара */
.item-card,
.gift-card {
    background: linear-gradient(145deg, rgba(44,30,21,0.95), rgba(26,17,12,0.95));
    border: 2px solid #8b5a2b;
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.item-card.selectable {
    cursor: pointer;
}

.item-card.selectable:hover {
    border-color: #ffd700;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 20px rgba(255,215,0,0.3);
}

.item-card.selected {
    border-color: #ffd700;
    box-shadow: 0 0 0 2px #ffd700, 0 10px 25px #000;
    background: linear-gradient(145deg, #5a3e2b, #3f2e22);
}

.item-preview {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 2px solid #b8860b;
    margin-bottom: 10px;
    background-size: cover;
    background-position: center;
    background-color: #2b1e0e;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffd966;
    margin-bottom: 8px;
    line-height: 1.3;
    min-height: 36px;
}

.item-price {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.5);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.price.coins {
    color: #ffd966;
    border: 1px solid #ffd966;
}

.price.diamonds {
    color: #a0d6ff;
    border: 1px solid #a0d6ff;
}

.price img {
    width: 16px;
    height: 16px;
}

.free {
    color: #4caf50;
    font-weight: 600;
    background: rgba(76,175,80,0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
}

.owned {
    color: #4caf50;
    font-size: 13px;
    font-weight: 600;
    background: rgba(76,175,80,0.2);
    padding: 3px 10px;
    border-radius: 20px;
}

.buy-small,
.gift-send-btn {
    background: linear-gradient(145deg, #a0522d, #8b4513);
    border: 2px solid #b8860b;
    border-radius: 30px;
    padding: 5px 15px;
    color: #ffd966;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 5px;
    width: 100%;
}

.buy-small:hover,
.gift-send-btn:hover {
    background: linear-gradient(145deg, #8b4513, #5d2906);
    border-color: #ffd700;
    color: #fff;
    transform: scale(1.02);
}

/* Стили для подарков */
.gifts-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    margin-top: 20px;
}

.gift-card {
    padding: 20px 10px;
}

.gift-icon {
    font-size: 48px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 8px gold);
}

.gift-card h4 {
    color: #ffd966;
    font-size: 16px;
    margin-bottom: 8px;
}

.gift-details {
    font-size: 13px;
    color: #b8a58e;
    margin-bottom: 10px;
    min-height: 40px;
}

.gift-reward {
    background: rgba(255,215,0,0.1);
    padding: 3px 8px;
    border-radius: 20px;
    margin: 3px 0;
}

.gift-price {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.gift-send-btn {
    width: auto;
    padding: 8px 20px;
}

/* Убедимся, что селектор достаточно специфичен */
.profile-page .shop-items-selector {
    width: 100%;
    overflow-x: auto; /* горизонтальный скролл на очень узких экранах */
}

.profile-page .items-grid {
    display: grid !important; /* принудительно включаем grid */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 15px !important;
}

.profile-page .item-card {
    min-width: 150px;
    width: 100%;
    box-sizing: border-box;
}

/* Вкладки магазина */
.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    border: 1px solid #8b5a2b;
}

.shop-tabs .tab-button {
    padding: 10px 20px;
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border: 2px solid #b8860b;
    border-radius: 30px;
    color: #fff8e7;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-tabs .tab-button.active {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    color: #1f140c;
    border-color: #ffd700;
    box-shadow: 0 0 15px gold;
}

/* Карточка товара в магазине */
.shop-item {
    background: linear-gradient(145deg, rgba(44,30,21,0.98), rgba(26,17,12,0.98));
    border: 2px solid #8b5a2b;
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 5px 15px #000;
}

.shop-item:hover {
    border-color: #ffd700;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px #000, 0 0 20px rgba(255,215,0,0.2);
}

.shop-item.owned {
    opacity: 0.9;
    border-color: #4caf50;
}

.item-preview {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    border: 2px solid #b8860b;
    overflow: hidden;
}

.smiles-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    padding: 10px;
}

.preview-smile {
    font-size: 24px;
}

.stickers-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    padding: 5px;
}

.preview-sticker {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.shop-item h3 {
    font-size: 18px;
    color: #ffd966;
    margin-bottom: 8px;
}

.item-description {
    font-size: 13px;
    color: #b8a58e;
    margin-bottom: 12px;
    line-height: 1.4;
}

.owned-badge {
    display: inline-block;
    background: rgba(76,175,80,0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
    border-radius: 20px;
    padding: 5px 15px;
    font-weight: 600;
    font-size: 14px;
}

.buy-btn {
    background: linear-gradient(145deg, #a0522d, #8b4513);
    border: 2px solid #b8860b;
    border-radius: 30px;
    padding: 8px 25px;
    color: #ffd966;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    margin-top: 5px;
}

.buy-btn:hover {
    background: linear-gradient(145deg, #8b4513, #5d2906);
    border-color: #ffd700;
    color: #fff;
    transform: scale(1.02);
}
