/* Основные переменные */
:root {
    --bg-color: #FDFBF7; /* Мягкий бежевый фон */
    --text-main: #332724; /* Темно-коричневый текст */
    --text-muted: #7A6965; /* Приглушенный текст */
    --accent: #DE7C5A; /* Терракотовый/теплый оранжевый акцент */
    --card-bg: rgba(255, 255, 255, 0.65); /* Для эффекта стекла */
    --card-border: rgba(255, 255, 255, 0.4);
    --shadow-soft: 0 8px 32px rgba(94, 69, 57, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    /* Фон с мягким градиентом для уюта */
    background-image:
        radial-gradient(at 0% 0%, rgba(222, 124, 90, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(253, 224, 195, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(222, 124, 90, 0.1) 0px, transparent 50%);
    /* background-attachment: fixed — убрано, вызывает тормоза на iOS */
    background-attachment: scroll;
    min-height: 100vh;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Эффект стекла (Glassmorphism) */
.glass-card, .glass-header, .glass-info {
    background: var(--card-bg);
    /* blur снижен до 8px — 16px тормозит на мобильных */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

/* Шапка */
.glass-header {
    text-align: center;
    padding: 24px 20px;
    margin-bottom: 30px;
}

.logo-container {
    width: 90px;
    height: 90px;
    margin: 0 auto 16px;
    border-radius: 50%;
    padding: 4px;
    background: white;
    box-shadow: 0 4px 15px rgba(222, 124, 90, 0.2);
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.glass-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--accent);
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Скрываем все экраны по умолчанию кроме активного */
.view {
    display: none;
    animation: fadeIn 0.3s ease-out forwards;
}

.view.active {
    display: block;
}

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

/* Заголовки экранов */
.view-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Кнопка назад для веба */
.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.back-btn:active {
    transform: translateY(-50%) scale(0.9);
    background: rgba(0,0,0,0.05);
}

/* Главное меню */
.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.menu-card {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    width: 100%;
    border: none;
    cursor: pointer;
    touch-action: manipulation; /* убирает 300ms задержку на мобильных */
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
}

.menu-card:active {
    transform: scale(0.98);
}

.icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 16px;
}

.arrow {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0.5;
}

/* Списки ссылок (Маркетплейсы, Соцсети) */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.link-card {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    transition: transform 0.2s;
    border: 1px solid rgba(0,0,0,0.02);
}

.link-card:active {
    transform: scale(0.98);
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 22px;
    margin-right: 16px;
    color: white;
}

.wb .brand-logo { background: linear-gradient(135deg, #cb11ab, #481173); }
.ozon .brand-logo { background: #005bff; }
.tg .brand-logo { background: #2AABEE; }
.vk .brand-logo { background: #0077FF; }
.pin .brand-logo { background: #E60023; }

.brand-info h3 {
    font-size: 16px;
    margin-bottom: 2px;
}

.brand-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.link-card .fa-arrow-up-right-from-square {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0.4;
}

/* Сетка карточек (Каталог пряжи, МК) */
.item-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.item-card {
    background: white;
    border-radius: 20px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.item-emoji {
    font-size: 40px;
    margin-bottom: 12px;
}

.yarn-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 12px;
}

.mk-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 12px;
    display: block;
}

.item-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
    flex-grow: 1;
}

.item-desc {
    font-size: 13px;
    color: var(--text-secondary, #888);
    margin-bottom: 14px;
    line-height: 1.5;
    text-align: left;
}

.action-btn {
    background: var(--bg-color);
    border: 1px solid rgba(222, 124, 90, 0.3);
    color: var(--accent);
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    touch-action: manipulation; /* убирает 300ms задержку на мобильных */
    transition: background 0.2s;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-btn:active {
    background: rgba(222, 124, 90, 0.1);
}

/* Список гайдов */
.guides-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    width: 100%;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
    text-align: left;
    font-family: inherit;
    color: var(--text-main);
}

.guide-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.guide-info {
    flex: 1;
}

.guide-info h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.guide-info p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.guide-arrow {
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0.5;
    flex-shrink: 0;
}


/* Инфо блок */
.glass-info {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 16px;
}

/* Announcement Banner */
.announcement-banner {
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.announcement-banner h2 {
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 8px;
}

.announcement-banner > p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 600;
}

.gift-box {
    display: flex;
    align-items: center;
    padding: 16px;
    text-align: left;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(222, 124, 90, 0.2);
}

.gift-icon {
    font-size: 36px;
    margin-right: 16px;
}

.gift-text p {
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.gift-text strong {
    font-size: 14px;
    color: var(--text-main);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    touch-action: manipulation;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(222, 124, 90, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    min-height: 240px;
    border-radius: 20px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
