/*
Theme Name: Lectvis
Description: Premium WordPress Theme
Version: 4.3 (Shop Segmentation, Portfolio Size Fixes)
*/

/* ==========================================================================
   1. ПЕРЕМЕННЫЕ, ШРИФТЫ И БАЗОВЫЕ СТИЛИ
   ========================================================================== */

/* --- 1.1 CSS Переменные --- */
:root {
    --primary: #000000;
    --secondary: #ffffff;
    --accent: #007AFF; /* Apple Blue - ЦВЕТ КНОПОК */
    --text: #1D1D1F;
    --text-light: #86868B;
    --text-on-dark: #ffffff; /* Белый текст для темных фонов */
    --bg-light: #F5F5F7;
    --border: #D2D2D7;
    
    --header-height: 80px;
    --container-width: 1200px;
    --section-padding: 100px;
    
    --shadow: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-hover: 0 12px 40px rgba(0,0,0,0.12);
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --border-radius: 16px;
    --border-radius-small: 8px;
}

/* --- 1.2 Шрифты (SF Pro Display) --- */
@font-face{font-family:'SF Pro Display';font-weight:400;font-style:normal;font-display:swap;src:local('SF Pro Display'),local('SFProDisplay-Regular'),url('https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff2') format('woff2')}@font-face{font-family:'SF Pro Display';font-weight:500;font-style:normal;font-display:swap;src:local('SF Pro Display Medium'),local('SFProDisplay-Medium'),url('https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.woff2') format('woff2')}@font-face{font-family:'SF Pro Display';font-weight:600;font-style:normal;font-display:swap;src:local('SF Pro Display Semibold'),local('SFProDisplay-Semibold'),url('https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.woff2') format('woff2')}@font-face{font-family:'SF Pro Display';font-weight:700;font-style:normal;font-display:swap;src:local('SF Pro Display Bold'),local('SFProDisplay-Bold'),url('https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.woff2') format('woff2')}@font-face{font-family:'SF Pro Display';font-weight:800;font-style:normal;font-display:swap;src:local('SF Pro Display Heavy'),local('SFProDisplay-Heavy'),url('https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-heavy-webfont.woff2') format('woff2')}

/* --- 1.3 Базовые стили и Сбросы --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: 'SF Pro Display', sans-serif; line-height: 1.6; color: var(--text); background: #111114; overflow-x: hidden; font-weight: 400; }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { opacity: 0.8; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; color: var(--text); }


/* ==========================================================================
   2. ОБЩИЕ КОМПОНЕНТЫ И УТИЛИТЫ
   ========================================================================== */

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; width: 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 15px 35px; border-radius: 50px; font-weight: 600; font-size: 1rem; text-decoration: none; transition: var(--transition); border: 2px solid transparent; cursor: pointer; }
.btn-primary { background-color: var(--accent); color: var(--secondary); border-color: var(--accent); } 
.btn-secondary { background-color: transparent; color: var(--accent); border-color: var(--accent); } 
.btn-primary:hover { background-color: var(--secondary); color: var(--accent); }
.btn-secondary:hover { background-color: var(--accent); color: var(--secondary); }
.btn-large { padding: 20px 45px; font-size: 1.2rem; }
.section-header { text-align: center; margin-bottom: 60px; max-width: 800px; margin-left: auto; margin-right: auto; }
.section-title { font-size: 3.5rem; font-weight: 800; margin-bottom: 15px; letter-spacing: -0.02em; }
.section-subtitle { font-size: 1.3rem; color: var(--text-light); line-height: 1.6; }
.section-footer-actions { text-align: center; margin-top: 50px; }


/* ==========================================================================
   3. СТРУКТУРА СТРАНИЦЫ (HEADER, MAIN, FOOTER)
   ========================================================================== */

/* --- 3.1 Header — тёмное стекло (iOS 26 Liquid Glass) --- */
.main-header {
    position: fixed; top: 0; left: 0;
    width: 100%; height: var(--header-height);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    z-index: 1000;
    transition: var(--transition);
}
body.admin-bar .main-header {
    top: var(--wp-admin--admin-bar--height, 32px);
}
@media screen and (max-width: 600px) {
    /* Keep both fixed bars aligned while an administrator scrolls the page. */
    body.admin-bar #wpadminbar { position: fixed; }
}
/* Стекло хедера — на псевдоэлементе, чтобы сам .main-header НЕ имел backdrop-filter
   (иначе вложенный fixed .main-nav теряет свой блюр на iOS Safari) */
.main-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 16, 0.68);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    z-index: -1;
    pointer-events: none;
}
.header-container { display: flex; align-items: center; justify-content: space-between; max-width: 1400px; height: 100%; margin: 0 auto; padding: 0 30px; }
.logo-link { font-size: 1.8rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; transition: var(--transition); }
.logo-link:hover { color: var(--accent); opacity: 1; }

/* --- 3.2 Навигация --- */
.main-nav { }
.nav-menu { display: flex; list-style: none; gap: 30px; }
.nav-link { font-weight: 500; font-size: 0.9rem; color: rgba(255,255,255,0.72); padding: 5px 0; position: relative; transition: var(--transition); text-transform: uppercase; letter-spacing: 0.03em; }
.nav-link::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px; background: var(--accent); transition: width 0.3s ease; }
.nav-link:hover { color: #fff; opacity: 1; }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: #fff; font-weight: 600; }
.nav-link.active::after { width: 100%; }

/* --- 3.3 Действия в хедере --- */
.header-actions { display: flex; align-items: center; gap: 20px; }
.cart-btn { display: flex; align-items: center; gap: 8px; padding: 8px 15px; background: rgba(255,255,255,0.1); border-radius: 50px; color: rgba(255,255,255,0.85); transition: var(--transition); font-weight: 500; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.14); }
.cart-btn:hover { background: var(--accent); color: #fff; transform: scale(1.05); border-color: transparent; opacity: 1; }
.cart-count { background: var(--accent); color: #fff; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; }
.cart-btn:hover .cart-count { background: #fff; color: var(--accent); }
.login-btn, .profile-btn { padding: 8px 20px; border: 1px solid rgba(255,255,255,0.2); border-radius: 50px; color: rgba(255,255,255,0.85); font-weight: 500; transition: var(--transition); font-size: 0.85rem; }
.login-btn:hover, .profile-btn:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }

/* --- 3.4 Мобильное меню --- */
.mobile-menu-btn {
    display: none;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 50px;
    padding: 8px 12px;
    z-index: 1010;
    color: rgba(255,255,255,0.85);
    align-items: center;
    justify-content: center;
}
.mobile-menu-icon {
    display: block;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.mobile-menu-btn.active .mobile-menu-icon { transform: rotate(90deg); }
.nav-menu-auth { display: none; } /* скрыт на десктопе, показывается через медиазапрос */

/* --- 3.5 Основной контент --- */
main { padding-top: 0; min-height: 100vh; }

/* Первые секции начинаются от самого верха страницы, контент отступает на высоту header */
.hero-section,
.portfolio-archive {
    margin-top: calc(-1 * var(--header-height));
}


/* ==========================================================================
   4. СЕКЦИИ ГЛАВНОЙ СТРАНИЦЫ (front-page.php)
   ========================================================================== */

/* --- 4.1 Hero Section --- */
.hero-section { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; color: var(--text-on-dark); text-align: center; padding-top: var(--header-height); } 
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.hero-bg::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.hero-bg img,
.hero-bg video { width: 100%; height: 100%; object-fit: cover; }
.hero-content { position: relative; z-index: 5; max-width: 900px; padding: 0 20px; display: flex; flex-direction: column; align-items: center; } 
.hero-title { font-size: clamp(3.5rem, 8vw, 6rem); font-weight: 800; margin-bottom: 20px; line-height: 1.1; text-shadow: 0 4px 20px rgba(0,0,0,0.4); color: var(--text-on-dark); } 
.hero-subtitle { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 400; margin-bottom: 40px; line-height: 1.5; text-shadow: 0 2px 10px rgba(0,0,0,0.3); color: var(--text-on-dark); max-width: 600px; } 
.hero-actions { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn-primary { background-color: var(--accent); color: var(--secondary); border-color: var(--accent); }
.hero-actions .btn-secondary { background-color: transparent; color: var(--secondary); border-color: var(--secondary); }
.hero-actions .btn-primary:hover { background-color: var(--secondary); color: var(--accent); border-color: var(--secondary); }
.hero-actions .btn-secondary:hover { background-color: var(--secondary); color: var(--accent); border-color: var(--secondary); }

/* --- 4.2 Portfolio Section (Сетка 2x3) --- */
.portfolio-section { padding: var(--section-padding) 0; background: var(--secondary); }
.portfolio-section .portfolio-grid { /* Используется из content-portfolio-grid.php */
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 3 колонки */
    gap: 30px;
    margin-top: 40px;
}
.portfolio-section .portfolio-item a { display: block; }
.portfolio-section .portfolio-item:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }


/* --- 4.3 About Section (Исправлен фон) --- */
.about-section { 
    padding: var(--section-padding) 0; 
    position: relative; 
    background-color: #1a1a1a; 
    color: var(--text-on-dark); 
    overflow: hidden; 
}
.about-section .about-bg { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; 
}
.about-section .about-bg img { width: 100%; height: 100%; object-fit: cover; }
/* НОВЫЙ Оверлей: Простое затемнение (вместо градиента) */
.about-section::before { 
    content: ''; 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.7); /* Сильное, но не градиентное затемнение */
    z-index: 2;
}
.about-section .container { position: relative; z-index: 5; }
.about-container { display: flex; justify-content: center; }
.about-content { max-width: 800px; text-align: center; }
.about-title { margin-bottom: 30px; color: var(--text-on-dark); }
.about-text { font-size: 1.1rem; line-height: 1.7; color: rgba(255,255,255,0.8); margin-bottom: 40px; }
.about-stats { display: flex; justify-content: center; gap: 50px; margin-top: 40px; }
.stat-item { text-align: center; }
.stat-number { font-size: 3rem; font-weight: 700; color: var(--accent); display: block; margin-bottom: 5px; }
.stat-item span:last-child { font-size: 1rem; color: rgba(255,255,255,0.7); }

/* --- 4.4 Brands Showcase Section (Восстановленная карусель) --- */
.brands-showcase-section { padding: var(--section-padding) 0; position: relative; overflow: hidden; background: #111; /* fallback если фото не загрузилось */ }
.brands-showcase-section .section-header { margin-bottom: 48px; }
.brands-showcase-section .section-title, .brands-showcase-section .section-subtitle { color: var(--secondary); }
.logos-white-container-ultrathin { 
    background: var(--secondary); 
    border-radius: var(--border-radius); 
    padding: 15px 0; 
    max-width: calc(var(--container-width) + 100px); 
    margin: 40px auto; 
    box-shadow: var(--shadow); 
}
.brands-carousel-wrapper {
    position: relative;
    padding: 0 50px; /* Отступы для кнопок */
}
.brands-carousel {
    overflow: hidden;
    position: relative;
}
.carousel-viewport { overflow: hidden; }
.carousel-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    gap: 20px; 
}
.carousel-slide {
    flex-shrink: 0;
    width: 180px; /* Размер слайда логотипа */
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
}
.carousel-slide:hover { opacity: 1; transform: scale(1.05); }
.brand-logo { max-width: 80%; max-height: 100%; }
.brand-logo img {
    width: auto; height: 100%; object-fit: contain;
    filter: grayscale(100%); /* Логотипы черно-белые */
    transition: var(--transition);
}
.carousel-slide:hover .brand-logo img { filter: grayscale(0%); }
.carousel-btn { /* Кнопки навигации */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 10;
    color: var(--text);
    transition: var(--transition);
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-btn:hover { background: var(--accent); color: var(--secondary); }
.carousel-btn[disabled] { opacity: 0.3; cursor: default; }


/* --- 4.5 Shop Section (Карусель магазина / Продуктовая сетка) --- */
.shop-section { padding: var(--section-padding) 0; background: var(--bg-light); }
.shop-section-segment { /* Секция для отдельного раздела (LUTs / SFX) */
    margin-bottom: 60px;
}
.shop-segment-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text);
}
/* Обертка для эффекта градиента и навигации */
.products-carousel-wrapper {
    position: relative;
    padding: 0 60px; /* Отступы для навигации */
}
.products-list {
    display: flex;
    overflow-x: scroll; /* Позволяет прокручивать горизонтально (эффект карусели) */
    gap: 30px;
    padding-bottom: 20px; 
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
/* Скрываем стандартный скроллбар (если он не нужен для стилизации) */
.products-list::-webkit-scrollbar { display: none; }
.products-list { -ms-overflow-style: none; scrollbar-width: none; } 

/* Эффект градиента дальности */
.products-carousel-wrapper::before,
.products-carousel-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 20px; /* До уровня скроллбара/падинга */
    width: 60px;
    z-index: 5;
    pointer-events: none;
}
.products-carousel-wrapper::before {
    left: 60px;
    /* Градиент от фона до прозрачного */
    background: linear-gradient(to right, var(--bg-light), rgba(245,245,247, 0) 100%); 
}
.products-carousel-wrapper::after {
    right: 60px;
    /* Градиент от фона до прозрачного (обратный) */
    background: linear-gradient(to left, var(--bg-light), rgba(245,245,247, 0) 100%);
}

/* Навигация (круглые кнопки в стиле Apple) */
.shop-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(calc(-50% - 10px)); /* Сдвигаем выше середины, учитывая padding-bottom 20px */
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 10;
    color: var(--text);
    transition: var(--transition);
}
.shop-carousel-btn.prev-btn { left: 10px; }
.shop-carousel-btn.next-btn { right: 10px; }
.shop-carousel-btn:hover { background: var(--accent); color: var(--secondary); border-color: var(--accent); }
.shop-carousel-btn[disabled] { opacity: 0.3; cursor: default; }
.shop-carousel-btn svg { width: 24px; height: 24px; }

/* Карточка товара */
.product-item {
    flex-shrink: 0;
    width: 390px; /* Ширина карточки +30% */
    background: var(--secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.product-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-5px); }
.product-image {
    position: relative;
    padding-bottom: 100%; 
    margin-bottom: 15px;
    border-radius: var(--border-radius-small);
    overflow: hidden;
}
.product-image img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
}
.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.product-title {
    font-size: 1.56rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}
.product-price {
    font-size: 1.95rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
}
.buy-btn {
    display: block;
    width: 100%;
    background-color: var(--primary);
    color: var(--secondary);
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.buy-btn:hover {
    background-color: var(--accent);
}
/* Ссылка-обёртка карточки товара — заполняет всё пространство кроме кнопки */
.product-link {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    width: 100%;
    flex-grow: 1;
}
.product-link .product-image { margin-bottom: 0; }
.product-link .product-info { flex-grow: 1; justify-content: center; }
.product-link .product-footer { width: 100%; border-top: none; padding-top: 0; }

/* Карточка товара в shop-section — должна вмещать и ссылку, и кнопку */
.shop-section .product-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.shop-section .product-link {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
}



/* --- 4.6 Contacts Section (Подвал) --- */
.contacts-section { 
    padding: 0; 
    min-height: 80vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    overflow: hidden; 
    color: var(--text-on-dark); 
    text-align: center; 
}
.contacts-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.contacts-bg img { width: 100%; height: 100%; object-fit: cover; }
.contacts-overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; 
    background: rgba(0,0,0,0.7); 
}
.contacts-section .container { position: relative; z-index: 5; }
.contacts-container { max-width: 700px; margin: 0 auto; }
.contacts-title { font-size: 3rem; margin-bottom: 40px; color: var(--text-on-dark); }
.social-links { display: flex; justify-content: center; gap: 35px; margin-bottom: 40px; }
.social-link img {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    transition: transform 0.3s ease, opacity 0.2s ease;
}
.social-link:hover img { transform: scale(1.1); opacity: 0.85; }
.contacts-actions { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.action-row { display: flex; gap: 20px; width: 100%; justify-content: center; }
.contacts-btn { 
    flex: 1; 
    max-width: 280px; 
    /* ПРИМЕНЕНИЕ ФОРМЫ КНОПОК ИЗ HERO */
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 20px 45px; /* btn-large */
    border-radius: 50px; 
    font-weight: 600; 
    font-size: 1.2rem; 
    text-decoration: none; 
    transition: var(--transition); 
    border: 2px solid transparent;
}
/* Стили для primary и secondary в контактах */
.contacts-actions .btn-primary { 
    background-color: var(--accent); 
    color: var(--secondary); 
    border-color: var(--accent); 
}
.contacts-actions .btn-secondary { 
    background-color: transparent; 
    color: var(--secondary); 
    border-color: var(--secondary); 
}
.contacts-actions .btn-primary:hover { 
    background-color: var(--secondary); 
    color: var(--accent); 
    border-color: var(--secondary); 
}
.contacts-actions .btn-secondary:hover { 
    background-color: var(--secondary); 
    color: var(--accent); 
    border-color: var(--secondary); 
}

.contacts-footer { margin-top: 50px; color: rgba(255, 255, 255, 0.6); }
.contacts-footer .copyright-text { font-size: 0.78rem; letter-spacing: 0.04em; color: rgba(255,255,255,0.3); margin: 0; }
.footer-logo {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
    margin-bottom: 12px;
    transition: opacity 0.2s ease;
}
.footer-logo:hover { opacity: 0.6; }


/* ==========================================================================
   5. АРХИВЫ И ОТДЕЛЬНЫЕ СТРАНИЦЫ
   ========================================================================== */

/* --- 5.1 Portfolio Archive (archive-portfolio.php) — iOS 26 Redesign --- */
.portfolio-archive {
    position: relative;
    min-height: 100vh;
    overflow: hidden; /* содержит ::before с blur-эффектом */
    background: #050507;
    color: #fff;
    isolation: isolate;
}

/* Фон через ::before — надёжнее div+img, нет конфликтов с isolation/z-index */
.portfolio-archive::before {
    content: '';
    position: absolute;
    inset: -6%; /* запас, чтобы blur не давал белые края */
    background: var(--pa-bg-url, none) center top / cover no-repeat;
    filter: blur(18px) saturate(1.05);
    opacity: 0.54;
    transform: scale(1.04);
    z-index: 0;
    pointer-events: none;
}

/* Тёмный оверлей через ::after */
.portfolio-archive::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.86) 44%, rgba(0,0,0,0.94) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Hero — выше оверлея (z-index: 1) */
.pa-hero {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    color: var(--text-on-dark);
}
.pa-hero .container {
    position: relative;
    padding-top: calc(2 * var(--header-height) + 20px);
    padding-bottom: 36px;
}
.pa-hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 800;
    color: var(--text-on-dark);
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.pa-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255,255,255,0.65);
    font-weight: 400;
}

/* Category section */
.pa-cats-section {
    position: relative;
    z-index: 2;
    padding: 0 0 80px;
}
.pa-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Category card — Liquid Glass */
.pa-cat-card {
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    background: #141416;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.15),
        0 8px 32px rgba(0,0,0,0.5);
    /* Плавный spring — без scale, только вертикальный подъём */
    transition:
        transform 0.55s cubic-bezier(0.34, 1.4, 0.64, 1),
        box-shadow 0.55s cubic-bezier(0.25,0.46,0.45,0.94),
        border-color 0.4s ease;
    will-change: transform;
}
/* Specular highlight */
.pa-cat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.55) 50%, transparent);
    z-index: 10;
    pointer-events: none;
}
.pa-cat-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255,255,255,0.2);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.22),
        0 28px 60px rgba(0,0,0,0.6);
}
.pa-cat-card:active {
    transform: translateY(-4px);
    transition-duration: 0.15s;
}

/* Image area */
.pa-cat-media {
    position: relative;
    padding-bottom: 56%;
    overflow: hidden;
    flex-shrink: 0;
}
.pa-cat-media img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25,0.46,0.45,0.94);
    will-change: transform;
}
.pa-cat-card:hover .pa-cat-media img { transform: scale(1.05); }
.pa-cat-media::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: none; z-index: 1;
}
.pa-cat-placeholder {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(145deg, rgba(28,28,38,1) 0%, rgba(12,12,18,1) 100%);
}

/* Glass footer */
.pa-cat-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 22px;
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.pa-cat-name {
    color: rgba(255,255,255,0.92);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.pa-cat-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.3s ease;
}
.pa-cat-card:hover .pa-cat-cta { color: var(--accent); }

/* Brands at bottom */
.pa-brands-section { position: relative; z-index: 2; }
.pa-brands-section .logos-white-container-ultrathin { position: relative; z-index: 5; }

@media (max-width: 768px) {
    .pa-cat-grid { grid-template-columns: 1fr; }
    .pa-cat-name { font-size: 1.2rem; }
    .pa-cat-footer { padding: 16px 18px 18px; }
}


/* --- 5.2 Portfolio Category Showcase (taxonomy-portfolio_category.php) --- */

/* Page wrapper — blurred bg via ::before, overlay via ::after */
.pcat-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: #111114;
    margin-top: calc(-1 * var(--header-height)); /* start under header */
}
.pcat-page::before {
    content: '';
    position: absolute;
    inset: -6%;
    background: var(--pcat-bg, none) center top / cover no-repeat;
    filter: blur(12px);
    z-index: 0;
    pointer-events: none;
}
.pcat-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.80);
    z-index: 1;
    pointer-events: none;
}

/* Hero */
.pcat-hero {
    position: relative;
    z-index: 2;
    padding-top: calc(2 * var(--header-height) + 24px);
    padding-bottom: 40px;
    color: #fff;
}
.pcat-hero-inner { max-width: 720px; }

/* Glass pill — same as .sp-back */
.pcat-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px 7px 10px;
    border-radius: 50px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-decoration: none;
    margin-bottom: 24px;
    transition: background 0.2s ease, color 0.2s ease;
}
.pcat-back:hover { background: rgba(255,255,255,0.2); color: #fff; }
.pcat-back svg { flex-shrink: 0; color: rgba(255,255,255,0.7); }
.pcat-back:hover svg { color: #fff; }

.pcat-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin: 0 0 10px;
}
.pcat-hero-desc {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.6;
    margin-bottom: 12px;
}
.pcat-hero-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.02em;
}

/* Works grid */
.pcat-works {
    position: relative;
    z-index: 2;
    padding-bottom: 100px;
}

/* Bento grid: 3 columns, first card is featured (spans 2) */
.pcat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 360px;
    gap: 16px;
}

/* Card */
.pcat-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #1a1a1d;
    transition:
        transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1),
        box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.pcat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 32px 64px rgba(0,0,0,0.65);
}

/* Featured first card: spans 2 columns, double height */
.pcat-card--featured {
    grid-column: span 2;
    grid-row: span 2;
}
.pcat-card--edge-fill { grid-column: span 2; }

.pcat-card-link {
    display: block;
    width: 100%; height: 100%;
    position: relative;
}
.pcat-card-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.pcat-card:hover .pcat-card-img { transform: scale(1.04); }

.pcat-card-noimg {
    width: 100%; height: 100%;
    background: #1e1e21;
}

/* Overlay: appears on hover */
.pcat-card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 32px 24px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, transparent 100%);
    transform: translateY(8px);
    opacity: 0;
    transition:
        opacity 0.35s ease,
        transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.pcat-card:hover .pcat-card-overlay {
    opacity: 1;
    transform: translateY(0);
}

.pcat-card-brand {
    margin-bottom: 10px;
}
.pcat-card-brand img {
    height: 20px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}
.pcat-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.pcat-card--featured .pcat-card-title { font-size: 1.5rem; }

/* Pagination */
.pcat-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 60px;
    flex-wrap: wrap;
}
.pcat-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.25s ease;
}
.pcat-pagination .page-numbers:hover { background: rgba(255,255,255,0.14); color: #fff; opacity: 1; }
.pcat-pagination .page-numbers.current { background: var(--accent); color: #fff; border-color: transparent; }

.pcat-empty {
    color: rgba(255,255,255,0.45);
    text-align: center;
    padding: 80px 0;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 900px) {
    .pcat-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 280px;
    }
    .pcat-card--featured { grid-column: span 2; grid-row: span 1; }
    .pcat-card--edge-fill { grid-column: span 1; }
}
@media (max-width: 600px) {
    .pcat-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 280px;
    }
    .pcat-card--featured { grid-column: span 1; }
    .pcat-card--edge-fill { grid-column: span 1; }
    .pcat-card-overlay { opacity: 1; transform: translateY(0); }
}


/* --- 5.3 Brand Detail (taxonomy-portfolio_brand.php) --- */
.brand-detail-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    margin-top: calc(-1 * var(--header-height));
    background: #050507;
    color: #fff;
    isolation: isolate;
}
.brand-detail-page::before {
    content: '';
    position: absolute;
    inset: -6%;
    background: var(--brand-bg, none) center center / cover no-repeat;
    filter: blur(24px) brightness(0.46) saturate(1.08);
    transform: scale(1.05);
    z-index: 0;
    pointer-events: none;
}
.brand-detail-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 74% 34%, rgba(255,255,255,0.13), transparent 30%),
        linear-gradient(180deg, rgba(0,0,0,0.68) 0%, rgba(0,0,0,0.86) 48%, #050507 100%);
    z-index: 1;
    pointer-events: none;
}
.brand-detail-hero,
.brand-detail-works {
    position: relative;
    z-index: 2;
}
.brand-detail-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: calc(2 * var(--header-height) + 24px);
    padding-bottom: 80px;
}
.brand-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px 7px 10px;
    margin-bottom: 28px;
    border-radius: 50px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 2px 14px rgba(0,0,0,0.32);
    color: rgba(255,255,255,0.9);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.brand-detail-back:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    transform: translateY(-1px);
}
.brand-detail-back svg { flex-shrink: 0; color: rgba(255,255,255,0.72); }
.brand-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: start;
    gap: 72px;
}
.brand-detail-copy {
    max-width: 760px;
}
.brand-detail-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    margin-bottom: 24px;
}
.brand-detail-logo {
    display: block;
    max-width: 190px;
    max-height: 54px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.brand-detail-logo--natural {
    filter: none;
}
.brand-detail-kicker {
    margin: 0 0 12px;
    color: rgba(255,255,255,0.58);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}
.brand-detail-title {
    margin: 0;
    color: #fff;
    font-size: 4.8rem;
    font-weight: 850;
    line-height: 0.98;
    letter-spacing: 0;
}
.brand-detail-description {
    max-width: 620px;
    margin-top: 28px;
    color: rgba(255,255,255,0.76);
    font-size: 1.14rem;
    line-height: 1.65;
}
.brand-detail-description p {
    margin: 0 0 1em;
}
.brand-detail-description p:last-child {
    margin-bottom: 0;
}
.brand-detail-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 34px;
}
.brand-detail-work-link {
    min-width: 190px;
    justify-content: center;
}
.brand-detail-count {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.72);
    font-size: 0.9rem;
    font-weight: 650;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.brand-detail-repost {
    display: flex;
    justify-content: center;
}
.brand-detail-phone {
    position: relative;
    width: min(100%, 380px);
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 34px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.42);
    box-shadow:
        0 34px 90px rgba(0,0,0,0.66),
        0 0 0 1px rgba(255,255,255,0.12),
        0 0 54px rgba(255,255,255,0.16);
}
.brand-detail-phone::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.42), inset 0 -1px 0 rgba(255,255,255,0.08);
    z-index: 2;
    pointer-events: none;
}
.brand-detail-phone img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.brand-detail-repost-placeholder {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.13), rgba(255,255,255,0.03)),
        rgba(0,0,0,0.38);
}
.brand-detail-works {
    padding: 0 0 110px;
}
.brand-detail-section-head {
    margin-bottom: 22px;
}
.brand-detail-section-head h2 {
    margin: 0;
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0;
}
.brand-detail-work-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.brand-detail-work-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 20px 50px rgba(0,0,0,0.34);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.brand-detail-work-card:first-child {
    grid-column: span 2;
}
.brand-detail-work-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.34);
    box-shadow: 0 30px 70px rgba(0,0,0,0.48), 0 0 28px rgba(255,255,255,0.12);
}
.brand-detail-work-card a {
    display: block;
    color: inherit;
    text-decoration: none;
}
.brand-detail-work-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
}
.brand-detail-work-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}
.brand-detail-work-card:hover .brand-detail-work-media img {
    transform: scale(1.04);
}
.brand-detail-work-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(12,12,14,0.74);
}
.brand-detail-work-body h3 {
    margin: 0;
    color: rgba(255,255,255,0.94);
    font-size: 1.1rem;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: 0;
}
.brand-detail-work-body span {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 700;
}

@media (max-width: 1024px) {
    .brand-detail-layout {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
        gap: 42px;
    }
    .brand-detail-title { font-size: 3.7rem; }
    .brand-detail-work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .brand-detail-hero {
        min-height: auto;
        align-items: flex-start;
        padding-top: calc(2 * var(--header-height) + 18px);
        padding-bottom: 58px;
    }
    .brand-detail-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .brand-detail-copy { max-width: none; }
    .brand-detail-logo-wrap { min-height: 44px; margin-bottom: 18px; }
    .brand-detail-logo { max-width: 150px; max-height: 44px; }
    .brand-detail-title { font-size: 2.8rem; line-height: 1; }
    .brand-detail-description { margin-top: 20px; font-size: 1rem; line-height: 1.58; }
    .brand-detail-actions { gap: 12px; margin-top: 26px; }
    .brand-detail-work-link { width: 100%; min-width: 0; }
    .brand-detail-count { width: 100%; justify-content: center; }
    .brand-detail-phone {
        width: min(82vw, 330px);
        border-radius: 28px;
    }
    .brand-detail-works { padding-bottom: 80px; }
    .brand-detail-work-grid { grid-template-columns: 1fr; }
    .brand-detail-work-card:first-child { grid-column: auto; }
}
@media (max-width: 420px) {
    .brand-detail-title { font-size: 2.35rem; }
    .brand-detail-back { margin-bottom: 22px; }
    .brand-detail-phone { width: min(88vw, 310px); }
    .brand-detail-work-body {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}


/* --- 5.4 Single Portfolio — iOS 26 Gallery (single-portfolio.php) --- */

/* Page wrapper */
.sp-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: #111114;
    margin-top: calc(-1 * var(--header-height));
}
.sp-page::before {
    content: '';
    position: absolute;
    inset: -6%;
    background: var(--sp-bg, none) center top / cover no-repeat;
    filter: blur(32px) brightness(0.35);
    z-index: 0;
    pointer-events: none;
}
.sp-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1;
    pointer-events: none;
}

/* Back nav row above title */
.sp-nav-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.sp-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px 7px 10px;
    border-radius: 50px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.sp-back svg { flex-shrink: 0; color: rgba(255,255,255,0.7); }
.sp-back:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.sp-back:hover svg { color: #fff; }
.sp-brand-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 2px 10px;
    border-radius: 50px;
    border: 1px solid rgba(0,122,255,0.35);
    background: rgba(0,122,255,0.1);
    text-decoration: none;
    transition: background 0.2s;
}
.sp-brand-tag:hover { background: rgba(0,122,255,0.22); }

/* Gallery section */
.sp-gallery-section {
    position: relative;
    z-index: 2;
    padding-top: calc(2 * var(--header-height) + 24px);
    padding-bottom: 100px;
}

/* Заголовок + кнопки размера в одну строку */
.sp-gallery-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.sp-gallery-title-group { flex: 1; min-width: 0; }
.sp-title {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sp-meta-item { font-size: 0.82rem; color: rgba(255,255,255,0.4); }
.sp-meta-sep  { color: rgba(255,255,255,0.18); font-size: 0.85rem; }

/* Описание проекта */
.sp-desc {
    margin-bottom: 16px;
    color: rgba(255,255,255,0.55);
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 720px;
}
.sp-desc p { margin-bottom: 10px; }
.sp-desc p:last-child { margin-bottom: 0; }

/* ── Video block ──────────────────────────────────────────────────── */
.sp-video-block {
    margin-bottom: 16px;
}

/* Frame — Liquid Glass container */
.sp-video-frame {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow:
        0 24px 64px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

/* 16:9 landscape */
.sp-video-block:not(.sp-video-block--portrait) .sp-video-frame {
    aspect-ratio: 16 / 9;
    width: 100%;
}

/* 9:16 portrait — centered column */
.sp-video-block--portrait {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.sp-video-block--portrait .sp-video-header {
    align-self: flex-start;
}
.sp-video-block--portrait .sp-video-frame {
    aspect-ratio: 9 / 16;
    width: min(380px, 100%);
}

.sp-video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    object-fit: contain;
    background: #000;
}

/* Size controls */
.sp-controls {
    flex-shrink: 0;
}
.sp-size-btns {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 4px;
}
.sp-size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 9px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.sp-size-btn:hover { color: rgba(255,255,255,0.7); }
.sp-size-btn.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* Gallery masonry — density controlled by data-cols */
.sp-gallery {
    display: block;
    column-gap: 10px;
    transition: height 0.25s ease;
}

.sp-gallery[data-cols="2"] {
    column-count: 2;
}

.sp-gallery[data-cols="3"] {
    column-count: 3;
}

.sp-gallery[data-cols="4"] {
    column-count: 4;
}

.sp-gallery.is-masonry-ready {
    position: relative;
    column-count: auto;
    column-gap: 0;
}

/* Tile */
.sp-tile {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 0 10px;
    aspect-ratio: var(--tile-aspect, 1 / 1);
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #1a1a1d;
    border: none;
    cursor: pointer;
    padding: 0;
    transition:
        transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1),
        box-shadow 0.4s ease;
    will-change: transform;
}

.sp-tile--portrait {
    --tile-aspect: 3 / 4;
}

.sp-tile--landscape {
    --tile-aspect: 16 / 10;
}

.sp-tile--square {
    --tile-aspect: 1 / 1;
}

.sp-gallery.is-masonry-ready .sp-tile {
    position: absolute;
    left: var(--tile-left, 0);
    top: var(--tile-top, 0);
    width: var(--tile-width, 100%);
    height: var(--tile-height, auto);
    margin: 0;
    aspect-ratio: auto;
    transition:
        left 0.28s ease,
        top 0.28s ease,
        width 0.28s ease,
        height 0.28s ease,
        transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1),
        box-shadow 0.4s ease;
}

.sp-tile:hover {
    transform: scale(1.03);
    box-shadow: 0 20px 48px rgba(0,0,0,0.65);
    z-index: 3;
}
.sp-tile img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
    pointer-events: none;
}
.sp-tile:hover img { transform: scale(1.06); }

/* Video tile in masonry */
.sp-tile--video {
    --tile-aspect: 3 / 4;
    cursor: pointer;
}
.sp-tile-vid {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.sp-tile-vid-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1d;
}

/* Gradient vignette for video tiles */
.sp-tile--video::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 40%,
        rgba(0,0,0,0.55) 100%
    );
    pointer-events: none;
    border-radius: inherit;
}

/* Centered play button — iOS Liquid Glass style */
.sp-tile-video-badge {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
    z-index: 2;
}
.sp-tile-video-badge .sp-vbadge-circle {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 24px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.3);
    transition: transform 0.3s cubic-bezier(0.34,1.4,0.64,1), background 0.2s;
}
.sp-tile--video:hover .sp-vbadge-circle {
    transform: scale(1.1);
    background: rgba(255,255,255,0.28);
}
.sp-tile-video-badge .sp-vbadge-circle svg {
    width: 20px; height: 20px;
    color: #fff;
    margin-left: 2px; /* optical center for play icon */
}
.sp-tile-video-badge .sp-vbadge-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.7);
}

.sp-empty { color: rgba(255,255,255,0.4); text-align: center; padding: 80px 0; }

/* ── LIGHTBOX ─────────────────────────────────────────────────────── */
.sp-lb {
    position: fixed;
    inset: 0;
    z-index: 100000; /* Above the WordPress admin bar, like the client viewer. */
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    isolation: isolate;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}
.sp-lb.is-open {
    opacity: 1;
    pointer-events: all;
}

/* Close */
.sp-lb-close {
    position: absolute;
    top: 20px; right: 20px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.8);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 10;
}
.sp-lb-close:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* Navigation arrows */
.sp-lb-prev, .sp-lb-next {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.75);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 10;
}
.sp-lb-prev { left: 20px; }
.sp-lb-next { right: 20px; }
.sp-lb-prev:hover, .sp-lb-next:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* Stage — main image / video */
.sp-lb-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px 0;
    width: 100%;
    min-height: 0;
}
.sp-lb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.25s ease;
    display: block;
}
.sp-lb-vid {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    display: block;
    background: #000;
}

/* Counter */
.sp-lb-counter {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.38);
    letter-spacing: 0.04em;
    padding: 12px 0 8px;
    flex-shrink: 0;
}

/* Filmstrip */
.sp-lb-strip {
    width: 100%;
    padding: 8px 24px 24px;
    flex-shrink: 0;
    overflow: hidden;
}
.sp-lb-strip-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 4px 2px;
}
.sp-lb-strip-track::-webkit-scrollbar { display: none; }

.sp-lb-thumb {
    flex-shrink: 0;
    width: 72px; height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    background: #1c1c1f;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    opacity: 0.5;
}
.sp-lb-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
/* Video thumbnail in filmstrip */
.sp-lb-thumb--video {
    background: #1a1a1d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    position: relative;
}
.sp-lb-thumb-play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
}

.sp-lb-thumb:hover { opacity: 0.8; }
.sp-lb-thumb.is-active {
    border-color: #fff;
    opacity: 1;
    transform: scale(1.08);
}

/* Responsive */
@media (max-width: 768px) {
    .sp-gallery[data-mobile-cols="1"] { column-count: 1; }
    .sp-gallery[data-mobile-cols="2"] { column-count: 2; }
    .sp-gallery[data-mobile-cols="3"] { column-count: 3; }

    .sp-lb-stage { padding: 56px 14px 0; }
    .sp-lb-prev, .sp-lb-next { width: 42px; height: 42px; }
    .sp-lb-prev { left: 8px; }
    .sp-lb-next { right: 8px; }
}
@media (max-width: 480px) {
    .sp-gallery {
        column-gap: 8px;
    }

    .sp-gallery[data-mobile-cols="1"] { column-count: 1; }
    .sp-gallery[data-mobile-cols="2"] { column-count: 2; }
    .sp-gallery[data-mobile-cols="3"] { column-count: 3; }

    .sp-lb-thumb { width: 52px; height: 52px; }
    /* фото на весь экран, стрелки компактные у краёв */
    .sp-lb-stage { padding: 64px 8px 0; }
    .sp-lb-prev, .sp-lb-next {
        width: 40px; height: 40px;
        background: rgba(255,255,255,0.14);
    }
    .sp-lb-prev { left: 6px; }
    .sp-lb-next { right: 6px; }
    .sp-lb-close { top: 14px; right: 14px; }
}


/* --- 6.1 Карточка Портфолио (Общие стили для content-portfolio-grid.php) --- */
.portfolio-item { position: relative; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow); background: var(--secondary); }
.portfolio-item .item-image { position: relative; padding-bottom: 75%; overflow: hidden; } /* 4:3 Aspect Ratio for grid */
.portfolio-item .item-image img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.portfolio-item .item-content { padding: 20px; }
.portfolio-item .item-brand { margin-bottom: 8px; }
.portfolio-item .item-brand img { height: 18px; width: auto; }
.portfolio-item .item-title { font-size: 1.2rem; font-weight: 600; color: var(--text); }


/* ==========================================================================
   7. АДАПТИВНОСТЬ
   ========================================================================== */

@media (max-width: 992px) {
    :root { --section-padding: 80px; }
    .section-title { font-size: 2.8rem; }
    .section-subtitle { font-size: 1.1rem; }
    .mobile-menu-btn { display: flex; }

    /* Overlay — БЕЗ transform, иначе backdrop-filter не работает на iOS Safari */
    .main-nav {
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100dvh;
        z-index: 1009;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0 24px;
        gap: 0;
    }
    .main-nav.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Pill list — анимация scale/translate здесь, чтобы не ломать блюр оверлея */
    .main-nav .nav-menu {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        max-width: 340px;
        padding: 0;
        transform: scale(0.96) translateY(-12px);
        transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    .main-nav.active .nav-menu {
        transform: scale(1) translateY(0);
    }
    .main-nav .nav-link {
        display: block;
        padding: 18px 28px;
        border-radius: 50px;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.1);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 16px rgba(0,0,0,0.25);
        color: rgba(255,255,255,0.88);
        font-size: 1.05rem;
        font-weight: 600;
        letter-spacing: -0.01em;
        text-align: center;
        text-transform: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        transition: background 0.2s ease, color 0.2s ease;
    }
    .main-nav .nav-link:hover,
    .main-nav .nav-link.active {
        background: rgba(255,255,255,0.16);
        color: #fff;
        opacity: 1;
    }
    .main-nav .nav-link::after { display: none; }

    /* Auth pill — акцентный */
    .nav-menu-auth .nav-link {
        background: var(--accent);
        border-color: transparent;
        color: #fff;
        box-shadow: 0 8px 24px rgba(0,122,255,0.4);
        margin-top: 8px;
    }
    .nav-menu-auth .nav-link:hover {
        background: #0a84ff;
    }
    .hero-title { font-size: clamp(3rem, 10vw, 4.5rem); }
    .hero-subtitle { font-size: clamp(1.1rem, 4vw, 1.5rem); }
    .portfolio-section .portfolio-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } /* 2 колонки */
    .about-stats { gap: 30px; }
    .stat-number { font-size: 2.5rem; }
    .carousel-slide { width: 150px; }
    .products-list { gap: 20px; }
    .product-item { width: 364px; }
    .category-banners { grid-template-columns: 1fr; }
    .taxonomy-portfolio_category .portfolio-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
    .work-gallery-grid .gallery-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
}

@media (max-width: 600px) {
    :root { --section-padding: 60px; }
    .section-title { font-size: 2.2rem; }
    .section-subtitle { font-size: 1rem; }
    .btn { padding: 12px 25px; font-size: 0.9rem; }
    .btn-large { padding: 15px 35px; font-size: 1rem; }
    .header-container { padding: 0 15px; }
    .logo-link { font-size: 1.5rem; }
    .header-actions { gap: 10px; }
    .cart-btn { padding: 6px 12px; font-size: 0.8rem; }
    .cart-count { width: 18px; height: 18px; font-size: 0.7rem; }
    .login-btn, .profile-btn { padding: 6px 15px; font-size: 0.8rem; }
    .hero-actions { flex-direction: column; gap: 15px; }
    .portfolio-section .portfolio-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } /* 2 колонки */
    .about-stats { flex-direction: column; gap: 20px; }
    .carousel-slide { width: 120px; }
    .brands-carousel-wrapper { padding: 0 10px; }
    .carousel-prev { left: 0; }
    .carousel-next { right: 0; }
    .products-carousel-wrapper { padding: 0 50px; }
    .products-carousel-wrapper::before, .products-carousel-wrapper::after { width: 50px; }
    .products-list { gap: 15px; }
    .product-item { width: calc(100vw - 40px); }
    .contacts-title { font-size: 2.5rem; }
    .social-link img { width: 50px; height: 50px; }

    /* Contacts buttons — две кнопки в ряд, Связаться снизу */
    .contacts-actions { gap: 12px; }
    .action-row { gap: 10px; width: 100%; }
    .contacts-btn {
        flex: 1;
        max-width: none;
        padding: 14px 18px;
        font-size: 0.95rem;
        border-radius: 50px;
    }
    .contacts-actions .btn-large {
        width: 100%;
        max-width: 320px;
        padding: 16px 28px;
        font-size: 1rem;
    }
    .portfolio-hero .portfolio-title { font-size: 2.5rem; }
    .taxonomy-portfolio_category .portfolio-grid { grid-template-columns: 1fr; }
    .work-gallery-grid .gallery-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   8. ПАТЧИ
   ========================================================================== */

/* --- 8.1 Карусель брендов ----------------------------------------------- */

/* Клипируем содержимое по скруглённым углам белого контейнера */
.logos-white-container-ultrathin { overflow: hidden; }

/* Кнопки на белом фоне — нужна рамка, иначе сливаются */
.brands-carousel-wrapper .carousel-btn {
    background: var(--bg-light);
    border: 1px solid var(--border);
}
.brands-carousel-wrapper .carousel-btn:hover {
    background: var(--accent);
    color: var(--secondary);
    border-color: var(--accent);
}

/* Градиент по краям: маскирует частично видимые слайды */
.brands-carousel-wrapper::before,
.brands-carousel-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 70px;
    z-index: 4;
    pointer-events: none;
}
.brands-carousel-wrapper::before {
    left: 50px;
    background: linear-gradient(to right, var(--secondary) 0%, transparent 100%);
}
.brands-carousel-wrapper::after {
    right: 50px;
    background: linear-gradient(to left, var(--secondary) 0%, transparent 100%);
}

/* Активный слайд бренда (при выборе в archive-portfolio) */
.carousel-slide.active { opacity: 1; }

/* --- 8.2 Карточка товара ------------------------------------------------- */

/* Ссылка-обёртка заполняет всё пространство карточки над кнопкой */
.product-item > a {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    color: inherit;
    text-decoration: none;
}

/* --- 8.3 Brands секция: фото-фон ---------------------------------------- */

.brands-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}
.brands-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.brands-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 2;
}
.brands-showcase-section .container { position: relative; z-index: 5; }
.brands-showcase-section .logos-white-container-ultrathin { position: relative; z-index: 6; }

/* --- 8.4 Brands carousel: glass pill, white logos, mask fade, center scale */

/* Карусель внутри единого блока */
.brands-unified-block .logos-white-container-ultrathin {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 52px 0 40px;
    overflow: visible;
    position: relative;
}
/* Плавный градиент-переход вместо резкой линии */
.brands-unified-block .logos-white-container-ultrathin::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.28), transparent);
    pointer-events: none;
    z-index: 0;
    border-radius: 0 0 4px 4px;
}

/* Больше места по бокам для увеличенных слайдов */
.brands-showcase-section .brands-carousel-wrapper { padding: 0 60px; }

/* Кнопки карусели на тёмном фоне */
.brands-showcase-section .carousel-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: none;
}
.brands-showcase-section .carousel-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--secondary);
}

/* Убираем старые псевдоэлементы-градиенты (заменены mask) */
.brands-showcase-section .brands-carousel-wrapper::before,
.brands-showcase-section .brands-carousel-wrapper::after { display: none; }

/* Плавное размывание краёв через CSS mask */
.brands-showcase-section .brands-carousel {
    -webkit-mask-image: linear-gradient(to right,
        transparent 0%, black 14%, black 86%, transparent 100%);
    mask-image: linear-gradient(to right,
        transparent 0%, black 14%, black 86%, transparent 100%);
}
/* Даём высоту для scale(1.1) без клиппинга */
.brands-showcase-section .carousel-viewport { overflow: hidden; padding: 18px 0; margin: -18px 0; }

/* Слайд: элегантные пропорции */
.brands-showcase-section .carousel-slide {
    width: 200px;
    height: 100px;
    overflow: visible;
    opacity: 0.55;
    transition: transform 0.45s cubic-bezier(0.25,0.46,0.45,0.94),
                opacity  0.45s ease;
}
.brands-showcase-section .carousel-slide:not(.is-center):hover { opacity: 0.88; }

/* Центральный слайд: +10%, всегда виден */
.brands-showcase-section .carousel-slide.is-center,
.brands-showcase-section .carousel-slide.is-center:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* ФИКС: .brand-logo без явных размеров → % max-height у img игнорировался браузером,
   из-за чего логотипы рендерились в исходном пиксельном размере (разный у всех) */
.brands-showcase-section .brand-logo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Логотипы: белые + тонкое свечение */
.brands-showcase-section .brand-logo img {
    width: auto;
    height: auto;
    max-width: 78%;
    max-height: 72%;
    object-fit: contain;
    filter: brightness(0) invert(1)
            drop-shadow(0 0 5px rgba(255,255,255,0.2));
    transition: filter 0.4s ease;
}
.brands-showcase-section .carousel-slide.is-center .brand-logo img {
    filter: brightness(0) invert(1)
            drop-shadow(0 0 14px rgba(255,255,255,0.6));
}
.brands-showcase-section .carousel-slide:hover .brand-logo img {
    filter: brightness(0) invert(1)
            drop-shadow(0 0 10px rgba(255,255,255,0.4));
}

/* "Натуральный" логотип (непрозрачный фон, например залитый круг бейджа) —
   фильтр инверсии не применяется, иначе вся заливка схлопывается в белое пятно.
   Включается чекбоксом в админке: Портфолио → Бренды → Белый логотип */
.brands-showcase-section .carousel-slide.logo-natural .brand-logo {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.4), 0 4px 16px rgba(0,0,0,0.25);
}
.brands-showcase-section .carousel-slide.logo-natural .brand-logo img,
.brands-showcase-section .carousel-slide.logo-natural:hover .brand-logo img,
.brands-showcase-section .carousel-slide.logo-natural.is-center .brand-logo img {
    max-width: 64%;
    max-height: 64%;
    filter: none;
}

/* ФИКС: логотипы брендов ВСЕГДА белые силуэты в любом состоянии.
   Без этого на тач-устройствах залипает :hover и логотип чернеет при свайпе. */
.brands-showcase-section .carousel-slide:not(.logo-natural) .brand-logo img,
.brands-showcase-section .carousel-slide:not(.logo-natural):hover .brand-logo img,
.brands-showcase-section .carousel-slide:not(.logo-natural).is-center .brand-logo img,
.brands-showcase-section .carousel-slide:not(.logo-natural).active-brand .brand-logo img {
    filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(255,255,255,0.4));
    transition: opacity 0.3s ease;
}

/* --- 8.5 Brands: расширенный блок + попап о бренде ---------------------- */

/* Расширяем контейнер брендов */
.brands-showcase-section > .container { max-width: 1480px; }
.brands-showcase-section .logos-white-container-ultrathin {
    max-width: 100%;
    margin: 0;
}

/* Активный (выбранный) слайд */
.brands-showcase-section .carousel-slide.active-brand .brand-logo img {
    filter: brightness(0) invert(1) drop-shadow(0 0 18px rgba(255,255,255,0.8));
}

/* ── Единый блок брендов: обложка + карусель ─────────── */
.brands-unified-block {
    position: relative;
    height: 600px;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(28,28,32,0.9);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 8px 40px rgba(0,0,0,0.4);
}

/* Обложка бренда — полный фон блока */
.brand-info {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    max-height: none !important;
    overflow: visible !important;
    transform: none !important;
}
.brand-info.is-visible {
    opacity: 1;
    max-height: none !important;
}

.brand-info-card {
    position: absolute;
    inset: 0;
    height: auto;
    aspect-ratio: unset;
    max-width: 100%;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow: hidden;
}

/* Фото бренда — заполняет весь блок */
.brand-info-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.brand-info-image img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center center;
}

/* Градиент: темнее снизу (над каруселью) и сверху */
.brand-info-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top,  rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.3) 45%, transparent 70%),
        linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 30%);
    z-index: 1;
    pointer-events: none;
}

/* Название бренда — по центру над каруселью */
.brand-info-text {
    position: absolute;
    left: 0; right: 0;
    bottom: 160px;
    text-align: center;
    z-index: 3;
    padding: 0 24px;
}
.brand-info-name {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0;
    text-shadow: 0 2px 20px rgba(0,0,0,0.7);
}
.brand-info-desc { display: none; }

/* Карусель — закреплена внизу, без blur чтобы не размывать текст бренда */
.brands-unified-block .logos-white-container-ultrathin {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.2) 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 18px 0 22px;
    overflow: visible;
    z-index: 2;
}

/* Стрелки — позиционируем относительно всего блока (а не узкой полосы),
   по центру по вертикали и с отступом от краёв. */
.brands-unified-block .brands-carousel-wrapper { position: static; }
.brands-unified-block .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 42px;
    height: 42px;
    background: rgba(20,20,24,0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.brands-unified-block .carousel-btn:hover { background: rgba(0,122,255,0.9); border-color: transparent; }
.brands-unified-block .carousel-prev { left: 16px; }
.brands-unified-block .carousel-next { right: 16px; }
/* убираем боковые градиенты-маски — они были рассчитаны на белый фон */
.brands-unified-block .brands-carousel-wrapper::before,
.brands-unified-block .brands-carousel-wrapper::after { display: none; }

/* --- 8.6 Portfolio (главная): Liquid Glass редизайн --------------------- */

.portfolio-section {
    position: relative;
    overflow: hidden;
    background: #111114; /* fallback пока фото не загружено */
}
.portfolio-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}
.portfolio-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.portfolio-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.62);
    z-index: 2;
    pointer-events: none;
}
.portfolio-section .container { position: relative; z-index: 5; }

/* Текст секции — светлый, читается на фото */
.portfolio-section .section-title { color: var(--text-on-dark); }
.portfolio-section .section-subtitle { color: rgba(255, 255, 255, 0.72); }

/* Кнопка "Смотреть все работы" — стеклянная, видна на фото */
.portfolio-section .section-footer-actions .btn-secondary {
    color: var(--text-on-dark);
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.portfolio-section .section-footer-actions .btn-secondary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--secondary);
}

/* Home portfolio cards: image-only surface */
/* Selector scoped к .portfolio-section — taxonomy/archive страницы,
   использующие тот же шаблон, остаются нетронутыми. */
.portfolio-section .portfolio-item {
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    isolation: isolate;
    transition: opacity 0.25s ease;
}

.portfolio-section .portfolio-item a {
    display: block;
    position: relative;
    height: 100%;
    color: inherit;
}

/* Фото — единственная поверхность карточки. */
.portfolio-section .item-image {
    border-radius: inherit;
    overflow: hidden;
    background: #111114;
}

/* Название лежит на нижней части изображения и остаётся читаемым. */
.portfolio-section .item-content {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    min-height: 42%;
    padding: 72px 18px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.42) 54%, transparent 100%);
}

/* Заголовок — по центру снизу, без отдельной плашки. */
.portfolio-section .item-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    color: #fff;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.72);
}

/* Hover увеличивает только изображение: без подъёма и стеклянной рамки. */
.portfolio-section .portfolio-item:hover {
    transform: none;
    box-shadow: none;
}

/* Тактильный отклик без смещения макета. */
.portfolio-section .portfolio-item:active {
    opacity: 0.9;
}

/* Плавный зум фото внутри карточки */
.portfolio-section .portfolio-item .item-image img {
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@media (hover: hover) and (pointer: fine) {
    .portfolio-section .portfolio-item:hover .item-image img {
        transform: scale(1.035);
    }
}

@media (max-width: 768px) {
    .portfolio-section .item-content {
        min-height: 46%;
        padding: 58px 14px 14px;
    }

    .portfolio-section .item-title {
        font-size: 1rem;
    }
}

/* --- Карусель работ: 2 ряда со смещением (стиль Apple TV) --- */
.pf-carousel {
    --pf-card-w: 320px;
    --pf-gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 -20px;
    padding: 10px 20px 24px;
    cursor: grab;
    /* Плавное затухание карточек по краям — без жёсткой обрезки */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.pf-carousel::-webkit-scrollbar { display: none; }
.pf-carousel.dragging { cursor: grabbing; scroll-snap-type: none; }
.pf-carousel.dragging a { pointer-events: none; }

.pf-rows {
    display: inline-flex;
    flex-direction: column;
    gap: var(--pf-gap);
}
.pf-row {
    display: flex;
    gap: var(--pf-gap);
}
/* Перекос: нижний ряд сдвинут на пол-карточки */
.pf-row--offset {
    margin-left: calc(var(--pf-card-w) / 2 + var(--pf-gap) / 2);
}

.pf-carousel .portfolio-item {
    width: var(--pf-card-w);
    flex-shrink: 0;
    scroll-snap-align: start;
}

.pf-pagination { display: flex; justify-content: center; flex-wrap: wrap; margin: 8px auto 0; }
.pf-pagination[hidden] { display: none; }
.pf-dot { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: manipulation; }
.pf-dot span { width: 7px; height: 7px; border-radius: 50px; background: #77777e; transition: width 200ms ease, background 200ms ease; }
.pf-dot[aria-pressed="true"] span { width: 26px; background: #f5f5f7; }
.pf-dot:focus-visible { outline: 2px solid #f5f5f7; outline-offset: -4px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) {
    .pf-dot span { transition: none; }
}

@media (max-width: 768px) {
    .pf-carousel { --pf-card-w: 70vw; --pf-gap: 14px; margin: 0 -16px; padding: 8px 16px 20px; }
}

/* --- 8.7 Глобальный мягкий блюр фоновых фото ----------------------------
   scale(1.08) компенсирует "усадку" видимой области от blur — без него
   по краям появляется резкая необработанная кайма (blur размывает наружу,
   за пределы контейнера, оставляя кромку исходной чёткости внутри). */

.hero-bg img,
.hero-bg video,
.about-section .about-bg img,
.brands-bg img,
.contacts-bg img,
.portfolio-bg img,
.shop-bg img {
    filter: blur(6px);
    transform: scale(1.08);
}

/* --- 8.8 Плавные переходы между секциями (виньетка сверху/снизу) -------
   Каждый фотофон вместо плоского затемнения получает градиент:
   у верхнего и нижнего края — почти чёрный (как соседняя секция),
   в середине — обычная читаемость текста. Стык между секциями исчезает,
   т.к. оба края теперь сходятся в одинаковый чёрный, а не обрываются
   жёсткой границей разных фото. Правила объявлены позже в каскаде —
   при равной специфичности перекрывают исходные плоские rgba(). */

.hero-bg::after {
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.85) 0%,
        rgba(0,0,0,0.5) 15%,
        rgba(0,0,0,0.5) 85%,
        rgba(0,0,0,0.9) 100%);
}

.about-section::before {
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.95) 0%,
        rgba(0,0,0,0.7) 15%,
        rgba(0,0,0,0.7) 80%,
        rgba(0,0,0,0.9) 93%,
        #000 100%);
}

.brands-overlay {
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.92) 0%,
        rgba(0,0,0,0.65) 15%,
        rgba(0,0,0,0.65) 85%,
        rgba(0,0,0,0.92) 100%);
}

.portfolio-overlay {
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.9) 0%,
        rgba(0,0,0,0.62) 15%,
        rgba(0,0,0,0.62) 85%,
        rgba(0,0,0,0.9) 100%);
}

.contacts-overlay {
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.95) 0%,
        rgba(0,0,0,0.7) 15%,
        rgba(0,0,0,0.7) 85%,
        rgba(0,0,0,0.95) 100%);
}

/* --- 8.9 Shop (Магазин): Liquid Glass редизайн --------------------------- */

.shop-section {
    position: relative;
    overflow: hidden;
    background: #111114; /* fallback пока фото не загружено */
}
.shop-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}
.shop-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.shop-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
    /* Плавно раскрываем фото после почти чёрного края карусели брендов. */
    background: linear-gradient(to bottom,
        #000 0%,
        rgba(0,0,0,0.98) 7%,
        rgba(0,0,0,0.82) 18%,
        rgba(0,0,0,0.62) 30%,
        rgba(0,0,0,0.62) 85%,
        rgba(0,0,0,0.9) 100%);
}
.shop-section .container { position: relative; z-index: 5; max-width: 1480px; }

.shop-section .section-title { color: var(--text-on-dark); }
.shop-section .section-subtitle { color: rgba(255, 255, 255, 0.72); }

/* Стеклянная подложка под карусель — тот же рецепт, что у плашки брендов,
   НО без overflow:hidden: карточки увеличиваются на hover (translateY+scale),
   обрезка по краям тут не нужна, в отличие от плашки логотипов. */
.shop-section .shop-glass-tray {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08),
                0 4px 30px rgba(0,0,0,0.25);
    border-radius: var(--border-radius);
    padding: 50px 0 60px;
}

/* Карусель — почти во всю ширину контейнера, узкие отступы под кнопки */
.shop-section .products-carousel-wrapper { padding: 0 50px; }

/* Старый плоский градиент-затемнение под var(--bg-light) больше не подходит
   фото-фону — заменяем на mask-fade (та же техника, что у карусели брендов),
   он плавно гасит карточки по краям независимо от того, что под ними */
.shop-section .products-carousel-wrapper::before,
.shop-section .products-carousel-wrapper::after { display: none; }
.shop-section .products-list {
    /* Запас для теней: overflow-x:scroll клипает box-shadow за пределами padding.
       Отрицательные margin компенсируют сдвиг, не ломая layout. */
    padding-top: 32px;
    margin-top: -32px;
    padding-bottom: 64px;
    margin-bottom: -64px;
    /* Горизонтальный запас — чтобы тени первой/последней карточки не срезались */
    padding-left: 32px;
    padding-right: 32px;
    /* Плавное затухание карточек по краям — мягкий переход вместо жёсткой обрезки */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
}

/* Кнопки навигации — стеклянные, как в карусели брендов */
.shop-section .shop-carousel-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: none;
}
.shop-section .shop-carousel-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--secondary);
}

/* Карточка товара: та же стеклянная плитка, что и у портфолио */
.shop-section .product-item {
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1),
                0 8px 30px rgba(0,0,0,0.35);
    transition: transform 0.55s cubic-bezier(0.25,0.46,0.45,0.94),
                box-shadow 0.55s cubic-bezier(0.25,0.46,0.45,0.94),
                border-color 0.55s ease,
                background 0.55s ease;
}
.shop-section .product-item:hover {
    transform: translateY(-6px) scale(1.015);
    background: rgba(0, 0, 0, 0.48);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14),
                0 16px 45px rgba(0,0,0,0.45);
}
.shop-section .product-item:active {
    transform: translateY(-2px) scale(0.98);
    transition-duration: 0.18s;
}

.shop-section .product-image { background: rgba(255, 255, 255, 0.04); }
.shop-section .product-image img {
    transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
}
.shop-section .product-item:hover .product-image img {
    transform: scale(1.06);
}

.shop-section .product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #007aff;
    background: rgba(18, 20, 24, 0.74);
    border: 1px solid rgba(0, 122, 255, 0.28);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.68rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.shop-section .product-title { color: var(--text-on-dark); }

/* Кнопка "Купить" — стеклянная вместо сплошной чёрной */
.shop-section .buy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--text-on-dark);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.shop-section .buy-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--secondary);
}


/* ==========================================================================
   10. SHOP: iOS 26 Liquid Glass — Product Cards (App Store style)
   ========================================================================== */

/* Выравниваем карточки по высоте */
.shop-section .products-list { align-items: stretch; }

/* --- 10.1 Карточка-контейнер --- */
.product-card {
    flex-shrink: 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(18, 18, 24, 0.55);
    border: 1px solid rgba(255,255,255,0.13);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.18),
        0 8px 32px rgba(0,0,0,0.45);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    transition:
        transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94),
        box-shadow 0.5s cubic-bezier(0.25,0.46,0.45,0.94),
        border-color 0.4s ease;
    position: relative;
}

/* Specular highlight — верхний край "ловит свет" */
.product-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(to right,
        transparent 0%,
        rgba(255,255,255,0.6) 50%,
        transparent 100%);
    z-index: 10;
    pointer-events: none;
    border-radius: 50%;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255,255,255,0.22);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.28),
        0 24px 64px rgba(0,0,0,0.55);
}
.product-card:active {
    transform: translateY(-3px) scale(0.99);
    transition-duration: 0.15s;
}

/* --- 10.2 Область изображения (portrait ~1:1.08) --- */
.product-card-visual {
    display: block;
    position: relative;
    padding-bottom: 108%;
    overflow: hidden;
    text-decoration: none;
    flex-shrink: 0;
}

.product-card-visual img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.65s cubic-bezier(0.25,0.46,0.45,0.94);
}
.product-card:hover .product-card-visual img { transform: scale(1.07); }

/* Градиент снизу для читаемости */
.product-card-visual::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* --- 10.3 Placeholder (нет фото) --- */
.product-card-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(145deg,
        rgba(30,30,40,1) 0%,
        rgba(14,14,20,1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 10.4 Бейдж категории --- */
.product-card-badge {
    position: absolute;
    top: 14px; left: 14px;
    z-index: 3;
    background: rgba(0,0,0,0.52);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 50px;
}

/* --- 10.5 Стеклянная нижняя панель (column: кнопка → цена) --- */
.product-card-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 18px;
    background: rgba(255,255,255,0.055);
    border-top: 1px solid rgba(255,255,255,0.09);
    flex-shrink: 0;
}

.product-card-price {
    color: rgba(255,255,255,0.45);
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
    display: block;
}

/* --- 10.6 Кнопка "Купить" — полная ширина, по центру --- */
.product-card-buy {
    width: 100%;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 11px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.25,0.46,0.45,0.94);
}
.product-card-buy:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,122,255,0.45);
}
.product-card-buy:active {
    transform: scale(0.97);
    transition-duration: 0.12s;
}


/* ============================================================
   МАГАЗИН — Архив (archive-product.php)
   ============================================================ */

.shop-page {
    position: relative;
    min-height: 100vh;
    background: #111114;
}
.shop-page::before {
    content: '';
    position: absolute;
    inset: -6%;
    background: var(--shop-bg, none) center top / cover no-repeat;
    filter: blur(40px) brightness(0.2);
    z-index: 0;
    pointer-events: none;
}
.shop-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.62);
    z-index: 1;
    pointer-events: none;
}
.shop-hero {
    position: relative;
    z-index: 2;
    padding-top: calc(var(--header-height) + 28px);
    padding-bottom: 36px;
}
.shop-hero-title {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.04em;
    margin: 0 0 10px;
}
.shop-hero-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.45);
    margin: 0;
}
.shop-grid-section {
    position: relative;
    z-index: 2;
    padding-bottom: 100px;
}

.shop-grid-section .container {
    position: relative;
    z-index: 5;
    max-width: 1480px;
}
.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 960px) { .shop-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    /* На узкой карточке прячем "Подробнее →" — карточка и так кликабельна,
       чтобы цена не наезжала на текст */
    .shop-card-detail { display: none; }
    .shop-card-body { padding: 12px 13px 12px; }
    .shop-card-title { font-size: 0.95rem; margin-bottom: 4px; }
    .shop-card-desc { display: none; }
    .shop-card-price { font-size: 1.05rem; }
    .shop-card-btn { padding: 11px; font-size: 0.82rem; }
}

/* Card */
.shop-card {
    /* Переопределяем стили .product-item для сетки магазина */
    width: auto;
    flex-shrink: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    transition: transform 0.35s cubic-bezier(0.34,1.4,0.64,1), box-shadow 0.3s ease;
}
.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 64px rgba(0,0,0,0.65);
}
.shop-card-link {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
    width: 100%;
}
.shop-card-media {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #1a1a1d;
}
.shop-card-img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; transition: transform 0.5s ease; }
.shop-card:hover .shop-card-img { transform: scale(1.05); }
.shop-card-noimg { width: 100%; height: 100%; background: linear-gradient(135deg,#1a1a2e,#16213e); }
.shop-card-type {
    position: absolute;
    top: 12px; right: 12px;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #007aff;
    background: rgba(28,30,32,0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid rgba(0,122,255,0.24);
}
@media (max-width: 960px) {
    .shop-section .product-badge,
    .shop-card-type {
        top: 8px;
        right: 8px;
        font-size: 0.54rem;
        letter-spacing: 0.07em;
        padding: 2px 7px;
    }
}
@media (max-width: 560px) {
    .shop-section .product-badge,
    .shop-card-type {
        top: 6px;
        right: 6px;
        font-size: 0.48rem;
        letter-spacing: 0.05em;
        padding: 2px 6px;
    }
}

/* Badge для типа товара */
.shop-card-badge {
    position: absolute;
    top: 12px; right: 12px;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    background: rgba(0,122,255,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2);
}
.shop-card-badge {
    position: absolute;
    top: 12px; right: 12px;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    background: rgba(0,122,255,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2);
}
.shop-card-body { padding: 16px 18px 14px; }
.shop-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.3;
}
.shop-card-desc {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.42);
    margin: 0 0 14px;
    line-height: 1.55;
}
.shop-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.shop-card-detail { white-space: nowrap; flex-shrink: 0; }
.shop-card-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}
.shop-card-detail {
    font-size: 0.76rem;
    color: rgba(255,255,255,0.35);
}
.shop-card-btn {
    width: 100%;
    padding: 13px;
    background: rgba(0,122,255,0.85);
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
.shop-card-btn:hover { background: #0056d6; }
.shop-empty { color: rgba(255,255,255,0.35); text-align: center; padding: 120px 0; font-size: 1.1rem; }
.shop-legal-details {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 32px auto 0;
    color: rgba(255,255,255,0.38);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}
@media (max-width: 560px) {
    .shop-legal-details { margin-top: 24px; font-size: 0.7rem; }
}
.shop-footer-logo {
    position: relative; z-index: 2;
    text-align: center;
    padding: 48px 0 60px;
}
.shop-logo-link {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-family: inherit;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.shop-logo-link:hover { color: #fff; opacity: 0.7; }

/* ── Global site footer ─────────────────────────── */
.site-footer {
    position: relative;
    text-align: center;
    padding: 52px 20px 44px;
    background: rgba(255,255,255,0.03);
    border-top: 1px solid rgba(255,255,255,0.07);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.site-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18) 30%, rgba(255,255,255,0.18) 70%, transparent);
    pointer-events: none;
}
.site-footer-logo {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
    margin-bottom: 12px;
    transition: opacity 0.2s ease;
}
.site-footer-logo:hover { opacity: 0.6; }
.site-footer-copy {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.04em;
    margin: 0;
}

/* ============================================================
   МАГАЗИН — Карточка товара (single-product.php)
   ============================================================ */

.spr-page {
    position: relative;
    min-height: 100vh;
    background: #111114;
}
.spr-page::before {
    content: '';
    position: absolute;
    inset: -6%;
    background: var(--spr-bg, none) center top / cover no-repeat;
    filter: blur(40px) brightness(0.22);
    z-index: 0;
    pointer-events: none;
}
.spr-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.58);
    z-index: 1;
    pointer-events: none;
}
.spr-main {
    position: relative;
    z-index: 2;
    padding-top: calc(var(--header-height) + 28px);
    padding-bottom: 60px;
}
.spr-back { margin-bottom: 28px; }

.spr-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}
@media (max-width: 880px) {
    .spr-layout { grid-template-columns: 1fr; }
    .spr-cover { max-width: 440px; }
}

/* Cover */
.spr-cover {
    border-radius: 22px;
    overflow: hidden;
    background: #1a1a1d;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}
.spr-cover-img { width: 100%; display: block; object-fit: cover; aspect-ratio: 1; }
.spr-cover-placeholder { aspect-ratio: 1; background: linear-gradient(135deg,#1a1a2e,#16213e); }

/* Info card */
.spr-info-card {
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 16px 64px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}
.spr-type-badge {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: rgba(0,122,255,0.14);
    border: 1px solid rgba(0,122,255,0.3);
    border-radius: 50px;
    padding: 3px 12px;
    margin-bottom: 14px;
}
.spr-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 14px;
}
.spr-price {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}
.spr-info-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.spr-desc-foot {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.42);
    line-height: 1.65;
    padding: 0 6px;
}
.spr-desc-foot p { margin-bottom: 8px; }
.spr-desc-foot p:last-child { margin-bottom: 0; }
.spr-desc-foot ul,
.spr-desc-foot ol {
    margin: 0 0 8px;
    padding-left: 1.2em;
}
.spr-desc-foot li { margin-bottom: 4px; }
.spr-desc-foot a {
    color: rgba(255,255,255,0.55);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.spr-desc-foot a:hover { color: rgba(255,255,255,0.75); }
.spr-buy-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--accent);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0,122,255,0.4);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.spr-buy-btn:hover {
    background: #0056d6;
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0,122,255,0.5);
}
.spr-buy-btn:active { transform: scale(0.98); }
.spr-quick-buy { margin-bottom: 12px; text-decoration: none; text-align: center; }
.spr-quick-buy:hover { color: #fff; }
.spr-buy-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
/* Cart is 20% darker than the primary quick-purchase action. */
.spr-buy-btn.add-to-cart {
    background: #0062cc;
    box-shadow: 0 8px 24px rgba(0,98,204,0.32);
}
.spr-buy-btn.add-to-cart:hover {
    background: #0045ab;
    box-shadow: 0 14px 36px rgba(0,98,204,0.4);
}

/* Preview sections */
.spr-previews {
    position: relative;
    z-index: 2;
    padding-bottom: 60px;
}
.spr-previews-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    margin: 0 0 18px;
    letter-spacing: -0.01em;
}

/* ===== LUT before/after comparison slider ===== */
.spr-lut-hint {
    margin: -8px 0 20px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
}
.lut-compare {
    position: relative;
    width: 100%;
    max-width: 880px;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    background: #000;
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.lut-img {
    position: absolute;
    inset: 0;
    display: block;
    line-height: 0;
}
.lut-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}
.lut-before { z-index: 1; }
.lut-after {
    overflow: hidden;
    clip-path: inset(0 calc(100% - var(--lut-pos, 50%)) 0 0);
    -webkit-clip-path: inset(0 calc(100% - var(--lut-pos, 50%)) 0 0);
    z-index: 2;
}
.lut-after img {
    transition: opacity 0.25s ease;
}

.lut-tag {
    position: absolute;
    top: 14px;
    padding: 5px 13px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #fff;
    border-radius: 100px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    pointer-events: none;
    z-index: 4;
}
.lut-tag-after  { left: 14px; background: rgba(0,122,255,0.55); border-color: rgba(255,255,255,0.25); }
.lut-tag-before { right: 14px; }

.lut-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--lut-pos, 50%);
    width: 2px;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.92);
    box-shadow: 0 0 14px rgba(0,0,0,0.45);
    pointer-events: none;
    z-index: 5;
}
.lut-handle-grip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255,255,255,0.92);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.15s ease, background 0.15s ease;
}
.lut-compare.is-dragging .lut-handle-grip { transform: translate(-50%,-50%) scale(1.08); background: rgba(255,255,255,0.28); }

.lut-variations {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 22px auto 0;
    max-width: 880px;
}
.lut-var-btn {
    padding: 9px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.lut-var-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.lut-var-btn:active { transform: scale(0.96); }
.lut-var-btn.is-active {
    color: #fff;
    background: rgba(0,122,255,0.85);
    border-color: rgba(0,122,255,0.9);
    box-shadow: 0 6px 18px rgba(0,122,255,0.3);
}

@media (max-width: 560px) {
    .lut-compare { border-radius: 18px; }
    .lut-handle-grip { width: 40px; height: 40px; }
    .lut-var-btn { padding: 8px 15px; font-size: 0.85rem; }
    .lut-tag { font-size: 11px; padding: 4px 10px; top: 10px; }
    .lut-tag-after  { left: 10px; }
    .lut-tag-before { right: 10px; }
}

/* Audio players */
.spr-players { display: flex; flex-direction: column; gap: 10px; }
.spr-player {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    transition: background 0.2s, border-color 0.2s;
}
.spr-player.is-playing {
    background: rgba(0,122,255,0.12);
    border-color: rgba(0,122,255,0.35);
}
.spr-play-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: none;
    background: rgba(0,122,255,0.8);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0,122,255,0.4);
    transition: background 0.2s, transform 0.2s;
}
.spr-play-btn:hover { background: var(--accent); transform: scale(1.08); }
.spr-track-info { flex: 1; min-width: 0; }
.spr-track-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin-bottom: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spr-progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}
.spr-progress-fill {
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.1s linear;
}
.spr-duration {
    font-size: 0.76rem;
    color: rgba(255,255,255,0.38);
    font-variant-numeric: tabular-nums;
    min-width: 34px;
    text-align: right;
    flex-shrink: 0;
}

/* Image previews */
.spr-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.spr-preview-img-btn {
    border: none;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/9;
    display: block;
    transition: transform 0.3s cubic-bezier(0.34,1.4,0.64,1), box-shadow 0.3s ease;
}
.spr-preview-img-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 16px 48px rgba(0,0,0,0.65);
}
.spr-preview-img-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spr-preview-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    background: #000;
}

/* ═══════════════════════════════════════════
   COURSE PAGE — iOS 26 Liquid Glass
   ═══════════════════════════════════════════ */

.course-page {
    position: relative;
    min-height: 100vh;
    background: #0e0e11;
    margin-top: calc(-1 * var(--header-height));
}
.course-page::before {
    content: '';
    position: absolute;
    inset: -6%;
    background: var(--course-bg, none) center top / cover no-repeat;
    filter: blur(60px) brightness(0.18);
    z-index: 0;
    pointer-events: none;
}
.course-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1;
    pointer-events: none;
}
.course-page > section { position: relative; z-index: 2; }

/* ── Hero ── */
.course-hero {
    padding-top: calc(2 * var(--header-height) + 40px);
    padding-bottom: 80px;
}
.course-hero-inner { max-width: 700px; }
.course-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-bottom: 20px;
}
.course-hero-title {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.04em;
    line-height: 1.02;
    margin: 0 0 24px;
}
.course-hero-sub {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.7;
    max-width: 560px;
}

/* ── About ── */
.course-about { padding: 0 0 80px; }
.course-about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}
.course-about-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 24px;
    padding: 36px;
}
.course-about-text {
    font-size: 0.97rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.75;
    margin: 0 0 18px;
}
.course-about-text:last-child { margin-bottom: 0; }

.course-quote-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 24px;
    padding: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.course-quote-icon { color: #fff; margin-bottom: 20px; }
.course-quote-text {
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin: 0 0 16px;
    font-style: normal;
}
.course-quote-cite {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.03em;
    font-style: normal;
}

/* ── Program ── */
.course-program { padding: 0 0 80px; }

/* ── Portfolio preview on course page ── */
.course-portfolio { padding: 0 0 80px; }
.course-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.course-pf-card {
    position: relative;
    display: block;
    aspect-ratio: 3/4;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    background: #1a1a1d;
}
.course-pf-img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.course-pf-card:hover .course-pf-img { transform: scale(1.05); }
.course-pf-noimg { position: absolute; inset: 0; background: #1a1a1d; }
.course-pf-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 80%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 20px 22px;
    transition: background 0.3s ease;
}
.course-pf-card:hover .course-pf-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.3) 55%, transparent 80%);
}
.course-pf-brand {
    width: auto; height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.75;
    align-self: flex-start;
}
.course-pf-meta { margin-top: auto; }
.course-pf-cat {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 5px;
}
.course-pf-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}
@media (max-width: 640px) {
    .course-portfolio-grid { grid-template-columns: 1fr; }
    .course-pf-card { aspect-ratio: 4/3; }
}

.course-section-header { margin-bottom: 40px; }
.course-section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    margin: 0 0 8px;
}
.course-section-sub {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.38);
}

.course-steps { display: flex; flex-direction: column; gap: 16px; }

.course-step {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 24px;
    align-items: start;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 20px;
    padding: 28px 32px;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.course-step:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}
.course-step-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: rgba(255,255,255,0.12);
    letter-spacing: -0.04em;
    line-height: 1;
    padding-top: 4px;
}
.course-step-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.course-step-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0;
}
.course-step-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(0,122,255,0.12);
    border: 1px solid rgba(0,122,255,0.25);
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
}
.course-step-desc {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.65;
    margin: 0;
}

/* ── Bonuses ── */
.course-bonuses { padding: 0 0 80px; }
.course-bonus-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.course-bonus-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 20px;
    padding: 24px 28px;
    transition: background 0.2s ease;
}
.course-bonus-card:hover { background: rgba(255,255,255,0.08); }
.course-bonus-card--wide { grid-column: span 2; }
.course-bonus-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(0,122,255,0.12);
    border: 1px solid rgba(0,122,255,0.2);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
}
.course-bonus-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 5px;
    letter-spacing: -0.01em;
}
.course-bonus-desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.55;
    margin: 0;
}

/* ── CTA ── */
.course-cta { padding: 0 0 100px; }
.course-cta-inner {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}
.course-cta-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 16px;
}
.course-cta-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.04em;
    line-height: 1.06;
    margin: 0 0 16px;
}
.course-cta-sub {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.65;
    margin: 0 0 40px;
}
.course-cta-btns {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.course-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.course-pill-btn:hover { transform: scale(1.04); }
.course-pill-btn--primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 28px rgba(0,122,255,0.45);
}
.course-pill-btn--primary:hover {
    background: #0066e0;
    box-shadow: 0 12px 36px rgba(0,122,255,0.6);
}
.course-pill-btn--glass {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.9);
    box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}
.course-pill-btn--glass:hover {
    background: rgba(255,255,255,0.16);
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .course-about-grid { grid-template-columns: 1fr; }
    .course-bonus-grid { grid-template-columns: 1fr; }
    .course-bonus-card--wide { grid-column: span 1; }
    .course-step { grid-template-columns: 48px 1fr; gap: 16px; padding: 22px 20px; }
}

/* ============================================================
   CONTACTS PAGE
   ============================================================ */

.contacts-page {
    position: relative;
    min-height: 100vh;
    background: #0e0e11;
    margin-top: calc(-1 * var(--header-height));
}
.contacts-page::before {
    content: '';
    position: absolute;
    inset: -6%;
    background: var(--contacts-bg, none) center top / cover no-repeat;
    filter: blur(60px) brightness(0.15);
    z-index: 0;
    pointer-events: none;
}
.contacts-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.52);
    z-index: 1;
    pointer-events: none;
}
.contacts-page > section {
    position: relative;
    z-index: 2;
}

/* Hero */
.contacts-hero {
    padding-top: calc(2 * var(--header-height) + 48px);
    padding-bottom: 64px;
}
.contacts-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.contacts-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-bottom: 18px;
}
.contacts-hero-title {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin: 0 0 24px;
}
.contacts-hero-sub {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.55);
    max-width: 440px;
    line-height: 1.6;
    margin: 0;
}
.contacts-hero-sub a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

/* Local automotive services */
.contacts-services {
    padding: 8px 0 56px;
}
.contacts-services-intro {
    max-width: none;
    margin-bottom: 28px;
}
.contacts-services-label {
    display: inline-block;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.48);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.contacts-services-title {
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.15rem);
    letter-spacing: -0.04em;
    line-height: 1.04;
    text-wrap: balance;
}
.contacts-services-sub {
    max-width: none;
    margin: 14px 0 0;
    color: rgba(255,255,255,0.68);
    font-size: 1.02rem;
    line-height: 1.65;
    text-wrap: pretty;
}
.contacts-services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.contacts-service-card {
    display: flex;
    min-height: 208px;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.055);
    transition: transform 220ms ease-out, border-color 220ms ease-out, background-color 220ms ease-out;
}
.contacts-service-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0,122,255,0.56);
    background: rgba(0,122,255,0.1);
}
.contacts-service-card-title {
    margin: 0;
    color: #fff;
    font-size: 1.15rem;
    line-height: 1.2;
    text-wrap: balance;
}
.contacts-service-card-text {
    margin: 18px 0 0;
    color: rgba(255,255,255,0.64);
    font-size: 0.94rem;
    line-height: 1.58;
    text-wrap: pretty;
}
/* Social cards */
.contacts-socials {
    padding-bottom: 60px;
}
.contacts-socials-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto;
}
.contacts-social-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    border-radius: 20px;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.contacts-social-card:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.12);
}
.contacts-social-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.contacts-social-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.contacts-social-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.contacts-social-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}
.contacts-social-handle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
}
.contacts-social-arrow {
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}
.contacts-social-card:hover .contacts-social-arrow {
    color: rgba(255,255,255,0.7);
    transform: translate(2px, -2px);
}

/* Platform accent colours (subtle left border) */
.contacts-social-card--telegram { border-left: 2px solid rgba(39,174,255,0.45); }
.contacts-social-card--instagram { border-left: 2px solid rgba(225,48,108,0.45); }
.contacts-social-card--vk { border-left: 2px solid rgba(71,137,216,0.45); }

/* CTA */
.contacts-cta {
    padding-bottom: 100px;
}
.contacts-cta-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    padding: 52px 40px;
    border-radius: 28px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 40px rgba(0,0,0,0.35);
}
.contacts-cta-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    margin: 0 0 12px;
}
.contacts-cta-sub {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.55;
    margin: 0 0 32px;
}
.contacts-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 50px;
    background: var(--accent, #007AFF);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    box-shadow: 0 8px 28px rgba(0,122,255,0.45);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.contacts-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(0,122,255,0.6);
}

/* Responsive */
@media (max-width: 600px) {
    .contacts-services { padding-bottom: 44px; }
    .contacts-services-grid { grid-template-columns: 1fr; }
    .contacts-service-card { min-height: 0; }
    .contacts-cta-inner { padding: 36px 24px; }
    .contacts-social-card { padding: 16px 18px; gap: 14px; }
    .contacts-social-icon { width: 44px; height: 44px; border-radius: 12px; }
    .contacts-social-icon img { width: 24px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .contacts-service-card {
        transition: none;
    }
    .contacts-service-card:hover {
        transform: none;
    }
}


/* ============================================================
   CART PAGE
   ============================================================ */

.cart-page {
    min-height: 100vh;
    background: #0e0e11;
    margin-top: calc(-1 * var(--header-height));
    position: relative;
}

/* Hero */
.cart-hero {
    padding-top: calc(2 * var(--header-height) + 32px);
    padding-bottom: 24px;
}
.cart-hero .container { display: flex; align-items: center; gap: 14px; }
.cart-title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.04em;
    margin: 0;
}
.cart-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    background: rgba(0,122,255,0.18);
    border: 1px solid rgba(0,122,255,0.3);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Body */
.cart-body { padding-bottom: 100px; }

/* Layout: items left, summary right */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

/* Cart items list */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.09);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 4px 20px rgba(0,0,0,0.25);
    transition: background 0.2s ease;
}
.cart-item:hover { background: rgba(255,255,255,0.09); }

.cart-item-thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #1a1a1d;
    display: block;
}
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item-noimg { width: 100%; height: 100%; background: linear-gradient(135deg, #1a1a2e, #16213e); }

.cart-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cart-item-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}
.cart-item-title:hover { color: var(--accent); opacity: 1; }
.cart-item-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
}

.cart-item-remove {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.cart-item-remove:hover {
    background: rgba(255,59,48,0.18);
    border-color: rgba(255,59,48,0.3);
    color: #ff3b30;
}

/* Summary card */
.cart-summary-card {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    padding: 28px 24px;
    border-radius: 24px;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 40px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cart-summary-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
}
.cart-summary-rows { display: flex; flex-direction: column; gap: 8px; }
.cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.cart-summary-name {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.cart-summary-price {
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    flex-shrink: 0;
}
.cart-summary-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 4px 0;
}
.cart-summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cart-summary-total span {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
}
.cart-summary-total strong {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 50px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 28px rgba(0,122,255,0.45);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(0,122,255,0.6);
    color: #fff;
    opacity: 1;
}

.cart-continue-btn {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.35);
    text-decoration: none;
    transition: color 0.2s;
}
.cart-continue-btn:hover { color: rgba(255,255,255,0.65); opacity: 1; }

/* Empty state */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px 20px;
}
.cart-empty-icon {
    width: 96px;
    height: 96px;
    border-radius: 28px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.25);
    margin-bottom: 24px;
}
.cart-empty-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    margin: 0 0 10px;
}
.cart-empty-sub {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.4);
    margin: 0 0 32px;
    max-width: 280px;
}
.cart-shop-btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    border-radius: 50px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}
.cart-shop-btn:hover { background: rgba(255,255,255,0.17); opacity: 1; color: #fff; }

/* Mobile */
@media (max-width: 768px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
    .cart-summary-card { position: static; }
}
@media (max-width: 500px) {
    .cart-item-thumb { width: 64px; height: 64px; }
    .cart-hero { padding-top: calc(2 * var(--header-height) + 16px); }
}


/* ============================================================
   CHECKOUT + PROFILE (базовое тёмное оформление)
   ============================================================ */

.checkout-page,
.profile-page {
    min-height: 100vh;
    background: #0e0e11;
    color: #fff;
    padding: calc(2 * var(--header-height) + 24px) 20px 80px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}
.checkout-page > h1,
.profile-page > h1 {
    color: #fff;
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
}
.checkout-page h2, .checkout-page h3,
.profile-page h2, .profile-page h3 { color: #fff; }
.checkout-page a, .profile-page a { color: var(--accent); }

/* Checkout layout */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 24px;
    align-items: start;
}
.order-summary,
.checkout-form,
.profile-sidebar,
.profile-content {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 24px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 4px 24px rgba(0,0,0,0.3);
}
.order-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
}
.order-total { padding-top: 14px; font-size: 1.2rem; }

.checkout-notice,
.checkout-empty {
    max-width: 680px;
    margin: 0 0 20px;
    padding: 13px 16px;
    border: 1px solid rgba(255, 115, 115, 0.38);
    border-radius: 8px;
    background: rgba(185, 55, 55, 0.16);
    color: rgba(255, 236, 236, 0.94);
}
.checkout-empty {
    border-color: rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.76);
}
.form-section { margin-bottom: 24px; }
.form-group { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.form-field-note {
    margin: 2px 0 0;
    color: rgba(255,255,255,0.5);
    font-size: 0.76rem;
    line-height: 1.4;
}
.checkout-form input[type="text"],
.checkout-form input[type="email"] {
    padding: 13px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
}
.checkout-form input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.1);
}
.submit-order {
    width: 100%;
    padding: 16px 24px;
    border-radius: 50px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0,122,255,0.45);
    transition: transform 0.2s ease;
}
.submit-order:hover { transform: translateY(-2px); }
.submit-order:focus-visible {
    outline: 3px solid rgba(85, 165, 255, 0.82);
    outline-offset: 3px;
}
.submit-order:disabled {
    cursor: wait;
    opacity: 0.78;
    transform: none;
}
.submit-order[aria-busy="true"] {
    color: transparent;
    position: relative;
}
.submit-order[aria-busy="true"]::after {
    content: "Подготовка оплаты...";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
}
.checkout-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 20px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
    line-height: 1.45;
}
.checkout-consent input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}
.checkout-consent a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================
   PRIVACY POLICY
   ============================================================ */
.privacy-policy-page {
    min-height: 100vh;
    max-width: 860px;
    margin: 0 auto;
    padding: calc(2 * var(--header-height) + 24px) 20px 80px;
    color: rgba(255, 255, 255, 0.82);
}
.privacy-policy-page h1,
.privacy-policy-page h2 { color: #fff; }
.privacy-policy-page h1 {
    margin: 0 0 28px;
    font-size: clamp(2rem, 6vw, 3rem);
    letter-spacing: -0.03em;
}
.privacy-policy-page h2 {
    margin: 34px 0 12px;
    font-size: 1.35rem;
}
.privacy-policy-page p,
.privacy-policy-page li { line-height: 1.65; }
.privacy-policy-page a,
.site-footer-privacy { color: var(--accent); }
.site-footer-privacy:focus-visible {
    outline: 3px solid rgba(85, 165, 255, 0.82);
    outline-offset: 3px;
}

.order-access-page {
    min-height: 100vh;
    max-width: 1040px;
    margin: 0 auto;
    padding: calc(2 * var(--header-height) + 44px) 24px 96px;
    color: #fff;
}
.order-access-intro {
    max-width: 720px;
    margin-bottom: 48px;
}
.order-access-heading-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.order-access-kicker {
    margin: 0;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: .78rem;
    line-height: 1;
    letter-spacing: .08em;
}
.order-access-ready {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid rgba(0, 122, 255, .48);
    border-radius: 999px;
    color: #cfe6ff;
    background: rgba(0, 122, 255, .13);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1;
}
.order-access-intro h1 {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(2.6rem, 6vw, 5.1rem);
    line-height: .98;
    letter-spacing: 0;
}
.order-access-status {
    max-width: 560px;
    margin: 0;
    color: rgba(255,255,255,.78);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.45;
}
.order-access-expiry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
    color: rgba(255,255,255,.58);
    font-size: .94rem;
    line-height: 1.35;
}
.order-access-files { display: grid; gap: 14px; }
.order-access-file {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    background: rgba(255,255,255,.045);
}
.order-access-file-meta {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 18px;
}
.order-access-file-icon {
    display: grid;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    color: #d9ecff;
    background: rgba(0,122,255,.12);
}
.order-access-file-type {
    margin: 0 0 7px;
    color: rgba(255,255,255,.48);
    font-size: .73rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.order-access-file h2 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.2;
}
.order-access-file-size {
    margin: 8px 0 0;
    color: rgba(255,255,255,.54);
    font-size: .94rem;
}
.order-access-file-action {
    display: grid;
    justify-items: end;
    flex: 0 0 auto;
    gap: 9px;
}
.order-access-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    gap: 9px;
    padding: 13px 20px;
    border-radius: 999px;
    color: #fff;
    background: var(--accent);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: transform .2s ease, background-color .2s ease;
}
.order-access-download:hover { transform: translateY(-2px); }
.order-access-download:focus-visible {
    outline: 3px solid rgba(110,177,255,.9);
    outline-offset: 3px;
}
.order-access-file-action p {
    margin: 0;
    color: rgba(255,255,255,.42);
    font-size: .76rem;
    line-height: 1.2;
}
@media (max-width: 560px) {
    .order-access-page { padding: calc(2 * var(--header-height) + 28px) 16px 64px; }
    .order-access-intro { margin-bottom: 32px; }
    .order-access-intro h1 { font-size: clamp(2.35rem, 13vw, 3.4rem); }
    .order-access-file { align-items: stretch; flex-direction: column; gap: 24px; }
    .order-access-file-meta { align-items: flex-start; }
    .order-access-file-action { width: 100%; justify-items: stretch; }
    .order-access-download { width: 100%; }
    .order-access-file-action p { text-align: center; }
}

/* Profile layout */
.profile-container { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.user-info h3 { margin-bottom: 4px; }
.user-info p { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin-bottom: 16px; }
.logout-btn {
    display: inline-block; padding: 8px 18px; border-radius: 50px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
    color: #fff !important; font-size: 0.85rem;
}
.profile-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; }
.profile-nav .nav-tab {
    padding: 12px 16px; border-radius: 12px; color: rgba(255,255,255,0.7) !important;
    font-weight: 600; font-size: 0.9rem;
    transition: var(--transition);
}
.profile-nav .nav-tab.active { background: rgba(255,255,255,0.1); color: #fff !important; }

/* Sidebar button hover & click animations — match site style */
.profile-nav .nav-tab {
    cursor: pointer;
}
.profile-nav .nav-tab:hover {
    background: rgba(255,255,255,0.1);
    color: #fff !important;
}
.profile-nav .nav-tab:active {
    transform: scale(0.98);
    background: rgba(255,255,255,0.08);
}
.logout-btn {
    transition: var(--transition);
    cursor: pointer;
}
.logout-btn:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.3);
}
.logout-btn:active {
    transform: scale(0.98);
    background: rgba(255,255,255,0.1);
}

/* Tab content fade animation */
.tab-content.active {
    display: block;
    animation: profileTabFade 0.3s ease forwards;
}
@keyframes profileTabFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Personal digital materials */
.profile-orders-empty {
    margin: 0;
    color: rgba(255,255,255,.62);
    line-height: 1.55;
}
.profile-order-list { display: grid; gap: 22px; }
.profile-order-card {
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.profile-order-card:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}
.profile-order-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.profile-order-label {
    margin: 0 0 7px;
    color: rgba(255,255,255,.48);
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1;
    text-transform: uppercase;
}
.profile-order-heading h3 {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.2;
}
.profile-order-status {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid rgba(0,122,255,.45);
    border-radius: 999px;
    color: #cfe6ff;
    background: rgba(0,122,255,.12);
    font-size: .74rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.profile-order-status.is-expired {
    border-color: rgba(255,255,255,.14);
    color: rgba(255,255,255,.56);
    background: rgba(255,255,255,.04);
}
.profile-order-expiry {
    margin: 12px 0 0;
    color: rgba(255,255,255,.58);
    font-size: .92rem;
}
.profile-order-files {
    display: grid;
    gap: 0;
    margin-top: 18px;
    border-top: 1px solid rgba(255,255,255,.1);
}
.profile-order-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.profile-order-file-meta {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
    color: #d9ecff;
}
.profile-order-file-meta > div { min-width: 0; }
.profile-order-file-meta strong,
.profile-order-file-meta span {
    display: block;
    overflow-wrap: anywhere;
}
.profile-order-file-meta strong { color: #fff; font-size: .98rem; }
.profile-order-file-meta span {
    margin-top: 4px;
    color: rgba(255,255,255,.5);
    font-size: .82rem;
}
.profile-order-download,
.profile-order-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}
.profile-order-download {
    padding: 10px 16px;
    color: #fff !important;
    background: var(--accent);
}
.profile-order-download:hover { color: #fff !important; opacity: .9; }
.profile-order-link {
    margin-top: 16px;
    color: rgba(255,255,255,.68) !important;
}
.profile-order-link:hover { color: #fff !important; }
@media (max-width: 560px) {
    .profile-order-heading { flex-direction: column; }
    .profile-order-file { align-items: flex-start; flex-direction: column; }
    .profile-order-download { width: 100%; }
}

@media (max-width: 768px) {
    .checkout-container,
    .profile-container { grid-template-columns: 1fr; }
    .checkout-page, .profile-page { padding-top: calc(2 * var(--header-height) + 12px); }
    .profile-nav { flex-direction: row; flex-wrap: wrap; }
}


/* ============================================================
   ГЛОБАЛЬНАЯ МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */

/* --- 992px: планшеты --- */
@media (max-width: 992px) {

    /* Профиль/Войти — показываем только в мобильном меню */
    .nav-menu-auth { display: block; }

    /* Фон оверлея — полупрозрачный + сильный блюр страницы за ним */
    .main-nav {
        background: rgba(6, 6, 14, 0.6);
        backdrop-filter: blur(28px) saturate(180%);
        -webkit-backdrop-filter: blur(28px) saturate(180%);
    }

    /* Brands блок — меньше на планшете */
    .brands-unified-block { height: 480px; }

    /* Course portfolio — 2 колонки на планшете */
    .course-portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- 768px: переходная точка --- */
@media (max-width: 768px) {

    /* Brands */
    .brands-unified-block { height: 420px; }
    .brands-unified-block .carousel-slide { width: 130px; height: 72px; }
    .brands-unified-block .logos-white-container-ultrathin { padding: 12px 0 16px; }
    .brand-info-text { bottom: 130px; }

    /* Single product layout */
    .spr-info-card { padding: 24px 20px; }

    /* pcat hero */
    .pcat-hero { padding-top: calc(2 * var(--header-height) + 16px); padding-bottom: 28px; }
}

/* --- 600px: смартфоны --- */
@media (max-width: 600px) {

    /* Хедер */
    .cart-text { display: none; }
    .header-container { padding: 0 16px; }
    .header-actions { gap: 8px; }
    .cart-btn { padding: 7px 10px; }
    .login-btn, .profile-btn { display: none; } /* убираем — есть в мобильном меню */

    /* Brands блок */
    .brands-unified-block { height: 380px; }
    .brands-unified-block .carousel-slide { width: 110px; height: 60px; }
    .brands-unified-block .logos-white-container-ultrathin { padding: 10px 0 14px; }
    .brand-info-text { bottom: 110px; padding: 0 16px; }
    .brand-info-name { font-size: 1.3rem; }

    /* Главная — Hero */
    .hero-content { padding: 0 16px; }
    .hero-actions { flex-direction: column; align-items: center; gap: 12px; }
    .hero-actions .btn { width: 100%; max-width: 280px; justify-content: center; }

    /* Главная — About stats */
    .about-stats { flex-wrap: wrap; gap: 24px; justify-content: center; }
    .stat-item { min-width: 120px; }

    /* Course page */
    .course-hero { padding-top: calc(2 * var(--header-height) + 20px); padding-bottom: 48px; }
    .course-hero-title { font-size: clamp(2rem, 11vw, 3rem); }
    .course-about-grid { gap: 16px; }
    .course-about-card,
    .course-quote-card { padding: 24px 20px; }
    .course-portfolio-grid { grid-template-columns: 1fr; }
    .course-cta-inner { padding: 36px 24px; }
    .course-cta-title { font-size: 1.5rem; }
    .course-cta-btns { flex-direction: column; align-items: center; gap: 12px; }
    .course-pill-btn { width: 100%; max-width: 280px; justify-content: center; }
    .course-step { grid-template-columns: 48px 1fr; gap: 14px; padding: 20px 18px; }

    /* Portfolio category page */
    .pcat-hero { padding-top: calc(2 * var(--header-height) + 12px); }
    .pcat-hero-title { font-size: clamp(1.6rem, 8vw, 2.2rem); }

    /* Single portfolio */
    .sp-hero { padding-top: calc(2 * var(--header-height) + 16px); }
    .sp-title { font-size: clamp(1.8rem, 8vw, 2.8rem); white-space: normal; }
    .sp-gallery-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .sp-gallery-title-group { width: 100%; }
    .sp-controls { align-self: flex-start; }

    /* Contacts page */
    .contacts-hero { padding-top: calc(2 * var(--header-height) + 24px); padding-bottom: 36px; }
    .contacts-hero-title { font-size: clamp(2.8rem, 14vw, 5rem); }
    .contacts-socials-grid { padding: 0 4px; }

    /* Site footer */
    .site-footer { padding: 40px 16px 32px; }

    /* Общие секции */
    .container { padding: 0 16px; }
    .section-header { margin-bottom: 36px; }
    .section-footer-actions { margin-top: 32px; }
}

/* ==========================================================================
   ABOUT PAGE (Стили для страницы "О себе")
   ========================================================================== */

.about-page-wrapper {
    position: relative;
    padding-bottom: 100px;
}

/* --- HERO SECTION --- */
.about-hero {
    position: relative;
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('assets/images/about-bg.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    margin-bottom: 80px;
}
.about-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6); /* Затемнение */
    backdrop-filter: blur(2px);
}
.about-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 40px;
}
.about-hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
}
.about-hero-subtitle {
    font-size: 1.4rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* --- CONTENT SECTION (TEXT + IMAGE) --- */
.about-content-section {
    padding: 0 20px;
}
.about-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: var(--container-width);
    margin: 0 auto;
    align-items: center;
}
.about-text-col h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--text-on-dark);
}
.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 24px;
    color: #ccc;
}
.about-image-col img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* --- LINKS CARDS SECTION --- */
.about-links-section {
    margin-top: 120px;
}
.about-cards-title {
    text-align: center;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 60px;
}
.about-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: var(--container-width);
    margin: 0 auto;
}
.about-link-card {
    display: block;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
}
.about-link-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-5px);
    border-color: var(--accent);
}
.about-link-icon {
    width: 60px;
    height: 60px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #fff;
    font-size: 1.5rem;
}
.about-link-card h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.about-link-card p {
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
    margin-bottom: 0;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .about-content-grid { grid-template-columns: 1fr; }
    .about-links-grid { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; }
    .about-hero-title { font-size: 2.5rem; }
}

/* ============================================================
   PROFILE PAGE — COURSES SECTION (Buttons & Interactive Elements)
   ============================================================ */

#courses .btn,
#courses button,
#courses a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 50px; /* Apple-style pill */
    background: var(--accent);
    color: #fff !important;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    position: relative;
    overflow: hidden;
}

#courses .btn:hover,
#courses button:hover {
    transform: scale(1.04) translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.5);
}

/* Secondary / Glass Buttons (e.g., "Details", "Download") */
#courses .btn-secondary,
#courses a.btn-outline,
#courses button.secondary {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff !important;
    box-shadow: none;
}

#courses .btn-secondary:hover,
#courses a.btn-outline:hover,
#courses button.secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--accent) !important; /* Highlight text on hover */
}

/* Links inside course list acting as buttons */
#courses td a,
#courses .course-item a.btn-like {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

#courses td a:hover {
    background: var(--accent);
    color: #fff !important;
}

/* Additional: Fix for common LMS/Plugin button classes in Profile */
#courses a.button,
#courses input[type="submit"],
#courses button.button {
    background: var(--accent);
    color: #fff !important;
    border-radius: 50px;
    font-weight: 600;
    padding: 12px 24px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#courses a.button:hover,
#courses input[type="submit"]:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
}

/* Enhanced Active Tab Style */
.profile-nav .nav-tab.active {
    background: rgba(0, 122, 255, 0.12);
    color: #fff !important;
    border-left: 3px solid var(--accent);
    padding-left: 13px; /* Adjust for border */
}

/* Clean up tables in courses section (common LMS output) */
#courses table {
    width: 100%;
    margin-top: 20px;
    border-collapse: separate;
    border-spacing: 0;
}
#courses th,
#courses td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}
#courses th {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
#courses tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   FIX BUTTONS FEEDBACK (Sidebar & Content)
   ============================================================ */

/* 1. SIDEBAR TABS — Усиливаем эффект нажатия */
.profile-nav .nav-tab {
    /* Переход должен работать мгновенно для нажатия, но плавно для возврата */
}

.profile-nav .nav-tab:active {
    background-color: rgba(0, 122, 255, 0.2) !important; /* Явный синий оттенок при нажатии */
    transform: scale(0.97) !important;
    color: #fff !important;
}

/* Если клик по ссылке не вызывает active на самом элементе (например вложенный div), используем псевдокласс для parent */
.profile-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 2. CONTENT BUTTONS — Гарантируем клик */
#courses .btn,
#courses button,
#courses input[type="submit"],
#courses a.button {
    position: relative; /* Для z-index если нужно */
    transition: transform 0.1s ease !important; /* Очень быстрая анимация для "отзывчивости" */
}

/* Эффект "утопания" */
#courses .btn:active,
#courses button:active,
#courses input[type="submit"]:active,
#courses a.button:active {
    transform: scale(0.96) !important;
    box-shadow: none !important;
}

/* Стеклянные кнопки (Secondary) */
#courses .btn-secondary:active,
#courses button.secondary:active {
    background-color: rgba(255, 255, 255, 0.25) !important; /* Явное потемнение при клике */
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: scale(0.96) !important;
}


/* ============================================================
   FIX: SIDEBAR TABS & BUTTON VISUAL FEEDBACK (Click Animation)
   ============================================================ */

/* Sidebar Navigation Tabs */
.profile-nav .nav-tab {
    display: block; /* Ensure full width click target */
    margin-bottom: 4px;
    transition: transform 0.1s ease, background-color 0.2s ease, box-shadow 0.1s ease;
}

/* Physical "Squeeze" effect on click */
.profile-nav .nav-tab:active {
    transform: scale(0.96) !important;
    background-color: rgba(255, 255, 255, 0.15) !important; /* Lighter than hover for contrast */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important; /* Inner shadow for depth */
}

/* Ensure content buttons look good (LMS generic buttons) */
#courses .button,
#orders .button,
.tab-content a.button {
    background: var(--accent);
    color: #fff !important;
    border-radius: 50px;
    padding: 12px 24px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    border: none;
}

#courses .button:hover,
.tab-content a.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
}

/* Click effect for content buttons too */
#courses .button:active,
.tab-content a.button:active {
    transform: scale(0.96);
    box-shadow: none;
}

/* Styles for "Orders" table to match dark theme if needed */
#orders table { width: 100%; border-collapse: collapse; margin-top: 20px; }
#orders th, #orders td { padding: 16px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.1); color: #fff; }
#orders th { color: var(--accent); font-weight: 600; }



/* ============================================================
   UNIVERSAL TEXT ANIMATION (Apple Style) — Unified Across All Pages
   ============================================================ */

/* ==========================================================================
   UNIFIED ANIMATION SYSTEM (Apple-style)
   ========================================================================== */

/* Base state for all animated elements */
/* ==========================================================================
   ROBUST SCROLL ANIMATION (Progressive Enhancement)
   Default visible -> animate on viewport entry, without a hidden pre-frame
   ========================================================================== */

[data-scroll-in] {
    opacity: 1; /* Start visible to prevent "lost elements" */
    transition:
        opacity 0.72s cubic-bezier(0.25, 1, 0.5, 1),
        transform 0.72s cubic-bezier(0.25, 1, 0.5, 1),
        filter 0.72s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform, filter;
}

/* Stagger delays */
.delay-1 { transition-delay: 0.05s; }
.delay-2 { transition-delay: 0.1s; }
.delay-3 { transition-delay: 0.15s; }
.delay-4 { transition-delay: 0.2s; }

/* HERO elements (load animations) */
.apple-anim-element {
    opacity: 1;
    filter: none;
    transform: none;
    transition:
        opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Keyframes also run when Safari batches class changes into one paint. */
@keyframes appleReveal {
    from { opacity: 0; transform: translate3d(0, 22px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.apple-anim-element.visible {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0);
    will-change: auto;
    animation: appleReveal 620ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.apple-anim-element.visible.delay-1 { animation-delay: 50ms; }
.apple-anim-element.visible.delay-2 { animation-delay: 100ms; }
.apple-anim-element.visible.delay-3 { animation-delay: 150ms; }
.apple-anim-element.visible.delay-4 { animation-delay: 200ms; }

/* ─── LECTVIS OPTIMIZED ANIMATIONS (Performance & Visibility Fix) ─── */

.site-loader {
    position: fixed;
    inset: 0;
    z-index: 300000;
    display: none;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(0,0,0,0.88), rgba(5,8,12,0.72) 46%, rgba(0,0,0,0.88)),
        rgba(0,0,0,0.66);
    backdrop-filter: blur(24px) saturate(125%);
    -webkit-backdrop-filter: blur(24px) saturate(125%);
    pointer-events: all;
    touch-action: none;
}

.lectvis-loader-pending .site-loader {
    display: grid;
}

.lectvis-loader-skip .site-loader,
.lectvis-loader-done .site-loader {
    display: none;
}

.site-loader::before,
.site-loader::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.site-loader::before {
    background:
        linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0), rgba(0,132,255,0.08)),
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0) 38%, rgba(0,0,0,0.3));
    opacity: 0.65;
}

.site-loader::after {
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 0 120px rgba(0,132,255,0.12);
}

.site-loader-mark {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.02em, 0.35vw, 0.12em);
    padding: 0 24px;
    color: #fff;
    font-size: clamp(2.45rem, 10vw, 9rem);
    font-weight: 900;
    line-height: 0.88;
    letter-spacing: 0;
    text-transform: uppercase;
    text-shadow:
        0 0 24px rgba(0,132,255,0.42),
        0 18px 60px rgba(0,0,0,0.58);
    transform: translateZ(0);
}

.site-loader-mark span {
    display: inline-block;
    opacity: 0;
    filter: blur(14px);
    transform: translate3d(calc(var(--loader-index) * -1 * clamp(18px, 3vw, 54px)), 0, 0) scale(0.82);
    will-change: transform, opacity, filter;
}

.site-loader.is-running {
    animation: siteLoaderFadeIn 0.22s ease both;
}

.site-loader.is-running .site-loader-mark span {
    animation: siteLoaderLetterOpen 0.74s cubic-bezier(0.18, 1, 0.3, 1) forwards;
    animation-delay: calc(var(--loader-order) * 58ms);
}

.site-loader.is-closing {
    animation: siteLoaderFadeOut 0.18s ease-out forwards;
    pointer-events: none;
}

.site-loader.is-closing .site-loader-mark span {
    animation: siteLoaderLetterClose 0.5s cubic-bezier(0.55, 0, 0.2, 1) forwards;
}

body.site-loader-active {
    overflow: hidden;
}

body.site-loader-active .main-header,
body.site-loader-active main,
body.site-loader-active .site-footer {
    filter: blur(8px);
    transform: scale(1.012);
    transition:
        filter 0.32s ease,
        transform 0.32s ease;
}

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

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

@keyframes siteLoaderLetterOpen {
    0% {
        opacity: 0;
        filter: blur(14px);
        transform: translate3d(calc(var(--loader-index) * -1 * clamp(18px, 3vw, 54px)), 0, 0) scale(0.82);
    }
    62% {
        opacity: 1;
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes siteLoaderLetterClose {
    0% {
        opacity: 1;
        filter: blur(0);
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        opacity: 0;
        filter: blur(14px);
        transform: translate3d(calc(var(--loader-index) * -1 * clamp(16px, 2.6vw, 46px)), 0, 0) scale(0.78);
    }
}


/* ─── UNIFIED SCROLL ANIMATIONS (Robust) ─── */
@keyframes scrollReveal {
    from { opacity: 0; transform: translate3d(0, 32px, 0); filter: blur(10px); }
    to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Default remains visible; JS adds these classes only to animate elements in. */

/* When JS adds this class (either via scroll intersection or initial load check) */
[data-scroll-in].scrolling,
.fade-in-on-load {
    visibility: visible !important;
    animation-name: scrollReveal;
    animation-duration: 0.78s;
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
    animation-fill-mode: both;
    will-change: opacity, transform, filter;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.4s; }
.delay-4 { animation-delay: 0.6s; }

body.archive-product .shop-hero p.shop-hero-sub {
    color: rgba(255, 255, 255, 0.6) !important;
    margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .apple-anim-element,
    .apple-anim-element.visible,
    [data-scroll-in],
    [data-scroll-in].scrolling,
    .fade-in-on-load,
    .site-loader,
    .site-loader-mark span {
        opacity: 1 !important;
        filter: none !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
        will-change: auto !important;
    }

    .site-loader {
        display: none !important;
    }

    body.site-loader-active .main-header,
    body.site-loader-active main,
    body.site-loader-active .site-footer {
        filter: none !important;
        transform: none !important;
    }
}

/* ==========================================================================
   7. BRANDS CAROUSEL (Static, Center Active)
   ========================================================================== */

.pa-brands-section {
    padding: 80px 0;
    background: transparent;
}
.pa-brands-section .section-header {
    text-align: center;
    margin-bottom: 60px;
}

.pa-brands-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}
.pa-brand-item {
    width: 240px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0.6;
    transform: scale(0.95);
}
.pa-brand-item.active {
    opacity: 1;
    transform: scale(1.1);
}
.pa-brand-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #1a1a1e;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
}
.pa-brand-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pa-brand-logo-wrap {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pa-brand-logo-wrap img {
    max-height: 32px;
    width: auto;
    filter: brightness(0) invert(1); /* Invert for white logos if needed */
}

@media (max-width: 768px) {
    .pa-brands-row { gap: 20px; }
    .pa-brand-item { width: 140px; }
    .pa-brand-cover { border-radius: 12px; margin-bottom: 10px; }
}


/* ==========================================================================
   7. BRANDS CAROUSEL (Static, Center Active)
   ========================================================================== */

.pa-brands-section {
    padding: 80px 0;
    background: transparent;
}
.pa-brands-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}
.pa-brand-item {
    width: 240px;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0.6;
    transform: scale(0.9);
}
.pa-brand-item.active {
    opacity: 1;
    transform: scale(1.15) translateY(-10px);
}
.pa-brand-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #1a1a1e;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
}
.pa-brand-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pa-card-logo-wrap {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pa-card-logo-wrap img {
    max-height: 32px;
    width: auto;
    filter: brightness(0) invert(1); /* Invert for white logos if needed */
}

@media (max-width: 768px) {
    .pa-brands-row { gap: 20px; }
    .pa-brand-item { width: 140px; }
    .pa-brand-cover { border-radius: 12px; margin-bottom: 10px; }
}

/* =========================================
   Portfolio Brands Carousel (Archive Page)
   ========================================= */

.pa-brands-grid {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 24px;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.pa-brand-card {
    position: relative;
    width: 280px;
    background: #1a1a1f;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    opacity: 0.7;
}

.pa-brand-card:hover {
    opacity: 1;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.pa-brand-card.active {
    opacity: 1;
    transform: scale(1.15) translateY(-8px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.6);
    z-index: 10;
}

.pa-card-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0f0f12;
}

.pa-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pa-card-logo-wrap {
    padding: 16px;
    text-align: center;
    min-height: 80px; /* Ensure consistent height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.pa-card-logo-wrap img {
    max-width: 120px;
    max-height: 60px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Force white logo */
    opacity: 0.8;
}

.pa-brand-card.active .pa-card-logo-wrap img {
    opacity: 1;
    filter: brightness(0) invert(1);
}

@media (max-width: 768px) {
    .pa-brands-grid {
        gap: 16px;
    }
    .pa-brand-card {
        width: 45%; /* Show 2 per row on mobile */
        max-width: 200px;
    }
    .pa-brand-card.active {
        transform: scale(1.1);
    }
}

/* ==========================================================================
   Brands Collage (front page, Apple-style)
   ========================================================================== */

.brands-showcase-section--collage {
    position: relative;
    overflow: hidden;
    padding: 96px 0 84px;
    background: #050507;
    color: #fff;
    isolation: isolate;
}

.brands-showcase-section--collage::before {
    content: '';
    position: absolute;
    inset: -42px;
    z-index: -2;
    background-image: url('assets/images/brands-bg.jpg');
    background-size: cover;
    background-position: center;
    filter: blur(24px) saturate(1.05);
    opacity: 0.42;
    transform: scale(1.06);
}

.brands-showcase-section--collage::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg,
        #000 0%,
        rgba(0,0,0,0.98) 7%,
        rgba(5,5,7,0.92) 24%,
        rgba(5,5,7,0.92) 44%,
        rgba(0,0,0,0.96) 100%);
    pointer-events: none;
}

.brands-showcase-section--collage .brand-collage-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: none;
    padding: 0;
}

.brands-showcase-section--collage .section-header {
    max-width: 980px;
    margin: 0 auto 34px;
    padding: 0 24px;
    text-align: center;
}

.brands-showcase-section--collage .section-title {
    color: #fff;
    font-size: 4.5rem;
    line-height: 1.04;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 18px;
    text-shadow: 0 18px 52px rgba(0,0,0,0.55), 0 0 34px rgba(0,122,255,0.22);
}

.brands-showcase-section--collage .section-subtitle {
    max-width: 760px;
    margin: 0 auto;
    color: rgba(255,255,255,0.78);
    font-size: 1.32rem;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: 0;
}

.brand-collage-shell {
    position: relative;
    width: 100%;
    --brand-collage-ease: cubic-bezier(0.2, 0.75, 0.18, 1);
}

.brand-collage-stage {
    position: relative;
    width: 100%;
}

.brand-collage-rail {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 max(20px, calc((100vw - min(1180px, 76vw)) / 2));
}

.brand-collage-rail::-webkit-scrollbar,
.brand-collage-strip::-webkit-scrollbar {
    display: none;
}

.brand-collage-card {
    color: #fff;
    text-decoration: none;
}

.brand-collage-card--feature {
    position: relative;
    flex: 0 0 min(1180px, 76vw);
    aspect-ratio: 16 / 8.2;
    min-height: 420px;
    overflow: hidden;
    isolation: isolate;
    scroll-snap-align: center;
    border-radius: 8px;
    background: #07080b;
    opacity: 0.58;
    transform: scale(0.965);
    transform-origin: center;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 70px rgba(0,0,0,0.45);
    transition: opacity 420ms var(--brand-collage-ease), transform 420ms var(--brand-collage-ease), border-color 420ms ease, box-shadow 420ms ease, filter 420ms ease;
    will-change: transform, opacity;
}

.brand-collage-card--feature::before {
    content: '';
    position: absolute;
    inset: -20px;
    z-index: 0;
    background-image: var(--brand-collage-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(24px) saturate(1.05);
    opacity: 0.34;
    transform: scale(1.08);
    transition: opacity 420ms ease, transform 520ms var(--brand-collage-ease);
}

.brand-collage-card--feature::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(circle at 72% 18%, rgba(255,255,255,0.12), transparent 34%),
        linear-gradient(180deg, rgba(0,0,0,0.18) 0%, transparent 34%),
        linear-gradient(90deg, rgba(0,0,0,0.24) 0%, transparent 22%, transparent 76%, rgba(0,0,0,0.18) 100%);
    pointer-events: none;
}

.brand-collage-card--feature.is-active {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(255,255,255,0.68);
    box-shadow: 0 28px 90px rgba(0,0,0,0.62), 0 0 0 1px rgba(255,255,255,0.18), 0 0 46px rgba(255,255,255,0.22);
}

.brand-collage-card--feature.is-active::before {
    opacity: 0.48;
    transform: scale(1.03);
}

.brand-collage-card--feature:focus-visible,
.brand-collage-thumb:focus-visible,
.brand-collage-dot:focus-visible,
.brand-collage-arrow:focus-visible {
    outline: 2px solid rgba(255,255,255,0.9);
    outline-offset: 3px;
}

.brand-collage-media {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111114;
}

.brand-collage-card--feature .brand-collage-media {
    inset: clamp(10px, 1vw, 16px);
    overflow: hidden;
    border-radius: 6px;
    background: rgba(255,255,255,0.035);
}

.brand-collage-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-collage-card--feature .brand-collage-media img {
    object-fit: contain;
    transform: scale(0.985);
    transition: opacity 520ms var(--brand-collage-ease), transform 620ms var(--brand-collage-ease), filter 520ms ease;
}

.brand-collage-card--feature.is-active .brand-collage-media img {
    transform: scale(1);
}

.brand-collage-card--feature.is-landscape .brand-collage-media {
    inset: clamp(8px, 0.85vw, 14px);
}

.brand-collage-card--feature.is-portrait .brand-collage-media {
    inset: clamp(14px, 1.35vw, 22px);
}

.brand-collage-shell.is-switching .brand-collage-card--feature.is-active .brand-collage-media img {
    animation: brand-collage-image-in 560ms var(--brand-collage-ease) both;
}

.brand-collage-shell.is-switching .brand-collage-card--feature.is-active .brand-collage-overlay,
.brand-collage-shell.is-switching .brand-collage-card--feature.is-active .brand-collage-logo {
    animation: brand-collage-content-in 520ms var(--brand-collage-ease) both;
}

.brand-collage-card--logo-only .brand-collage-media {
    background: linear-gradient(135deg, #111114 0%, #2c2c2e 100%);
}

.brand-collage-media .brand-collage-logo-fallback {
    width: auto;
    height: auto;
    max-width: 42%;
    max-height: 34%;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 16px 34px rgba(0,0,0,0.35));
}

.brand-collage-text-fallback {
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0;
}

.brand-collage-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 34%;
    padding: 34px 38px;
    background: linear-gradient(to top, rgba(0,0,0,0.84) 0%, rgba(0,0,0,0.52) 46%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

.brand-collage-identity {
    display: flex;
    align-items: center;
    align-self: flex-end;
    gap: 22px;
    min-width: 0;
}

.brand-collage-logo {
    position: absolute;
    top: 32px;
    right: 36px;
    z-index: 4;
    flex: 0 0 auto;
    width: auto;
    max-width: 136px;
    max-height: 50px;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 8px 22px rgba(0,0,0,0.58));
    opacity: 0.98;
}

.brand-collage-title {
    margin: 0;
    color: #fff;
    font-size: 2.35rem;
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: 0;
    min-width: 0;
    text-shadow: 0 8px 26px rgba(0,0,0,0.45);
}

.brand-collage-link {
    flex: 0 0 auto;
    align-self: flex-end;
    margin-left: auto;
    padding: 12px 20px;
    border-radius: 999px;
    background: rgba(0,122,255,0.92);
    color: #fff;
    font-size: 0.96rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
    box-shadow: 0 0 28px rgba(0,122,255,0.32);
}

@keyframes brand-collage-image-in {
    0% {
        opacity: 0.42;
        transform: translate3d(0, 12px, 0) scale(0.965);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

@keyframes brand-collage-content-in {
    0% {
        opacity: 0;
        transform: translate3d(0, 14px, 0);
    }

    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.brand-collage-arrow {
    position: absolute;
    top: 34%;
    z-index: 6;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    background: rgba(9,12,18,0.64);
    color: #fff;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    cursor: pointer;
    transition: transform 220ms ease, background 220ms ease, color 220ms ease;
}

.brand-collage-arrow:hover {
    transform: scale(1.06);
    background: #007aff;
    color: #fff;
    box-shadow: 0 0 30px rgba(0,122,255,0.38);
}

.brand-collage-arrow--prev {
    left: max(24px, calc((100vw - min(1180px, 76vw)) / 2 + 18px));
}

.brand-collage-arrow--next {
    right: max(24px, calc((100vw - min(1180px, 76vw)) / 2 + 18px));
}

.brand-collage-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 22px max(20px, calc((100vw - min(1180px, 76vw)) / 2)) 8px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}

.brand-collage-thumb {
    position: relative;
    flex: 0 0 260px;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: #1d1d1f;
    color: #fff;
    cursor: pointer;
    opacity: 0.46;
    transform: translate3d(0, 0, 0) scale(0.94);
    filter: saturate(0.74) brightness(0.82);
    transition:
        opacity 620ms var(--brand-collage-ease),
        transform 620ms var(--brand-collage-ease),
        filter 620ms ease,
        box-shadow 620ms ease;
    will-change: transform, opacity, filter;
}

.brand-collage-thumb.is-active {
    opacity: 1;
    transform: translate3d(0, -7px, 0) scale(1);
    filter: saturate(1.03) brightness(1);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.86), 0 18px 42px rgba(0,0,0,0.34), 0 0 34px rgba(255,255,255,0.2);
}

.brand-collage-thumb.is-prev,
.brand-collage-thumb.is-next {
    opacity: 0.72;
    transform: translate3d(0, -2px, 0) scale(0.975);
    filter: saturate(0.92) brightness(0.9);
}

.brand-collage-thumb-media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111114;
}

.brand-collage-thumb-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.06);
    transition: transform 760ms var(--brand-collage-ease), filter 620ms ease, opacity 620ms ease;
    will-change: transform, filter;
}

.brand-collage-thumb.is-active .brand-collage-thumb-media img {
    transform: scale(1);
}

.brand-collage-thumb.is-prev .brand-collage-thumb-media img,
.brand-collage-thumb.is-next .brand-collage-thumb-media img {
    transform: scale(1.025);
}

.brand-collage-thumb-media .brand-collage-thumb-logo {
    width: auto;
    height: auto;
    max-width: 52%;
    max-height: 42%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.brand-collage-thumb::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    height: 68%;
    background: linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0));
    transition: opacity 520ms ease;
}

.brand-collage-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.18) 45%, transparent 68%);
    opacity: 0;
    transform: translateX(-55%);
    pointer-events: none;
}

.brand-collage-thumb.is-active::after {
    opacity: 0.82;
}

.brand-collage-shell.is-switching .brand-collage-thumb.is-active::before {
    animation: brand-collage-thumb-sheen 680ms var(--brand-collage-ease) both;
}

.brand-collage-shell.is-switching .brand-collage-thumb.is-active {
    animation: brand-collage-thumb-flow 620ms var(--brand-collage-ease) both;
}

.brand-collage-thumb-title {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 12px;
    z-index: 3;
    overflow: hidden;
    color: #fff;
    font-size: 0.98rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: 0;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-collage-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    margin-top: 12px;
}

.brand-collage-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #86868b;
    cursor: pointer;
    opacity: 0.6;
    transition: width 220ms ease, opacity 220ms ease, background 220ms ease;
}

@keyframes brand-collage-thumb-flow {
    0% {
        opacity: 0.62;
        transform: translate3d(0, 3px, 0) scale(0.965);
        filter: saturate(0.82) brightness(0.84) blur(1.5px);
    }

    62% {
        opacity: 1;
        transform: translate3d(0, -9px, 0) scale(1.012);
        filter: saturate(1.04) brightness(1.03) blur(0);
    }

    100% {
        opacity: 1;
        transform: translate3d(0, -7px, 0) scale(1);
        filter: saturate(1.03) brightness(1) blur(0);
    }
}

@keyframes brand-collage-thumb-sheen {
    0% {
        opacity: 0;
        transform: translateX(-65%);
    }

    34% {
        opacity: 0.78;
    }

    100% {
        opacity: 0;
        transform: translateX(70%);
    }
}

.brand-collage-dot.is-active {
    width: 28px;
    border-radius: 999px;
    background: #007aff;
    opacity: 1;
    box-shadow: 0 0 18px rgba(0,122,255,0.5);
}

@media (max-width: 1024px) {
    .brands-showcase-section--collage {
        padding: 78px 0 68px;
    }

    .brands-showcase-section--collage .section-title {
        font-size: 3.6rem;
    }

    .brands-showcase-section--collage .section-subtitle {
        font-size: 1.16rem;
    }

    .brand-collage-card--feature {
        flex-basis: 82vw;
        min-height: 330px;
        aspect-ratio: 16 / 9;
    }

    .brand-collage-title {
        font-size: 1.9rem;
    }

    .brand-collage-thumb {
        flex-basis: 220px;
    }
}

@media (max-width: 640px) {
    .brands-showcase-section--collage {
        padding: 64px 0 54px;
    }

    .brands-showcase-section--collage .section-header {
        margin-bottom: 26px;
        padding: 0 18px;
    }

    .brands-showcase-section--collage .section-title {
        font-size: 2.55rem;
        line-height: 1.08;
    }

    .brands-showcase-section--collage .section-subtitle {
        font-size: 1rem;
    }

    .brand-collage-rail {
        gap: 10px;
        /* Keep the active card's lower border and shadow inside the clipped scroll rail. */
        padding: 0 20px 16px;
    }

    .brand-collage-card--feature {
        flex-basis: min(86vw, 360px);
        min-height: 0;
        aspect-ratio: 1 / 1.04;
        border-width: 0.5px;
        border-color: rgba(255,255,255,0.38);
        box-shadow: 0 16px 48px rgba(0,0,0,0.52);
    }

    .brand-collage-card--feature.is-active {
        border-color: rgba(255,255,255,0.62);
        box-shadow: 0 18px 56px rgba(0,0,0,0.58), 0 0 0 0.5px rgba(255,255,255,0.16), 0 0 24px rgba(255,255,255,0.12);
    }

    .brand-collage-card--feature .brand-collage-media {
        inset: 10px 10px 92px;
        border-radius: 6px;
        align-items: center;
    }

    .brand-collage-card--feature.is-portrait .brand-collage-media,
    .brand-collage-card--feature.is-landscape .brand-collage-media {
        inset: 10px 10px 92px;
    }

    .brand-collage-card--feature .brand-collage-media img {
        object-fit: contain;
        object-position: center;
    }

    .brand-collage-card--feature::before {
        inset: -14px;
        filter: blur(18px) saturate(1.03);
        opacity: 0.38;
    }

    .brand-collage-overlay {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        text-align: center;
        min-height: 35%;
        padding: 18px 18px 20px;
        background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.72) 48%, rgba(0,0,0,0) 100%);
    }

    .brand-collage-identity {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-bottom: 12px;
    }

    .brand-collage-logo {
        top: 18px;
        right: 18px;
        max-width: 78px;
        max-height: 31px;
    }

    .brand-collage-title {
        max-width: min(100%, 300px);
        font-size: clamp(1.36rem, 5.5vw, 1.82rem);
        line-height: 1.04;
        margin-bottom: 0;
        text-align: center;
    }

    .brand-collage-link {
        display: inline-flex;
        align-self: center;
        justify-content: center;
        margin-left: 0;
        padding: 11px 18px;
        font-size: 0.84rem;
    }

    .brand-collage-arrow {
        top: 31%;
        width: 38px;
        height: 38px;
        border-width: 0.5px;
    }

    .brand-collage-arrow--prev {
        left: 24px;
    }

    .brand-collage-arrow--next {
        right: 24px;
    }

    .brand-collage-strip {
        gap: 10px;
        /* Active thumbnail lifts above the strip and needs room for its lower glow. */
        padding: 14px 20px 16px;
    }

    .brand-collage-thumb {
        flex-basis: min(64vw, 280px);
        border-radius: 7px;
        transform: translate3d(0, 0, 0) scale(0.965);
        filter: saturate(0.86) brightness(0.88);
        transition:
            opacity 340ms ease,
            transform 340ms var(--brand-collage-ease),
            filter 340ms ease,
            box-shadow 340ms ease;
    }

    .brand-collage-thumb.is-active {
        transform: translate3d(0, -3px, 0) scale(1);
        filter: saturate(1) brightness(1);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.86), 0 12px 30px rgba(0,0,0,0.28), 0 0 20px rgba(255,255,255,0.14);
    }

    .brand-collage-thumb.is-prev,
    .brand-collage-thumb.is-next {
        transform: translate3d(0, -1px, 0) scale(0.985);
        filter: saturate(0.94) brightness(0.94);
    }

    .brand-collage-thumb-media img {
        transform: scale(1.025);
        transition: transform 360ms var(--brand-collage-ease), filter 340ms ease, opacity 340ms ease;
    }

    .brand-collage-thumb.is-active .brand-collage-thumb-media img,
    .brand-collage-thumb.is-prev .brand-collage-thumb-media img,
    .brand-collage-thumb.is-next .brand-collage-thumb-media img {
        transform: scale(1);
    }

    .brand-collage-shell.is-switching .brand-collage-thumb.is-active {
        animation: none;
    }

    .brand-collage-shell.is-switching .brand-collage-thumb.is-active::before {
        animation: none;
    }

    .brand-collage-thumb-title {
        left: 12px;
        right: 12px;
        bottom: 10px;
        font-size: 0.88rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-collage-card--feature,
    .brand-collage-card--feature::before,
    .brand-collage-card--feature .brand-collage-media img,
    .brand-collage-overlay,
    .brand-collage-logo,
    .brand-collage-thumb,
    .brand-collage-dot,
    .brand-collage-arrow {
        transition-duration: 1ms;
        animation-duration: 1ms;
    }
}

/* Portfolio archive reuses the front-page brand collage over the page photo backdrop. */
.portfolio-archive .pa-brands-section--collage {
    padding: 104px 0 96px;
    background: transparent;
}

.portfolio-archive .pa-brands-section--collage::before,
.portfolio-archive .pa-brands-section--collage::after {
    display: none;
}

.portfolio-archive .pa-brands-section--collage .section-header {
    margin-bottom: 38px;
}

.portfolio-archive .pa-brands-section--collage .section-title {
    text-shadow: 0 18px 52px rgba(0,0,0,0.68);
}

.portfolio-archive .pa-brands-section--collage .brand-collage-card--feature.is-active {
    box-shadow: 0 28px 90px rgba(0,0,0,0.68), 0 0 0 1px rgba(255,255,255,0.28), 0 0 46px rgba(255,255,255,0.2);
}

@media (max-width: 640px) {
    .portfolio-archive .pa-brands-section--collage {
        padding: 74px 0 62px;
    }
}

/* Homepage shop: compact two-column product grid on mobile. */
@media (max-width: 600px) {
    .shop-section .shop-glass-tray {
        padding: 18px 12px 22px;
        border-radius: 16px;
    }

    .shop-section .products-carousel-wrapper {
        padding: 0;
    }

    .shop-section .shop-carousel-btn {
        display: none;
    }

    .shop-section .products-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        overflow: visible;
        padding: 0;
        margin: 0;
        -webkit-mask-image: none;
                mask-image: none;
    }

    .shop-section .product-item {
        width: auto;
        min-width: 0;
        padding: 12px;
        border-radius: 14px;
    }

    .shop-section .product-image {
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .shop-section .product-title {
        display: -webkit-box;
        min-height: 2.4em;
        margin-bottom: 8px;
        overflow: hidden;
        font-size: 1rem;
        line-height: 1.2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .shop-section .product-price {
        margin-bottom: 12px;
        font-size: 1.42rem;
        line-height: 1;
    }

    .shop-section .buy-btn {
        min-height: 38px;
        padding: 9px 10px;
        font-size: 0.88rem;
    }
}

/* ==========================================================================
   Hidden Client Delivery Page
   ========================================================================== */

.client-delivery-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    padding-top: var(--header-height);
    overflow: hidden;
    color: #fff;
    background: #030305;
}

.client-delivery-bg-video,
.client-delivery-bg-image,
.client-delivery-bg-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.client-delivery-bg-video {
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px) saturate(105%);
    transform: scale(1.035);
    opacity: 0.52;
}

.client-delivery-bg-image {
    z-index: 0;
    background-image: var(--client-bg-image);
    background-size: cover;
    background-position: center;
    filter: blur(28px) saturate(85%);
    transform: scale(1.12);
    opacity: 0.7;
}

.client-delivery-bg-overlay {
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(3,3,5,0.56), rgba(3,3,5,0.7));
}

.client-delivery-hero,
.client-delivery-materials,
.client-delivery-empty {
    position: relative;
    z-index: 2;
}

.client-delivery-hero {
    min-height: auto;
    display: flex;
    align-items: flex-start;
    padding: clamp(58px, 8vw, 118px) 0 clamp(24px, 4vw, 48px);
}

.client-delivery-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
    gap: clamp(28px, 6vw, 86px);
    align-items: start;
}

.client-delivery-copy {
    min-width: 0;
}

.client-delivery-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    color: rgba(255,255,255,0.62);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.client-delivery-copy h1,
.client-delivery-empty h1 {
    width: 100%;
    max-width: 860px;
    margin: 0;
    color: #fff;
    font-size: clamp(3.2rem, 9vw, 8rem);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-wrap: balance;
    text-shadow: 0 24px 70px rgba(0,0,0,0.65);
}

.client-delivery-desc {
    max-width: 760px;
    margin-top: 28px;
    color: rgba(255,255,255,0.76);
    font-size: clamp(1.08rem, 2vw, 1.35rem);
    line-height: 1.48;
}

.client-delivery-desc p + p {
    margin-top: 12px;
}

.client-delivery-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.client-delivery-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    color: rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    font-size: 0.92rem;
    font-weight: 700;
}

.client-delivery-panel {
    align-self: end;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.07));
    box-shadow: 0 28px 80px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.18);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.client-delivery-admin-note {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    color: rgba(255,255,255,0.76);
    background: rgba(0,122,255,0.18);
    font-size: 0.84rem;
    font-weight: 800;
}

.client-delivery-countdown-label {
    display: block;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.64);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.client-delivery-countdown-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.client-delivery-countdown-grid div {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    background: rgba(0,0,0,0.22);
}

.client-delivery-countdown-grid strong {
    color: #fff;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1;
}

.client-delivery-countdown-grid span {
    margin-top: 7px;
    color: rgba(255,255,255,0.52);
    font-size: 0.82rem;
    font-weight: 700;
}

.client-delivery-countdown--idle p,
.client-delivery-expired-box {
    color: rgba(255,255,255,0.72);
    font-size: 1rem;
    line-height: 1.45;
}

.client-delivery-expired-box strong {
    display: block;
    margin-top: 8px;
    color: #fff;
    font-size: 1.45rem;
    line-height: 1.1;
}

.client-delivery-actions {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.client-delivery-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.client-delivery-top-actions .client-delivery-btn {
    min-width: 190px;
}

.client-delivery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 14px 20px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
}

.client-delivery-btn--primary {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 18px 44px rgba(0,122,255,0.34);
}

.client-delivery-btn--ghost {
    color: #fff;
    border: 1px solid rgba(255,255,255,0.26);
    background: rgba(255,255,255,0.08);
}

.client-delivery-btn.is-loading {
    opacity: 0.78;
    cursor: progress;
}

.client-delivery-download-status {
    max-width: 460px;
    margin: 12px 0 0;
    color: rgba(255,255,255,0.62);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
}

.client-delivery-materials {
    padding: 0 0 calc(110px + env(safe-area-inset-bottom, 0px));
}

.client-delivery-gallery-toolbar {
    position: fixed;
    z-index: 40;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    width: max-content;
    max-width: calc(100vw - 32px);
    margin: 0;
}

.client-delivery-density-toggle.sp-size-btns {
    --density-index: 0;
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 44px);
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 18px;
    background: rgba(24,25,30,0.88);
    box-shadow: 0 8px 32px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.client-delivery-density-toggle::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    bottom: 4px;
    width: 44px;
    border-radius: 13px;
    background: rgba(0,122,255,0.18);
    box-shadow: inset 0 0 0 1px rgba(0,122,255,0.72);
    transform: translateX(calc(var(--density-index) * 48px));
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.client-delivery-density-btn.sp-size-btn {
    position: relative;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    border-radius: 13px;
    background: transparent;
    transition: color 160ms ease;
}
.client-delivery-density-btn.sp-size-btn.is-active,
.client-delivery-density-btn.sp-size-btn[aria-pressed="true"] {
    color: #fff;
    background: transparent;
    box-shadow: none;
}
.client-delivery-viewer-open .client-delivery-gallery-toolbar { visibility: hidden; }
.client-delivery-density-btn:focus-visible,
.client-delivery-card-media:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

.client-delivery-grid {
    column-count: 3;
    column-gap: 10px;
    overflow-anchor: none;
}

.client-delivery-card {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    overflow: hidden;
    break-inside: avoid;
    border: 0;
    border-radius: 7px;
    background: #1a1a1d;
    box-shadow: 0 20px 48px rgba(0,0,0,0.48);
}

/* Client files retain their own proportions, then are packed by the delivery masonry script. */
.client-delivery-card.sp-tile {
    aspect-ratio: auto;
    cursor: default;
    will-change: auto;
    box-shadow: none;
    contain: layout paint;
    transform-origin: top left;
}

/* Layout commits once; visible photos slide via transform animations in the template. */
.client-delivery-grid.sp-gallery,
.client-delivery-grid.is-masonry-ready .client-delivery-card.sp-tile {
    transition: none;
}
.client-delivery-card.sp-tile:hover { transform: none; box-shadow: none; }
.client-delivery-card-media { aspect-ratio: var(--tile-aspect, 1); }
.client-delivery-preview-fallback {
    position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center;
    padding: 16px; text-align: center; color: #f5f5f7; background: #242428;
    font-size: 0.875rem; line-height: 1.4;
}
.client-delivery-card-media.is-preview-unavailable .client-delivery-video-play { display: none; }
.client-delivery-card-media [hidden], .client-delivery-viewer [hidden] { display: none; }
.client-delivery-viewer-error { padding: 14px; color: #fff; line-height: 1.5; }
.client-delivery-viewer-error a { color: #b6d9ff; text-decoration: underline; }
.client-delivery-card a { transition: opacity 0.15s ease, background-color 0.15s ease; }

@media (max-width: 640px) {
    .client-delivery-preview-fallback { padding: 8px; font-size: 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
    .client-delivery-density-toggle::before { transition: none; }
    .client-delivery-card-media img, .client-delivery-card-media video { transition: none !important; }
    .client-delivery-card:hover .client-delivery-card-media img,
    .client-delivery-card:hover .client-delivery-card-media video { transform: none; }
}

.client-delivery-card-media {
    position: relative;
    display: block;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
}

.client-delivery-card-media img,
.client-delivery-card-media video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.6s ease;
}

.client-delivery-card--video .client-delivery-card-media {
    aspect-ratio: var(--tile-aspect, 16 / 9);
}

.client-delivery-card--video .client-delivery-card-media video {
    height: 100%;
    object-fit: cover;
}

.client-delivery-grid.is-masonry-ready .client-delivery-card-media {
    position: absolute;
    inset: 0;
}

.client-delivery-grid.is-masonry-ready .client-delivery-card-media img,
.client-delivery-grid.is-masonry-ready .client-delivery-card-media video {
    height: 100%;
    object-fit: cover;
}

.client-delivery-card:hover .client-delivery-card-media img,
.client-delivery-card:hover .client-delivery-card-media video {
    transform: scale(1.045);
}

.client-delivery-card-media--video::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 50% 42%, rgba(255,255,255,0.12), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.18));
    pointer-events: none;
}

.client-delivery-video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    box-shadow: 0 16px 42px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.client-delivery-video-play::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 18px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 16px solid rgba(255,255,255,0.92);
}

/* Fit each video to both the page and the viewport without letterboxing. */
.client-delivery-videos {
    display: grid;
    justify-items: center;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    padding-inline: clamp(12px, 2vw, 24px);
    margin-bottom: clamp(24px, 4vw, 48px);
}

.client-delivery-video-feature {
    width: min(100%, calc(80vh * var(--tile-aspect, 1.7778)));
    width: min(100%, calc(80svh * var(--tile-aspect, 1.7778)));
    margin: 0;
    border-radius: 12px;
    box-shadow: none;
    background: transparent;
}

.client-delivery-video-feature .client-delivery-card-media {
    width: 100%;
    aspect-ratio: var(--tile-aspect, 16 / 9);
}

.client-delivery-video-feature .client-delivery-card-media video,
.client-delivery-video-feature:hover .client-delivery-card-media video {
    height: 100%;
    object-fit: contain;
    transform: none;
}

.client-delivery-video-feature .client-delivery-preview-fallback {
    align-items: center;
}

.client-delivery-empty,
.client-delivery-empty-state {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 760px;
    margin: 0 auto;
    padding: calc(var(--header-height) + 70px) 20px 90px;
    text-align: center;
}

.client-delivery-empty p,
.client-delivery-empty-state p {
    margin-top: 18px;
    color: rgba(255,255,255,0.66);
    font-size: 1.18rem;
}

.client-delivery-empty-state h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(2.4rem, 6vw, 5rem);
    line-height: 0.98;
    letter-spacing: 0;
}

@media (max-width: 980px) {
    .client-delivery-hero-inner {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .client-delivery-panel {
        max-width: 520px;
        align-self: start;
    }

    .client-delivery-grid {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .client-delivery-page {
        padding-top: 70px;
    }

    .client-delivery-hero {
        min-height: auto;
        padding: 66px 0 42px;
    }

    .client-delivery-copy h1,
    .client-delivery-empty h1 {
        font-size: 3rem;
        line-height: 0.96;
    }

    .client-delivery-desc {
        margin-top: 20px;
        font-size: 1.04rem;
    }

    .client-delivery-panel {
        padding: 18px;
        border-radius: 20px;
    }

    .client-delivery-countdown-grid div {
        min-height: 78px;
        border-radius: 14px;
    }

    .client-delivery-density-btn.sp-size-btn:active {
        transform: scale(0.96);
    }

    .client-delivery-grid {
        column-count: 1;
    }

    .client-delivery-grid[data-client-cols="1"] {
        column-count: 1;
    }

    .client-delivery-grid[data-client-cols="2"] {
        column-count: 2;
        column-gap: 8px;
    }

    .client-delivery-grid[data-client-cols="2"] .client-delivery-card {
        margin-bottom: 8px;
        border-radius: 6px;
    }


}

/* Mobile layout and input: content stays inside its viewport and controls remain reachable. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-height) + 16px); }
.shop-page, .spr-page, .course-page, .contacts-page { overflow: clip; }
:where(a, button, input, select, textarea):focus-visible { outline: 2px solid #8dc3ff; outline-offset: 3px; }
:where(button, .btn, .cart-btn, .nav-link) { touch-action: manipulation; }
.lut-compare { touch-action: pan-y pinch-zoom; }
.sp-lb:not(.is-open) { visibility: hidden; }
.sp-lb.is-open { visibility: visible; }
.sp-lb-close { top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }
.sp-lb-strip { padding-bottom: max(16px, env(safe-area-inset-bottom)); }

@media (max-width: 992px) {
    :root { --header-height: calc(64px + env(safe-area-inset-top, 0px)); }
    .header-container { padding-top: env(safe-area-inset-top, 0px); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
    .header-actions { gap: 8px; }
    .cart-btn, .mobile-menu-btn { min-height: 44px; min-width: 44px; }
    .mobile-menu-btn { border-radius: 50%; padding: 10px; }
    .mobile-menu-btn.active .mobile-menu-icon { transform: none; }
    .mobile-menu-close, .mobile-menu-btn.active .mobile-menu-lines { display: none; }
    .mobile-menu-btn.active .mobile-menu-close { display: block; }
    .main-nav {
        visibility: hidden;
        height: 100vh;
        height: 100dvh;
        padding: calc(var(--header-height) + 12px) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
        justify-content: flex-start;
        overscroll-behavior: contain;
        background: rgba(8, 8, 16, 0.96);
        transition: opacity 200ms ease;
    }
    .main-nav.active { visibility: visible; }
    .main-nav .nav-menu { margin: auto 0; flex-shrink: 0; gap: 8px; }
    .main-nav .nav-link { min-height: 48px; padding: 12px 20px; font-size: 1rem; }
    .hero-section { min-height: 100svh; }
    .client-delivery-page { padding-top: var(--header-height); }
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { font-size: 16px; }
    .apple-anim-element { transition-duration: 280ms; transition-delay: 0ms; }
    .apple-anim-element.visible { animation-duration: 480ms; }
    [data-scroll-in].scrolling, .fade-in-on-load { animation-duration: 480ms; animation-delay: 0ms; }
    .sp-lb { height: 100dvh; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-rows: 44px minmax(0, 1fr) 44px auto; gap: 8px; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
    .sp-lb-close { position: static; grid-area: 1 / 3; }
    .sp-lb-stage { grid-area: 2 / 1 / 3 / -1; height: 100%; padding: 0; }
    .sp-lb-prev, .sp-lb-next { position: static; transform: none; width: 44px; height: 44px; }
    .sp-lb-prev { grid-area: 3 / 1; }
    .sp-lb-next { grid-area: 3 / 3; }
    .sp-lb-counter { grid-area: 3 / 2; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0; color: #bdbdc5; }
    .sp-lb-strip { grid-area: 4 / 1 / 5 / -1; padding: 0; }
    .sp-lb-thumb { width: 48px; height: 48px; }
    .sp-gallery, .sp-gallery.is-masonry-ready .sp-tile { transition: none; }
    .spr-info-col, .spr-track-info, .cart-item-info, .checkout-form, .profile-content { min-width: 0; }
    .spr-preview-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
    .cart-item-title, .spr-track-name { overflow-wrap: anywhere; }
    .site-footer { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
}

@media (max-width: 1024px), (hover: none) {
    .shop-section .buy-btn { min-height: 44px; }
    :where(.buy-btn, .product-card-buy, .lut-var-btn, .spr-play-btn, .sp-size-btn, .sp-back, .cart-item-remove, .brand-collage-arrow, .profile-nav .nav-tab, .legal-links a, .legal-links button) { min-height: 44px; min-width: 44px; }
    .brand-collage-dots { gap: 2px; }
    .brand-collage-dot, .brand-collage-dot.is-active { width: 44px; height: 44px; border-radius: 0; background: transparent; box-shadow: none; }
    .brand-collage-dot::after { content: ''; display: block; width: 8px; height: 8px; margin: auto; border-radius: 999px; background: #86868b; transition: width 180ms ease; }
    .brand-collage-dot.is-active::after { width: 24px; background: var(--accent); }
}

@media (hover: none) {
    .portfolio-section .portfolio-item:hover, .product-item:hover, .product-card:hover,
    .shop-section .product-item:hover, .sp-tile:hover, .cart-btn:hover,
    .client-delivery-card:hover .client-delivery-card-media img,
    .client-delivery-card:hover .client-delivery-card-media video { transform: none; }
    .brand-collage-thumb, .brand-collage-card--feature { animation: none !important; }
    .btn:active, .buy-btn:active, .product-card-buy:active, .mobile-menu-btn:active { opacity: 0.76; }
    .sp-lb-stage { touch-action: pinch-zoom; }
}

/* Client photo viewer: raised image, five neighboring previews and glass controls. */
.client-delivery-viewer {
    --viewer-gap: 10px;
    --viewer-thumb-step: 76px;
    --viewer-thumb-width: 76px;
    --viewer-thumb-height: 76px;
    position: fixed;
    inset: 0;
    z-index: 100000;
    box-sizing: border-box;
    display: grid;
    grid-template-rows: 44px minmax(0, 1fr) 92px 50px;
    gap: var(--viewer-gap);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    background: #050506;
    color: #f5f5f7;
    overflow: hidden;
    isolation: isolate;
}
.client-delivery-viewer[hidden] { display: none; }
.client-delivery-viewer.is-video { grid-template-rows: 44px minmax(0, 1fr) 0 50px; }
body.client-delivery-viewer-open { overflow: hidden; }
.client-delivery-viewer-header {
    position: relative; display: flex; align-items: center; width: 100%; min-height: 44px;
}
.client-delivery-viewer-header [data-client-viewer-count] {
    position: absolute; left: 50%; transform: translateX(-50%);
    color: #b9b9c0; font-size: 13px; font-variant-numeric: tabular-nums;
}
.client-delivery-viewer .client-delivery-viewer-pill {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; min-height: 44px; min-width: 56px;
    box-sizing: border-box; padding: 10px 20px; margin: 0;
    border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
    background: rgba(40,40,45,.64); color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 6px 20px rgba(0,0,0,.2);
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    font: inherit; line-height: 1; text-decoration: none; cursor: pointer;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    transition: transform 160ms ease, background-color 180ms ease, border-color 180ms ease;
}
.client-delivery-viewer .client-delivery-viewer-pill[hidden] { display: none; }
.client-delivery-viewer .client-delivery-viewer-pill:active { transform: scale(.94); background-color: rgba(82,82,92,.74); }
.client-delivery-viewer .client-delivery-viewer-pill:focus-visible,
.client-delivery-viewer-thumb:focus-visible { outline: 2px solid #99ccff; outline-offset: 4px; }
.client-delivery-viewer .client-delivery-viewer-close { position: static; width: 64px; height: 44px; padding: 10px 20px; }
.client-delivery-viewer-stage { position: relative; min-height: 0; width: 100%; }
.client-delivery-viewer-frame {
    position: relative; width: 100%; height: 100%; min-height: 0;
    overflow: hidden; border: 0; border-radius: 8px;
    touch-action: pinch-zoom;
}
.client-delivery-viewer-image, .client-delivery-viewer-video {
    position: absolute; inset: 0; display: block; width: 100%; height: 100%;
    min-height: 0; max-height: 100%; object-fit: contain; object-position: center top;
}
.client-delivery-viewer-image { object-position: center; user-select: none; -webkit-user-select: none; }
.client-delivery-viewer-video { touch-action: manipulation; }
.client-delivery-viewer-error { position: absolute; z-index: 2; inset: auto 0 0; text-align: center; padding: 16px; margin: 0; border-radius: 12px; background: #242428; }
.client-delivery-viewer-frame::after {
    content: ''; position: absolute; left: calc(50% - 12px); top: 12px; width: 24px; height: 24px;
    border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%;
    opacity: 0; pointer-events: none;
}
.client-delivery-viewer.is-loading .client-delivery-viewer-frame::after { opacity: 1; animation: client-viewer-loading .8s linear infinite; }
@keyframes client-viewer-loading { to { transform: rotate(360deg); } }
.client-delivery-viewer-thumbnails { position: relative; width: min(100%, 510px); height: 100%; justify-self: center; overflow: hidden; }
.client-delivery-viewer-thumb {
    --slot: 0; --thumb-scale: 1;
    position: absolute; left: 50%; top: 50%;
    width: var(--viewer-thumb-width); height: var(--viewer-thumb-height);
    box-sizing: border-box; margin: 0; padding: 3px; border: 1.5px solid transparent;
    border-radius: 13px; background: transparent; cursor: pointer;
    transform: translate(calc(-50% + var(--slot) * var(--viewer-thumb-step)), -50%) scale(var(--thumb-scale));
    opacity: 1; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    transition: transform 460ms cubic-bezier(.25,1,.5,1), opacity 320ms ease, border-color 180ms ease;
}
.client-delivery-viewer-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; pointer-events: none; }
.client-delivery-viewer-thumb[data-slot="-3"] { --slot: -3; --thumb-scale: .48; opacity: 0; pointer-events: none; }
.client-delivery-viewer-thumb[data-slot="-2"] { --slot: -2; --thumb-scale: .67; opacity: .55; }
.client-delivery-viewer-thumb[data-slot="-1"] { --slot: -1; --thumb-scale: .84; opacity: .82; }
.client-delivery-viewer-thumb[data-slot="0"] { --slot: 0; border-color: #0a84ff; }
.client-delivery-viewer-thumb[data-slot="1"] { --slot: 1; --thumb-scale: .84; opacity: .82; }
.client-delivery-viewer-thumb[data-slot="2"] { --slot: 2; --thumb-scale: .67; opacity: .55; }
.client-delivery-viewer-thumb[data-slot="3"] { --slot: 3; --thumb-scale: .48; opacity: 0; pointer-events: none; }
.client-delivery-viewer-thumb:active { filter: brightness(.75); }
.client-delivery-viewer-toolbar { display: flex; grid-row: 4; justify-content: center; align-items: center; width: 100%; }
.client-delivery-viewer .client-delivery-viewer-download {
    min-width: 176px; min-height: 50px; padding: 14px 28px; border: 1.5px solid #0a84ff;
    background: rgba(16,25,38,.2); font-size: 13px; font-weight: 650; letter-spacing: .055em; text-align: center;
}
.client-delivery-viewer-download:not([href]) { opacity: .4; pointer-events: none; }
@media (hover: hover) {
    .client-delivery-viewer .client-delivery-viewer-pill:hover { background-color: rgba(65,65,74,.7); border-color: rgba(255,255,255,.45); }
    .client-delivery-viewer .client-delivery-viewer-download:hover { background-color: rgba(10,132,255,.16); border-color: #409cff; }
    .client-delivery-viewer-thumb:hover { opacity: 1; }
}
@media (max-width: 600px) {
    .client-delivery-viewer {
        --viewer-thumb-step: clamp(51px, 16vw, 68px);
        --viewer-thumb-width: 66px; --viewer-thumb-height: 70px;
        grid-template-rows: 44px minmax(0, 1fr) 84px 48px;
        padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    .client-delivery-viewer .client-delivery-viewer-download { min-width: 156px; min-height: 48px; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .client-delivery-viewer { --viewer-gap: 4px; --viewer-thumb-height: 66px; --viewer-thumb-width: 66px; --viewer-thumb-step: 62px; grid-template-rows: 44px minmax(0, 1fr) 70px 44px; padding-block: 8px; }
    .client-delivery-viewer .client-delivery-viewer-download { min-height: 44px; padding: 10px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .client-delivery-viewer-thumb, .client-delivery-viewer .client-delivery-viewer-pill { transition: none; }
    .client-delivery-viewer.is-loading .client-delivery-viewer-frame::after { animation: none; }
}
@media (prefers-reduced-transparency: reduce) { .client-delivery-viewer .client-delivery-viewer-pill { background: #242428; backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* Public portfolio uses the delivery gallery interactions without download controls. */
.client-delivery-viewer--view-only { grid-template-rows: 44px minmax(0, 1fr) calc(var(--viewer-thumb-height) + 16px); }
.sp-page .sp-gallery-section { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
.sp-page .client-delivery-card.sp-tile { cursor: pointer; border-radius: 7px; }
.sp-page .client-delivery-card.sp-tile:hover img { transform: none; }
.sp-page .client-delivery-card:focus-visible { outline: 2px solid #99ccff; outline-offset: -3px; }
.sp-video-block--feature {
    width: 100%; max-width: none; padding-inline: clamp(12px, 2vw, 24px); box-sizing: border-box;
}
.sp-page .sp-video-block--feature .sp-video-frame {
    width: min(100%, calc(80vh * var(--portfolio-video-aspect, 16 / 9)));
    width: min(100%, calc(80svh * var(--portfolio-video-aspect, 16 / 9)));
    aspect-ratio: var(--portfolio-video-aspect, 16 / 9);
    margin-inline: auto; padding: 0; border: 0; border-radius: 12px; box-shadow: none;
}
.sp-video-frame--direct .sp-video-player {
    border-radius: inherit;
}

.spr-photo-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: #050506; color: #fff; }
.spr-photo-dialog[open] { display: grid; grid-template-rows: 44px minmax(0, 1fr) 44px; gap: 12px; }
.spr-photo-dialog::backdrop { background: #050506; }
.spr-photo-dialog img { width: 100%; height: 100%; min-height: 0; object-fit: contain; touch-action: pinch-zoom; }
.spr-photo-dialog button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #242428; color: #fff; font: inherit; font-size: 1.8rem; cursor: pointer; }
.spr-photo-close { justify-self: end; }
.spr-photo-controls { display: flex; justify-content: center; align-items: center; gap: 24px; }

@media (prefers-reduced-motion: reduce) {
    html, .brand-collage-rail, .brand-collage-strip, .products-list, .sp-lb-strip-track { scroll-behavior: auto !important; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
}

/* Courses: centered content and individual training formats. */
.course-page { text-align: center; }
.course-page .course-hero-inner,
.course-page .course-hero-sub { margin-inline: auto; }
.course-page .course-about-grid { align-items: stretch; }
.course-page .course-about-card { display: flex; flex-direction: column; justify-content: center; }
.course-page .course-quote-card { align-items: center; }
.course-page .course-step { grid-template-columns: 1fr; justify-items: center; gap: 14px; }
.course-page .course-step-head { justify-content: center; }
.course-page .course-step-desc { max-width: 680px; margin-inline: auto; }
.course-page .course-step-num { color: rgba(255,255,255,0.45); padding-top: 0; }
.course-page .course-bonus-card { flex-direction: column; align-items: center; }
.course-page .course-bonus-desc { max-width: 440px; }
.course-page .course-cta-inner { max-width: 900px; padding-inline: 0; }
.course-page .course-cta-sub { max-width: 560px; margin-inline: auto; }
.course-format-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.course-format-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: 40px 28px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 24px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.course-format-title { margin: 0 0 12px; color: #fff; font-size: 1.25rem; font-weight: 700; }
.course-format-duration { margin: 0; color: rgba(255,255,255,0.7); font-size: 1rem; }
.course-format-price {
    margin: 24px 0 32px;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.course-page .course-format-card .course-pill-btn {
    justify-content: center;
    width: 100%;
    max-width: 280px;
    min-height: 48px;
    margin-top: auto;
}
.course-page .course-pill-btn:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }
@media (max-width: 600px) {
    .course-format-grid { grid-template-columns: 1fr; gap: 16px; }
    .course-format-card { padding: 32px 20px; }
}

@media (max-width: 600px) {
    .course-page .course-hero-title { font-size: clamp(1.5rem, 8vw, 3rem); }
}

/* Center portfolio rows, including incomplete rows on tablets. */
.course-page .course-portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.course-page .course-pf-card { flex: 0 1 calc((100% - 48px) / 4); }
@media (max-width: 1024px) {
    .course-page .course-pf-card { flex-basis: calc((100% - 16px) / 2); }
}
@media (max-width: 768px) {
    .course-page .course-pf-card { flex-basis: 100%; }
}

/* Contacts refresh: scoped layout and motion, leaving the global reveal engine intact. */
.contacts-page .contacts-services-grid {
    grid-template-rows: auto auto;
    gap: 0 14px;
}
.contacts-page .contacts-service-card {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    min-height: 0;
    min-width: 0;
    padding: 22px;
    align-content: start;
    justify-content: normal;
    row-gap: 14px;
}
.contacts-page .contacts-service-card-title { overflow-wrap: anywhere; text-wrap: pretty; }
.contacts-page .contacts-service-card-text { margin: 0; }
.contacts-page .contacts-connect { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.contacts-page .contacts-social-links { display: flex; align-items: center; gap: 12px; }
.contacts-page .contacts-social-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 0; background: none; border-radius: 8px; transition: opacity 180ms ease; }
.contacts-page .contacts-social-link img { display: block; width: 28px; height: 28px; object-fit: contain; }
.contacts-page .contacts-social-link:hover { opacity: .75; }
.contacts-page .contacts-cta-btn { background: #0066d6; color: #fff; }
.contacts-page .contacts-cta-btn:hover { background: #005bbf; color: #fff; }
.contacts-page .contacts-social-link:focus-visible,
.contacts-page .contacts-cta-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.contacts-page .contacts-socials { padding: 20px 0 64px; }
/* Visible defaults also cover no-JS, repeat visits and back-forward cache. */
.contacts-page .apple-anim-element,
.contacts-page .apple-anim-element.visible { opacity: 1; transform: none; filter: none; animation: none; will-change: auto; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .contacts-page .contacts-service-card:hover { transform: translateY(-3px); }
}
@supports not (grid-template-rows: subgrid) {
    .contacts-page .contacts-service-card { grid-template-rows: minmax(5.6em, auto) auto; }
}
@media (max-width: 900px) {
    .contacts-page .contacts-services-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .contacts-page .contacts-service-card { grid-row: auto; grid-template-rows: auto auto; }
}
@media (max-width: 600px) {
    .contacts-page .contacts-connect { flex-direction: column; align-items: flex-start; gap: 24px; }
    .contacts-page .contacts-cta-btn { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .contacts-page .apple-anim-element,
    .contacts-page .contacts-service-card,
    .contacts-page .contacts-service-card:hover,
    .contacts-page .contacts-social-link,
    .contacts-page .contacts-cta-btn,
    .contacts-page .contacts-cta-btn:hover { animation: none; transition: none; transform: none; }
}
