﻿/* === RESPONSIVE CSS === */

/* Hamburger -> X animation */
.hamburger-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav hidden on desktop */
.mobile-nav         { display: none; }
.mobile-nav-overlay { display: none; }

/* ============================================================
   Large desktop
   ============================================================ */
@media (max-width: 1200px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 42px; }
    .hero-brand { font-size: 52px; }
    /* trade page responsive is inline */
}

/* ============================================================
   Tablet
   ============================================================ */
@media (max-width: 1024px) {
    .hero-title { font-size: 38px; }
    .hero-brand { font-size: 48px; }
    .hero-stats-row { gap: 10px; }
    .hstat-inline { padding: 14px 18px; }
    .hstat-inline-val { font-size: 20px; }
    .balance-cards { grid-template-columns: 1fr 1fr; }
    .section-title { font-size: 28px; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-left { display: none; }
    .auth-right { padding: 48px 40px; }
    .footer-top { grid-template-columns: 1fr; gap: 32px; }
    .footer-links { grid-template-columns: repeat(3, 1fr); }
    .cabinet-page { grid-template-columns: 1fr; }
    .cabinet-sidebar { display: none; }
    .cab-section { padding: 24px 20px; }
    .cab-mobile-tabs { display: flex; position: sticky; top: 58px; z-index: 90; }
    /* Скрываем декоративный доллар на планшетах и мобильных */
    .cab-bal-deco-wrap { display: none; }
}

/* ============================================================
   Mobile 768px
   ============================================================ */
@media (max-width: 768px) {

    /* Right-side slide menu */
    .mobile-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 400;
        background: var(--bg-secondary);
        border-left: 1px solid var(--border);
        box-shadow: -8px 0 40px rgba(0,0,0,0.5);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        overflow-y: auto;
        overflow-x: hidden;
    }
    .mobile-nav.open { transform: translateX(0); }

    .mobile-nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 399;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
    .mobile-nav-overlay.open { display: block; }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 16px 14px;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }
    .mobile-nav-title {
        font-size: 16px;
        font-weight: 700;
        color: var(--text-primary);
    }
    .mobile-nav-close {
        background: none;
        border: none;
        padding: 6px;
        border-radius: 8px;
        cursor: pointer;
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s, color 0.15s;
    }
    .mobile-nav-close:hover { background: var(--bg-hover); color: var(--text-primary); }

    .mobile-nav-inner {
        padding: 12px 12px 24px;
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1;
    }
    .mobile-nav-links { display: flex; flex-direction: column; gap: 2px; }
    .mobile-nav-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 12px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 500;
        color: var(--text-secondary);
        transition: background 0.15s, color 0.15s;
    }
    .mobile-nav-link svg { opacity: 0.65; flex-shrink: 0; transition: opacity 0.15s; }
    .mobile-nav-link:hover  { background: var(--bg-hover); color: var(--text-primary); }
    .mobile-nav-link:hover svg { opacity: 1; }
    .mobile-nav-link.active { color: var(--accent-light); background: var(--accent-glow2); }
    .mobile-nav-link.active svg { opacity: 1; }
    .mobile-nav-admin { color: var(--accent-light) !important; }
    .mobile-nav-admin svg { stroke: var(--accent-light) !important; opacity: 1 !important; }
    .mobile-nav-danger { color: var(--red) !important; }
    .mobile-nav-danger svg { stroke: var(--red) !important; opacity: 1 !important; }
    .mobile-nav-accent { color: var(--accent) !important; }
    .mobile-nav-accent svg { stroke: var(--accent) !important; opacity: 1 !important; }

    .mobile-nav-sep { height: 1px; background: var(--border); margin: 8px 2px; flex-shrink: 0; }
    .mobile-nav-user {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        margin-bottom: 2px;
    }
    .mobile-nav-user-info { display: flex; flex-direction: column; gap: 2px; }
    .mobile-nav-user-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
    .mobile-nav-user-role { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
    .mobile-nav-lang-form { display: flex; align-items: center; gap: 10px; padding: 6px 12px; }
    .mobile-nav-lang-label { font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
    .mobile-nav-lang-select { flex: 1; }

    /* Header */
    .topbar { display: none; }
    .navbar-menu { display: none !important; }
    .hamburger-btn { display: flex !important; order: 2; }
    .navbar-actions { gap: 8px; }
    /* Языковая плашка остаётся видимой слева от гамбургера */
    .navbar-actions .lang-switch { order: 1; }
    .lang-switch-btn { padding: 6px 8px; font-size: 12px; }
    .lang-switch-menu { right: 0; min-width: 200px; }
    .navbar-actions .btn-user,
    .navbar-actions .btn-outline { display: none !important; }

    /* Hero */
    .hero { padding: 44px 16px 36px; }
    .hero-title { font-size: 30px; line-height: 1.2; }
    .hero-brand { font-size: 38px; }
    .hero-logo { width: 72px; height: 72px; border-radius: 16px; }
    .hero-title-row { gap: 16px; }
    .hero-desc { font-size: 15px; }
    .hero-badge { font-size: 11px; padding: 5px 12px; }
    .hero-buttons { flex-direction: column; gap: 10px; }
    .hero-buttons .btn { justify-content: center; width: 100%; }
    .hero-features { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .hero-feature { justify-content: center; font-size: 12px; padding: 7px 10px; }
    .hero-stats-row { gap: 8px; width: 100%; }
    .hstat-inline { flex: 1; padding: 12px 6px; }
    .hstat-inline-val { font-size: 16px; }
    .hstat-inline-label { font-size: 9px; letter-spacing: 0.3px; }

    /* Sections */
    .section { padding: 44px 16px; }
    .section-title { font-size: 24px; line-height: 1.3; }
    .section-desc { font-size: 14px; }
    .section-header { margin-bottom: 28px; }

    /* Feature cards */
    .features-grid { grid-template-columns: 1fr; gap: 12px; }
    .feature-card { padding: 22px 18px; }

    /* Markets */
    .markets-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 6px;
        padding-bottom: 6px;
        margin-bottom: 16px;
        scrollbar-width: none;
    }
    .markets-filters::-webkit-scrollbar { display: none; }
    .market-filter-tab { flex-shrink: 0; }
    .markets-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
    .markets-table { min-width: 440px; font-size: 13px; }
    .markets-table th:nth-child(5), .markets-table td:nth-child(5),
    .markets-table th:nth-child(6), .markets-table td:nth-child(6) { display: none; }

    /* FAQ */
    .faq-list { gap: 8px; }
    .faq-question { padding: 14px 16px; font-size: 14px; }
    .faq-answer { padding: 0 16px 16px; font-size: 13px; }

    /* Trust */
    .trust-status-bar { max-width: 100%; font-size: 13px; }

    /* CTA */
    .cta-section { padding: 44px 16px; }
    .cta-section h2 { font-size: 26px; }
    .cta-buttons { flex-direction: column; align-items: stretch; gap: 10px; }
    .cta-buttons .btn { justify-content: center; }

    /* Auth */
    .auth-right { padding: 32px 20px; }
    .auth-socials { grid-template-columns: repeat(2, 1fr); }

    /* Balance */
    .balance-cards { grid-template-columns: 1fr; }

    /* Footer */
    .footer { width: 100%; box-sizing: border-box; }
    .footer-top { padding: 32px 16px; }
    .footer-links { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 8px; padding: 16px; }

    /* Ticker */
    .ticker { width: 100%; box-sizing: border-box; }

    /* Cabinet overview */
    .cab-overview { margin: 0 -16px; }
    .cab-balance-card { border-radius:14px; flex-direction:column; align-items:stretch; padding:20px 18px 16px; gap:0; }
    .cab-balance-info { overflow:visible; }
    .cab-bal-amount { font-size:28px; letter-spacing:-.8px; white-space:normal; overflow:visible; text-overflow:clip; word-break:break-all; margin-bottom:6px; }
    .cab-bal-deco-wrap { display:none !important; }
    .cab-quick-acts { flex-direction:row; width:100%; gap:8px; margin-top:16px; flex-shrink:0; }
    .cab-qa { flex:1; justify-content:center; min-width:0; padding:10px 6px; font-size:12px; gap:5px; }
    .cab-qa-icon { width:20px; height:20px; border-radius:6px; flex-shrink:0; }
    .cab-back-btn { display:flex; }
    /* Growth widget mobile */
    .growth-card { padding:16px 14px; min-height:220px; }
    .growth-card-row { max-width:65%; gap:10px; }
    .growth-coin-icon { width:34px; height:34px; }
    .growth-coin-sym { font-size:12px; }
    .growth-pct { font-size:10px; }
    .growth-profit-val { font-size:16px; }
    /* Mobile nav cabinet sub-links (legacy container, no longer used) */
    .mobile-nav-cab-subs { display:none; }
    .cab-section { padding: 20px 16px; }

    /* Trade */
    /* trade page responsive is inline */

    .topbar-stats .topbar-item:nth-child(3) { display: none; }
}

/* ============================================================
   Small mobile 480px
   ============================================================ */
@media (max-width: 480px) {
    .navbar-container { padding: 0 12px; }
    .hero-title { font-size: 24px; }
    .hero-brand { font-size: 32px; }
    .hero-logo { width: 56px; height: 56px; border-radius: 12px; }
    .hero-title-row { gap: 12px; }
    .hero-desc { font-size: 14px; }
    .hero-features { grid-template-columns: 1fr 1fr; gap: 6px; }
    .hero-feature { font-size: 11px; padding: 6px 8px; gap: 5px; }
    .hero-feature svg { width: 12px; height: 12px; }
    .hero { padding: 36px 12px 32px; }
    .hero-badge { font-size: 12px; padding: 7px 14px; }
    .hero-stats-row { gap: 6px; }
    .hstat-inline { padding: 10px 4px; }
    .hstat-inline-val { font-size: 14px; }
    .hstat-inline-label { font-size: 8px; }
    .section { padding: 36px 12px; }
    .section-title { font-size: 22px; }
    .auth-right { padding: 24px 16px; }
    .quick-actions { flex-direction: column; }
    .quick-actions .btn { width: 100%; justify-content: center; }
    .cab-balance-card { padding:16px 15px 14px; }
    .cab-bal-amount { font-size:20px; letter-spacing:-.4px; white-space:normal; overflow:visible; text-overflow:clip; word-break:break-all; }
    .cab-bal-curr { font-size:13px; }
    .cab-qa { padding:9px 4px; font-size:11px; gap:4px; }
    .cab-qa-icon { width:18px; height:18px; border-radius:5px; }
    /* Growth widget small mobile */
    .growth-card { min-height:180px; }
    .growth-card-row { max-width:70%; gap:8px; }
    .growth-coin-icon { width:30px; height:30px; }
    .growth-profit-val { font-size:14px; }
    .markets-table { min-width: 380px; font-size: 12px; }
    .faq-question { font-size: 13px; padding: 12px 14px; }
    .footer-top { padding: 28px 12px; }
    .footer-bottom { padding: 14px 12px; font-size: 12px; }
    .cta-section { padding: 36px 12px; }
    .cta-section h2 { font-size: 22px; }
    .mobile-nav-inner { padding: 10px 12px 16px; }
}

/* ============================================================
   Tx feed — на мобильных растягиваем на всю ширину экрана
   ============================================================ */
@media (max-width: 600px) {
    .tx-feed {
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .tx-item { padding: 12px 14px; }
    .tx-icon { width: 36px; height: 36px; }
    .tx-title { font-size: 13px; }
    .tx-sub { font-size: 11px; }
    .tx-amount { font-size: 14px; }
    .tx-date { font-size: 10px; }
}
