@media screen and (max-width: 768px) {
    nav {
        position: sticky;
        z-index: 1000;
        transition: transform 0.3s ease-in-out;
    }

    .nav-container {
        display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    }

    .nav-links {
        display: flex;
        gap: 1rem;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }
    
    .nav-links.active {
        display: flex;
    }
}

.news-section {
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.news-list {
    gap: 1rem;
    margin-bottom: 10rem;
}

.news-card {
    padding: 1rem;
    font-size: 1rem;
}

.news-card h3 {
    font-size: 1.2rem;
}

@media (hover: none) and (pointer: coarse) {
    .nav-links button, 
    .main-button, 
    .product-button {
        min-height: 44px;
        min-width: 44px;
    }
}

body {
    -webkit-text-size-adjust: 100%;
    overflow: auto;
    overscroll-behavior-y: auto;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overscroll-behavior-y: none;
}

* {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

input, textarea, button {
    -webkit-appearance: none;
    appearance: none;
}

    :root {
    --bg-dark: #121620;
    --bg-dark-secondary: #1f2937;
    --text-light: #f0f4ff;
    --accent-purple: #3b82f6;
    --accent-light-purple: #38bdf8;
    --accent-green: #56d9fa;
    }

    html { scrollbar-gutter: stable; }

    body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden scroll;
    transition: background-color 0.3s, color 0.3s;
    }

    /* Анимации */
    .fade-out {
        animation: fadeOut 0.3s ease forwards;
    }

    .fade-in {
        animation: fadeIn 0.5s ease forwards;
    }

    @keyframes slideIn {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes fadeOut {
        from { opacity: 1; transform: scale(1); }
        to { opacity: 0; transform: scale(0.9); }
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: scale(0.9); }
        to { opacity: 1; transform: scale(1); }
    }

    @keyframes slideInFromRight {
        from { opacity: 0; transform: translateX(50px); }
        to { opacity: 1; transform: translateX(0); }
    }

    @keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
    }

    @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
    }

    @keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
    }

    @keyframes fadeInZoom {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
    }

    @keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
    }

    @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
    }

    /* Состояния отображения */
    .hidden { display: none; opacity: 0; animation: none; }
    .visible { 
    display: block; 
    animation: fadeInUp 1s ease-out; 
    }
    .products.visible {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    }
    .contact.visible { animation: fadeIn 2s ease-in-out; }

    /* Навигация */
    nav {
    background-color: rgba(39, 39, 39, 0.5);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 89, 255, 0.5);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    animation: slideDown 1s ease-in-out;
    transition: all 0.3s;
    }

    .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    }

    .logo {
        display: flex;
        align-items: center;
        font-size: 1.5rem;
        font-weight: bold;
    }
    
    .logo span { 
        color: var(--accent-purple); 
        margin-left: 8px; 
    }
    
    .logo img {
        width: 32px;
        height: 32px;
        color: #008cff;
    }

    .nav-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    }

    .nav-links button {
    position: relative;
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s;
    }

    .nav-links button::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--accent-purple), 
        var(--accent-light-purple), 
        var(--accent-green), 
        var(--accent-purple)
    );
    background-size: 400% 100%;
    transition: all 0.3s ease;
    opacity: 0;
    box-shadow: 0 0 10px var(--accent-light-purple);
    transform: scaleX(0.7);
    }

    .nav-links button:hover::after {
        opacity: 1;
        height: 3px;
        transform: scaleX(1);
        box-shadow: 0 0 15px var(--accent-purple);
    }

    /* Основные элементы */
    .notification {
        position: fixed;
        top: 20px;
        right: 20px;
        padding: 15px 25px;
        border-radius: 8px;
        color: white;
        animation: slideIn 0.3s ease;
    }

    .notification.success {
        background: linear-gradient(145deg, #4CAF50, #45a049);
    }

    .notification.error {
        background: linear-gradient(145deg, #f44336, #e53935);
    }

    .main {
    transition: background-color 0.3s;
    padding: 6rem 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 1s ease;
    }

    header {
    text-align: center;
    background: linear-gradient(135deg, var(--accent-light-purple), rgba(56, 189, 248, 0.3));
    padding: 3rem 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    animation: zoomIn 1s ease-in-out;
    }

    header h1 { animation: fadeInZoom 2s ease-in-out; }
    header p { 
    font-size: 1.2rem; 
    color: #e2e8f0; 
    }

    /* Кнопки */
    .main-button, .product-button {
    background-color: var(--accent-purple);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s;
    }

    .main-button:hover, .product-button:hover {
    transform: scale(1.1);
    background-color: #3f82ff;
    box-shadow: 0 0 10px var(--accent-light-purple), 0 0 20px var(--accent-purple);
    }

    .product-button:hover {
    box-shadow: 0 0 20px var(--accent-light-purple);
    animation: pulse 1.5s infinite;
    }

    /* Новости */
    
    .news-section {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
        background-color: var(--bg-dark-secondary);
        padding: 2rem;
        border-radius: 10px;
        margin-top: 2rem;
        margin-bottom: 3rem;
    }

    .news-section.expanded {
        padding-bottom: 3rem;
    }

    .news-list {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 10rem;
    }

    .news-card {
        position: relative;
        padding: 1rem;
        margin-bottom: 1rem;
        background-color: var(--bg-dark);
        border-radius: 10px;
        padding: 1.5rem;
        transition: transform 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .news-card:hover {
        transform: translateY(-5px);
    }
    .news-card h4 {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        color: var(--text-primary);
    }

    .news-card p {
        margin-bottom: 1rem;
        line-height: 1.6;
        color: var(--text-secondary);
    }
    

    .news-image {
        width: 100%;
        height: 200px;
        object-fit: cover;
        border-radius: 8px;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .read-more {
        display: inline-block;
        color: var(--accent);
        text-decoration: none;
        font-weight: 500;
        margin-top: 1rem;
    }

    .read-more:hover {
        text-decoration: underline;
    }

    .original-text {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    details summary {
        cursor: pointer;
        color: var(--accent);
        margin-bottom: 1rem;
    }

    details summary:hover {
        text-decoration: underline;
    }

    .date {
        position: relative;
        display: inline-block;
        top: 0;
        right: 0;
        color: var(--text-secondary);
        background-color: var(--bg-dark-secondary);
        padding: 0.5rem 1rem;
        border-radius: 5px;
        margin-bottom: 1rem;
    }


    .crypto-widget {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: var(--bg-dark-secondary);
        padding: 1rem;
        border-radius: 10px;
        margin-top: 1rem;
    }

    .crypto-price {
        font-weight: bold;
        color: var(--accent-green);
    }

    /* Продукты */

    .products-container {
        display: flex;
        max-width: 1200px;
        margin: 0 auto;
        gap: 2rem;
        position: relative;
        top: 5rem;
        animation: fadeIn 0.5s ease-in-out;
    }

    .sorting-panel {
        animation: zoomIn 0.5s ease-in-out;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
        width: 250px;
        background-color: var(--bg-dark-secondary);
        padding: 1rem;
        border-radius: 10px;
        height: fit-content;
    }

    .sorting-panel h4 {
        margin-bottom: 1rem;
        color: var(--accent-light-purple);
    }

    .sorting-panel select {
        width: 100%;
        padding: 0.5rem;
        background-color: var(--bg-dark);
        color: var(--text-light);
        border: 1px solid var(--accent-purple);
        border-radius: 5px;
    }

    .category-filter {
        animation: fadeIn 0.3s ease-in-out;
    }
    
    .no-products {
        text-align: center;
        color: var(--text-light);
        padding: 2rem;
        width: 100%;
    }

    .category-filter {
        animation: fadeIn 0.3s ease-in-out;
    }

    .category-icon {
        font-size: 24px;
        color: #007bff;
        margin-bottom: 10px;
    }
    
    .product-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .product-category {
        color: var(--accent-purple);
        font-size: 0.9rem;
        margin: 0.5rem 0;
    }

    .products-grid {
        animation: slideInFromRight 0.5s ease forwards;
        opacity: 0;
        flex-grow: 1;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .product-compact {
        animation: slideInFromRight 0.5s ease forwards;
        opacity: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
        display: flex;
        flex-direction: column;
        align-items: center;
        background-color: var(--bg-dark-secondary);
        padding: 1rem;
        border-radius: 10px;
        text-align: center;
        transition: transform 0.3s;
    }

    .pagination-button {
        transition: all 0.3s ease;
        animation: fadeInUp 0.5s ease;
    }

    .pagination-button:hover {
        transform: scale(1.1);
    }

    .product-compact:hover {
        transform: scale(1.05);
    }

    .product-compact i {
        font-size: 3rem;
        color: var(--accent-purple);
        margin-bottom: 0.5rem;
    }

    .product-compact h5 {
        margin: 0.5rem 0;
        color: var(--accent-light-purple);
    }

    .pagination {
        display: flex;
        justify-content: center;
        margin-top: 2rem;
        gap: 0.5rem;
        position: relative;
        top: 22rem;
    }

    .pagination button {
        background-color: var(--bg-dark-secondary);
        border: 1px solid var(--accent-purple);
        color: var(--text-light);
        padding: 0.5rem 1rem;
        border-radius: 5px;
        cursor: pointer;
        transition: all 0.3s;
    }

    .pagination button:hover, 
    .pagination button.active {
        background-color: var(--accent-purple);
        color: white;
    }

    #products {
        margin-top: 0;  
        position: relative;
        top: 0;
    }

    /* Стили для уведомлений */
    .notification {
        position: fixed;
        top: 20px;
        right: 20px;
        padding: 15px 25px;
        border-radius: 8px;
        color: white;
        font-weight: 500;
        z-index: 1000;
        animation: slideIn 0.3s ease-out;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .notification.success {
        background-color: #4CAF50;
    }

    .notification.error {
        background-color: #f44336;
    }

    .notification.loading {
        background-color: #2196F3;
    }

    .notification.fade-out {
        animation: fadeOut 0.3s ease-out forwards;
    }

    @keyframes slideIn {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes fadeOut {
        from {
            transform: translateX(0);
            opacity: 1;
        }
        to {
            transform: translateX(100%);
            opacity: 0;
        }
    }


    h3 {
        text-align: center;
        position: static;
        margin-top: 1rem;
        margin-bottom: 2rem;
    }

    .contact-form {
        max-width: 600px;
        margin: 2rem auto;
        background-color: var(--bg-dark-secondary);
        padding: 2rem;
        border-radius: 10px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .contact-form input,
    .contact-form textarea {
        width: 94%;
        padding: 1rem;
        margin: 1rem 0;
        background-color: var(--bg-dark-secondary);
        border: 1px solid #4a5568;
        color: var(--text-primary);
        border-radius: 5px;
        transition: border-color 0.3s;
        resize: vertical;
        max-height: 200px;
        font-family: inherit;
    }

    .contact-form input:focus,
    .contact-form textarea:focus {
        border-color: var(--accent-purple);
        outline: none;
        box-shadow: 0 0 5px var(--accent-light-purple);
    }

    /* Админ панель */
    .login {
        max-width: 500px;
        margin: 0 auto;
        padding: 2rem;
        animation: zoomIn 0.5s ease-in-out;
    }
    
    .login-form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        background: var(--bg-dark-secondary);
        padding: 2rem;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    }
    
    .login-form input {
        width: 94%;
        padding: 1rem;
        background-color: var(--bg-dark-secondary);
        border: 1px solid #4a5568;
        color: var(--text-primary);
        border-radius: 5px;
        transition: border-color 0.3s;
        resize: vertical;
        max-height: 200px;
        font-family: inherit;
    }
    
    .login-form input:focus {
        border-color: var(--accent-purple);
        outline: none;
        box-shadow: 0 0 5px var(--accent-light-purple);
    }
    
    .error-message {
        color: #dc3545;
        background-color: rgba(220, 53, 69, 0.1);
        padding: 0.8rem;
        border-radius: 4px;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .dashboard-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem;
    }

    .product-form {
        background: var(--bg-dark-secondary);
        padding: 2rem;
        border-radius: 8px;
        margin-bottom: 2rem;
    }

    .product-form input,
    .product-form textarea {
        width: 100%;
        padding: 0.75rem;
        margin-bottom: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 4px;
        background: var(--bg-dark);
        color: var(--text-light);
    }

    .form-buttons {
        display: flex;
        gap: 1rem;
    }

    .main-button.delete {
        background: #e53e3e;
    }

    .main-button.delete:hover {
        background: #c53030;
    }

    .products-list {
        display: grid;
        gap: 1rem;
    }

    .product-item {
        background: var(--bg-dark-secondary);
        padding: 1.5rem;
        border-radius: 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .product-info h4 {
        margin: 0 0 0.5rem 0;
        color: var(--text-light);
    }

    .product-info p {
        margin: 0.25rem 0;
        color: var(--text-description);
    }

    .product-actions {
        display: flex;
        gap: 0.5rem;
    }
    
    .products-section,
    .messages-section {
        opacity: 0;
        transform: translateY(20px);
        animation: fadeInUp 0.5s ease forwards;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .product-form {
        background: var(--bg-dark-secondary);
        padding: 2rem;
        border-radius: 8px;
        margin-bottom: 2rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .product-form:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15), 0 3px 4px rgba(0, 0, 0, 0.12);
    }
    
    .product-item {
        background: var(--bg-dark-secondary);
        padding: 1.5rem;
        border-radius: 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .product-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15), 0 3px 4px rgba(0, 0, 0, 0.12);
    }
    
    .product-category {
        color: var(--accent-purple);
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .category-select {
        width: 100%;
        padding: 0.5rem;
        margin-bottom: 1rem;
        background-color: var(--bg-dark);
        color: var(--text-light);
        border: 1px solid var(--accent-purple);
        border-radius: 5px;
    }
    
    .product-item {
        background-color: var(--bg-dark-secondary);
        padding: 1.5rem;
        border-radius: 10px;
        margin-bottom: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }
    
    .product-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .product-header i {
        font-size: 1.5rem;
        color: var(--accent-purple);
    }
    
    .product-info {
        flex: 1;
    }
    
    .product-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-left: 1rem;
    }
    
    .product-description {
        color: var(--text-light);
        margin-bottom: 0.5rem;
    }
    
    .product-price {
        color: var(--accent-light-purple);
        font-weight: bold;
        margin-bottom: 0.5rem;
    }
    
    .message-item {
        background: var(--bg-dark-secondary);
        padding: 1.5rem;
        border-radius: 8px;
        margin-bottom: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .message-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15), 0 3px 4px rgba(0, 0, 0, 0.12);
    }

    .message-header {
        margin-bottom: 1rem;
    }

    .message-header h4 {
        margin: 0;
        color: var(--text-light);
    }

    .message-header .email {
        color: var(--text-description);
        font-size: 0.9rem;
    }

    .message-content {
        color: var(--text-light);
        margin-bottom: 1rem;
    }

    .reply {
        background: var(--bg-dark);
        padding: 1rem;
        border-radius: 4px;
        margin: 1rem 0;
    }

    .reply-header {
        color: #3182ce;
        margin: 0 0 0.5rem 0;
        font-weight: 500;
    }

    .reply-form {
        margin-top: 1rem;
    }

    .reply-form textarea {
        width: 100%;
        padding: 0.75rem;
        margin-bottom: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 4px;
        background: var(--bg-dark);
        color: var(--text-light);
        resize: vertical;
    }

    .logout {
        margin-top: 2rem;
        width: 100%;
        max-width: 200px;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    /* Футер */
    footer {
        position: fixed;
        bottom: 0;
        width: 100%;
        background-color: rgba(39, 39, 39, 0.5);
        box-shadow: 0 4px 15px rgba(0, 89, 255, 0.5);
        backdrop-filter: blur(10px);
        text-align: center;
        color: #fff;
        font-size: 1rem;
        z-index: 9999;
    }

    p2 { 
        font-size: 1rem; 
        color: var(--text-light); 
    }

    /* Переключатель темы и языка */
    .theme-language-switcher {
    display: flex;
    gap: 1rem;
    }

    .theme-language-switcher button {
    background: var(--bg-dark-secondary);
    color: var(--text-light);
    border: 1px solid var(--accent-purple);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    }

    .theme-language-switcher button:hover {
    background: var(--accent-purple);
    color: white;
    }

    /* AI-секция */
    .ai-section {
    background: linear-gradient(to bottom right, var(--accent-light-purple), var(--accent-green));
    padding: 3rem;
    text-align: center;
    border-radius: 12px;
    color: white;
    margin: 2rem auto 3rem;
    max-width: 800px;
    animation: fadeInUp 1.5s ease-in-out;
    }

    .ai-section h1 { animation: fadeInZoom 2s ease-in-out; }

    .ai-section p { 
    font-size: 1.2rem; 
    color: #e2e8f0; 
    }

    .ai-section .cta-button {
    background-color: var(--accent-purple);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 10px var(--accent-light-purple);
    animation: fadeInUp 1.5s ease forwards;
    animation-delay: 1s;
    }

    .ai-section .cta-button:hover {
    transform: scale(1.05);
    background-color: var(--accent-green);
    }