/* Дополнительная адаптивность для магазина */

/* Планшеты и маленькие ноутбуки */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }

    .filters-container {
        gap: 15px;
    }

    .filter-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Планшеты в портретной ориентации */
@media (max-width: 768px) {
    /* Отключаем летающие эмодзи на мобильных */
    .particle {
        display: none !important;
    }

    /* Отключаем все свечения текста на мобильных */
    * {
        text-shadow: none !important;
    }

    /* Отключаем анимацию фона на мобильных для предотвращения горизонтального скролла */
    body::before {
        animation: none;
    }

    /* Header */
    header {
        padding: 15px 0;
    }

    nav {
        gap: 15px;
    }

    .logo {
        font-size: 1.8rem;
    }

    .header-right {
        gap: 15px;
    }

    .coin-balance {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    /* Main content */
    .page-title {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

    .page-subtitle {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    /* Filters */
    .filters-container {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 25px;
    }

    .search-container {
        width: 100%;
    }

    .search-input {
        font-size: 0.95rem;
        padding: 12px 40px 12px 15px;
    }

    .filter-controls {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .price-filter {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .price-filter label {
        margin-bottom: 0;
        margin-right: 10px;
        min-width: 90px;
    }

    .price-input {
        flex: 1;
        max-width: 200px;
    }

    .affordable-filter {
        width: 100%;
    }

    /* Items grid */
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }

    .item-card {
        padding: 18px;
    }

    .item-name {
        font-size: 1.1rem;
    }

    .item-description {
        font-size: 0.85rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-width: 500px;
        margin: 20px;
        padding: 25px;
    }

    .modal-title {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .modal-item-info h3 {
        font-size: 1.3rem;
    }

    .modal-item-info p {
        font-size: 0.9rem;
    }

    .quantity-selector {
        margin: 20px 0;
    }

    .quantity-controls input {
        width: 60px;
        font-size: 1rem;
    }

    .modal-price-info {
        font-size: 0.95rem;
    }

    .modal-actions {
        gap: 12px;
    }

    .modal-actions .btn {
        padding: 12px 25px;
        font-size: 1rem;
    }

    /* Purchase history */
    .purchase-history-section {
        margin-top: 40px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .history-item {
        padding: 15px;
    }

    .history-item-name {
        font-size: 1rem;
    }

    .history-item-date {
        font-size: 0.8rem;
    }

    .history-item-price {
        font-size: 1.1rem;
    }
}

/* Мобильные телефоны */
@media (max-width: 480px) {
    /* Header */
    header {
        padding: 15px 0;
    }

    nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }

    .logo {
        font-size: 1.5rem;
        flex: 1 1 auto;
    }

    .header-right {
        flex-direction: row;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .coin-balance {
        padding: 8px 16px;
        font-size: 0.95rem;
    }

    .coin-icon {
        font-size: 1.2rem;
    }

    .coin-amount {
        font-size: 1.1rem;
    }

    #userMenu {
        display: flex;
        gap: 10px;
    }

    /* Main content */
    .container {
        padding: 0 15px;
    }

    .page-title {
        font-size: 2rem;
        margin-bottom: 8px;
    }

    .page-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    /* Filters */
    .filters-container {
        margin-bottom: 20px;
    }

    .search-input {
        font-size: 0.9rem;
        padding: 10px 35px 10px 12px;
    }

    .clear-search-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .price-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .price-filter label {
        margin-right: 0;
        min-width: auto;
    }

    .price-input {
        width: 100%;
        max-width: none;
        padding: 10px;
        font-size: 0.9rem;
    }

    .checkbox-label {
        font-size: 0.95rem;
    }

    /* Items grid */
    .items-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .item-card {
        padding: 18px;
    }

    .item-name {
        font-size: 1.1rem;
    }

    .item-quantity {
        font-size: 0.85rem;
    }

    .item-description {
        font-size: 0.9rem;
        margin: 12px 0;
    }

    .item-footer {
        flex-direction: row;
        gap: 15px;
        align-items: center;
        justify-content: space-between;
    }

    .item-price {
        font-size: 1.4rem;
    }

    .item-footer .btn {
        flex: 1;
        padding: 12px 20px;
        font-size: 1rem;
    }

    /* Modal */
    .modal {
        padding: 20px;
        align-items: center;
    }

    .modal-overlay {
        background: rgba(10, 22, 40, 0.95);
    }

    .modal-content {
        width: calc(100% - 40px);
        max-width: 450px;
        max-height: 85vh;
        margin: 0 auto;
        border-radius: 20px;
        padding: 20px;
        overflow-y: auto;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .modal-title {
        font-size: 1.4rem;
        margin-bottom: 15px;
        padding-right: 40px;
    }

    .modal-item-info h3 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .modal-item-info p {
        font-size: 0.85rem;
    }

    .quantity-selector {
        margin: 15px 0;
    }

    .quantity-selector label {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .quantity-controls {
        gap: 10px;
    }

    .quantity-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .quantity-controls input {
        width: 70px;
        height: 40px;
        font-size: 1rem;
    }

    .modal-price-info {
        font-size: 0.9rem;
        gap: 10px;
    }

    .price-row {
        padding: 10px 0;
    }

    .price-row.total {
        padding: 12px 0;
        font-size: 1rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .modal-actions .btn {
        width: 100%;
        padding: 14px;
        font-size: 1.05rem;
    }

    /* Loading states */
    .loading {
        padding: 40px 20px;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
    }

    .loading p {
        font-size: 0.95rem;
    }

    /* Empty states */
    .empty-results,
    .empty-history {
        padding: 40px 20px;
    }

    .empty-icon {
        font-size: 3rem;
    }

    .empty-results h3 {
        font-size: 1.2rem;
    }

    .empty-results p {
        font-size: 0.9rem;
    }

    /* Purchase history */
    .purchase-history-section {
        margin-top: 30px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .history-item {
        padding: 12px;
        flex-direction: column;
        gap: 10px;
    }

    .history-item-info {
        width: 100%;
    }

    .history-item-name {
        font-size: 0.95rem;
    }

    .history-item-date {
        font-size: 0.75rem;
    }

    .history-item-price {
        font-size: 1.2rem;
        text-align: left;
    }

    /* Toast messages */
    .toast-message {
        bottom: 20px;
        left: 15px;
        right: 15px;
        width: auto;
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    /* Fullscreen loader */
    .loader-content {
        padding: 30px 20px;
        margin: 20px;
        border-radius: 15px;
    }

    .loader-spinner {
        width: 60px;
        height: 60px;
        border-width: 5px;
    }

    .loader-text {
        font-size: 1rem;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .page-title {
        font-size: 1.7rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .item-card {
        padding: 12px;
    }

    .modal-content {
        padding: 15px;
    }

    .modal-title {
        font-size: 1.2rem;
    }

    .modal-actions .btn {
        padding: 12px;
        font-size: 0.95rem;
    }
}

/* Landscape orientation на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }

    .page-title {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}
