/* ========== ПЕРЕМЕННЫЕ ========== */
:root {
    --bg-dark: #455A44;
    --card-light: #E8F5E9;
    --accent-lime: #9CCC65;
    --btn-green: #8BC34A;
    --btn-yes: #4CAF50;
    --btn-no: #f44336;
    --text-black: #212121;
    --text-white: #FFFFFF;
    --text-gray: #616161;
    --text-light-gray: #9e9e9e;
    --footer-link: #CFD8DC;
    --footer-text: #B0BEC5;
    --card-border: #2E7D32;
    --shadow-green: rgba(46, 125, 50, 0.25);
    --primary-red: #982030;
    --primary-red-dark: #6b1522;
    --primary-red-light: #ddbfc3;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: 'Be Vietnam Pro', sans-serif;
    background: #fff8f7;
    color: var(--text-black);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== ВЕРХНЕЕ МЕНЮ ========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fefcfb;
    padding: 5px 50px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    position: relative;
    z-index: 99;
    flex-wrap: wrap;
}

.logo img {
    height: 50px;
    width: auto;
    border-radius: 5px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 15px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    color: black;
    text-decoration: none;
    font-size: 20px;
    padding: 8px 15px;
    transition: all 0.3s ease;
    border-radius: 25px;
    font-weight: 540;
}

.nav-links a:hover {
    color: #94162C;
    transform: translateY(-2px);
}

.nav-links a.active {
    color: #94162C;
}

.spacer {
    width: 150px;
}

/* ========== ОСНОВНОЙ КОНТЕЙНЕР ========== */
.main-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* ========== ЛЕВЫЙ СТОЛБЕЦ (SIDEBAR) ========== */
.sidebar {
    width: 270px;
    background: #FAFAF9;
    color: white;
    overflow-y: auto;
    box-shadow: 0.1px 0 2px rgba(0,0,0,0.1);
    flex-shrink: 0;
    padding: 20px 5px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: black;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
}

.sidebar-item:hover {
    border-left-color: #7F1D1D;
    padding-left: 35px;
    color: #7F1D1D;
    background: rgba(255,255,255,0.1);
}

.sidebar-item:hover .sidebar-text {
    font-size: 15px;
    transform: scale(1.05);
}

.sidebar-item:hover img {
    width: 25px;
    height: 25px;
    filter: brightness(0) saturate(100%) invert(26%) sepia(18%) saturate(2768%) hue-rotate(337deg) brightness(94%) contrast(90%);
    transform: scale(1.1);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.sidebar-text {
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.heropi a {
    font-family: 'Be Vietnam Pro', sans-serif;
    margin-top: 50px;
    color: #7F1D1D;
    font-size: 23px;
    padding: 0px 0px 0px 25px;
    font-weight: 700;
}

.heropi p {
    font-family: 'Be Vietnam Pro', sans-serif;
    color: #A8A29E;
    font-size: 13px;
    padding: 0px 25px;
    font-weight: 500;
    margin-bottom: 20px;
}

/* ========== ОСНОВНОЙ КОНТЕНТ ========== */
.main-content {
    flex: 1;
    min-height: 100%;
}

.page {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 16px 24px;
    width: 100%;
}

/* ========== ФУТЕР ========== */
.footer {
    width: 100%;
    padding: 40px 20px;
    text-align: center;
    background-color: var(--primary-red);
    border-radius: 20px 20px 0 0;
    margin-top: auto;
    clear: both;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    font-size: 14px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.footer-info p {
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

/* ===== ЗАГОЛОВОК ДЛЯ ШАБЛОНОВ ===== */
.templates-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding: 30px 0px 20px 20px;
}

.templates-header-left {
    text-align: left;
}

.templates-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-black);
    margin-bottom: 10px;
    text-align: left;
}

.templates-subtitle {
    font-size: 18px;
    color: var(--text-gray);
    text-align: left;
    margin: 0;
}

.templates-link {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-left: 20px;
}

.templates-link:hover {
    transform: translateX(5px);
    color: var(--primary-red-dark);
}

/* Адаптивность для заголовка */
@media (max-width: 768px) {
    .templates-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .templates-link {
        margin-left: 0;
    }
    
    .templates-title {
        font-size: 28px;
    }
    
    .templates-subtitle {
        font-size: 16px;
    }
}

/* Product Layout */
.product-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
    margin: 32px 0;
}

.product-info {
    padding: 0;
}


.series {
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #8B7355;
    margin-bottom: 16px;
}

h1 {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.price {
    display: flex;
    align-items: baseline;
    
    
}

.current-price {
    font-size: 28px;
    font-weight: 700;
    color: #c02a2a;
}

.old-price {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
}

.description {
    margin-top: 10px;
    margin-bottom: 32px;
    line-height: 1.6;
    color: #4a4a4a;
}

.description p {
    margin-bottom: 16px;
}

/* ===== КНОПКИ В КАРТОЧКАХ ТОВАРА ===== */
.actions {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 40px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border: none;
}

.btn-primary {
    background: #c02a2a;
    color: white;
}

.btn-primary:hover {
    background: #8B0000;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid #c02a2a;
    color: #c02a2a;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #c02a2a;
    color: white;
    transform: translateY(-2px);
}

.back-link {
    display: inline-block;
    
    color: #c02a2a;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

/* Also Like Section */
.also-like {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e8e0d4;
}

.also-like h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 32px;
    text-align: center;
}

/* Телефон */
.hero-preview {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 9 / 16;
    background-size: cover;
    background-position: center;
    border-radius: 40px;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 30px 50px rgba(0,0,0,0.3), 0 0 0 6px #333, 0 0 0 9px #555;
    flex-shrink: 0;
    overflow: hidden;
    margin: 0 auto;
}

.preview-video-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 34px;
}

.preview-video-container video,
.preview-video-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========== КАРТОЧКИ ШАБЛОНОВ ========== */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.template-item {
    max-width: 220px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.template-item:hover {
    transform: scale(1.02);
}

.template-item video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 15px;
    margin-bottom: 8px;
}

.template-content {
    display: flex;
    flex-direction: column;
}

.template-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-top h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.price {
    color: #982030;
    font-weight: 600;
    
}

.category {
    font-size: 14px;
    color: #8a8a8a;
    margin: 5px 0 15px;
}


/* Кнопка */
.btn-view {
    display: inline-block;
    text-align: center;
    padding: 12px 0;
    background: linear-gradient(135deg, #982030, #b42b3f);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.btn-view:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(152, 32, 48, 0.3);
}

/* ========== БУРГЕР-МЕНЮ И SIDEBAR ДЛЯ МОБИЛЬНЫХ ========== */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 100;
}

.burger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #982030;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.overlay.active {
    display: block;
}

/* Планшет (до 768px) */
@media (max-width: 768px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 99;
        background: #fefcfb;
        padding: 8px 20px;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .burger-menu {
        display: flex;
    }
    
    .nav-links {
        position: static;
        transform: none;
        display: flex !important;
        gap: 10px;
        order: 3;
        width: 100%;
        justify-content: center;
        
    }
    
    .nav-links a {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .spacer {
        display: none;
    }
    
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        background: #FAFAF9;
        z-index: 1000;
        transition: left 0.3s ease;
        display: block;
        
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .hero-preview {
        margin: 0 auto;
    }
    
    h1 {
        font-size: 32px;
    }
    
    /* Карточки на планшете - 2 колонки */
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 15px;
    }
    
    .template-top h3 {
        font-size: 18px;
        font-weight: 600;
    }
    
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    font-size: 14px;
    text-decoration: none;
    transition: opacity 0.3s;
}
    
    
}

/* Телефон (до 576px) - 2 колонки, размеры как на планшете */
@media (max-width: 576px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 15px;
    }
    
    .template-item {
        max-width: 100%;
    }
    
    .template-item video {
        margin-bottom: 8px;
    }
    
    /* НЕ УМЕНЬШАЕМ РАЗМЕРЫ - ОСТАВЛЯЕМ КАК НА ПЛАНШЕТЕ */
    .template-top h3 {
        font-size: 18px;
        font-weight: 600;
    }
    
   
    
    
    
}



/* Фикс для кнопок на телефоне */
@media (max-width: 576px) {
    .actions {
        display: flex;
        gap: 12px;
        width: 100%;
    }
    
    .btn-primary, 
    .btn-secondary {
        flex: 1;
        width: 100%;
        min-width: 0;
        padding: 12px 0px;
        font-size: 15px;
        text-align: center;
        box-sizing: border-box;
    }
    
    /* Убираем подчёркивание у ссылки на телефоне */
    .btn-secondary {
        text-decoration: none !important;
        display: inline-block;
    }
}


/* Чтобы текст "Редактировать" не вылезал за кнопку */
.btn-secondary {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 8px;
    padding-right: 8px;
}

/* На телефоне */
@media (max-width: 576px) {
    .btn-secondary {
        font-size: 15px;
        padding-left: 5px;
        padding-right: 5px;
        letter-spacing: -0.3px;
    }
}