/*
Theme Name: Stitch Theme
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fff !important;
    color: #1a1a1a;
    line-height: 1.5;
    margin: 0;
}

a { color: #1a1a1a; text-decoration: none; transition: color 0.2s; }
a:hover { color: #0066cc; }

/* Скрываем header родительской темы везде */
#header, #headerimg, #page > hr { display: none !important; }

/* === Страница товара === */
.single-product .site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 30px 60px;
}

/* Логотип на странице товара */
.single-product .product-page-logo {
    margin-bottom: 20px;
}

.single-product .product-page-logo img {
    max-height: 50px;
    width: auto;
}

.single-product .site-main > h1,
.single-product .entry-header,
.single-product h1.entry-title,
body.single-product h1:not(.product-title-right) { display: none !important; }

/* Основной layout товара */
.single-product div.product {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

/* Галерея */
.single-product .woocommerce-product-gallery {
    width: 100% !important;
    max-width: 100% !important;
}

.single-product .woocommerce-product-gallery__wrapper {
    border-radius: 12px;
    overflow: hidden;
    background: #f8f8f8;
}

.single-product .woocommerce-product-gallery img {
    width: 100%;
    height: auto;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    list-style: none;
    padding: 0;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs img:hover,
.single-product .woocommerce-product-gallery .flex-control-thumbs .flex-active {
    opacity: 1;
}

.woocommerce-product-gallery__trigger {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

/* Информация о товаре */
.single-product .summary.entry-summary {
    width: 100% !important;
}

.single-product .summary .product-title-right {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #1a1a1a;
    text-transform: capitalize;
}

.single-product .price {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a !important;
    margin-bottom: 25px;
}

.single-product .price span { color: #1a1a1a !important; }

/* Кнопка Telegram */
.telegram-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #0088cc, #0066aa);
    color: #fff !important;
    padding: 16px 32px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0,102,204,0.3);
}

.telegram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,102,204,0.4);
    color: #fff !important;
}

/* Инфо-блок */
.product-notice {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #0088cc;
}

.product-notice p {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.product-notice p:last-child { margin-bottom: 0; }

/* Атрибуты */
.product-attributes {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.product-attributes p {
    margin: 8px 0;
    font-size: 15px;
}

.product-attributes strong {
    color: #666;
    font-weight: 500;
}

/* Скрываем лишнее */
.single-product .woocommerce-tabs,
.single-product .woocommerce-product-details__short-description,
.single-product .cart,
.single-product form.cart,
.single-product .quantity,
.single-product .product_meta,
.woocommerce-breadcrumb { display: none !important; }

/* Навигация назад */
.back-nav {
    margin-bottom: 20px;
}

.back-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.back-nav a:hover { color: #0066cc; }

/* === Похожие товары === */
.single-product .related.products {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.single-product .related.products > h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 25px;
}

.single-product .related.products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.single-product .related.products ul.products::before,
.single-product .related.products ul.products::after { display: none !important; }

.single-product .related.products li.product {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    float: none !important;
}

.single-product .related.products li.product img {
    width: 100% !important;
    aspect-ratio: 1/1;
    object-fit: contain;
    background: #f5f5f5;
    border-radius: 8px;
}

.single-product .related.products li.product h2,
.single-product .related.products li.product .woocommerce-loop-product__title {
    font-size: 14px !important;
    font-weight: 500;
    margin: 10px 0 5px;
    text-transform: capitalize;
}

.single-product .related.products li.product .price {
    font-size: 15px !important;
    font-weight: 600;
}

/* Скрываем кнопки в похожих товарах */
.single-product .related.products .button,
.single-product .related.products .add_to_cart_button,
.related.products .button,
.upsells .button { display: none !important; }

/* === Адаптив === */
@media (max-width: 900px) {
    .single-product div.product {
        grid-template-columns: 1fr;
    }
    .single-product .related.products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* === Общее === */
.site-content, .site-main, .content-area, main, #page, #content {
    background: #fff !important;
}

.woocommerce-result-count, .woocommerce-ordering { display: none !important; }

/* Скрываем логотип из родительской темы на странице товара */
.single-product .site-header,
.single-product .custom-logo-link,
.single-product header.site-header,
.single-product #masthead,
.single-product .wp-site-blocks > header,
.single-product .site-branding {
    display: none !important;
}

/* Логотип на странице товара - в контейнере */
.product-page-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.product-page-header .product-logo-link {
    display: inline-block;
}

.product-page-header img {
    max-height: 50px;
    width: auto;
}

/* Убираем старый класс */
.product-page-logo {
    display: none !important;
}

/* Выравниваем логотип с контентом на странице товара */
.single-product .site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 30px 60px;
}

.single-product .product-page-header {
    max-width: 100%;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.single-product .back-nav {
    margin-bottom: 25px;
}

/* Убираем отступ слева у контента */
.single-product .woocommerce-notices-wrapper {
    display: none;
}

/* Выравниваем логотип с контентом на странице товара */
.single-product .site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 30px 60px;
}

.single-product .product-page-header {
    max-width: 100%;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.single-product .back-nav {
    margin-bottom: 25px;
}

/* Убираем отступ слева у контента */
.single-product .woocommerce-notices-wrapper {
    display: none;
}

/* === Стили блога === */
.blog .site-main,
.single-post .site-main,
.home .site-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
}

/* Список постов */
.blog article,
.home article {
    margin-bottom: 50px;
    padding-bottom: 50px;
    border-bottom: 1px solid #eee;
}

.blog article:last-child,
.home article:last-child {
    border-bottom: none;
}

/* Заголовок поста */
.entry-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px;
    line-height: 1.3;
}

.entry-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.entry-title a:hover {
    color: #0066cc;
}

/* Дата */
.entry-meta {
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Контент поста */
.entry-content {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.entry-content p {
    margin-bottom: 1.2em;
}

/* Галерея фото в посте */
.post-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 25px;
    border-radius: 12px;
    overflow: hidden;
}

.post-gallery img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.post-gallery img:first-child:last-child {
    grid-column: 1 / -1;
    aspect-ratio: 16/9;
}

/* Источник */
.post-source {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 14px;
}

.post-source a {
    color: #0066cc;
}

/* Теги */
.post-tags {
    margin-top: 20px;
}

.post-tags a {
    display: inline-block;
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    margin-right: 8px;
    margin-bottom: 8px;
    color: #666;
}

.post-tags a:hover {
    background: #0066cc;
    color: #fff;
}

/* Одиночный пост */
.single-post .entry-title {
    font-size: 36px;
}

.single-post .entry-content {
    font-size: 17px;
}

/* Адаптив */
@media (max-width: 600px) {
    .post-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .entry-title {
        font-size: 22px;
    }
}

/* === Блог в стиле Hypebeast === */
.blog .site-main,
.home:not(.woocommerce-shop) .site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 30px;
    background: #fff;
}

/* Заголовок страницы блога */
.blog .page-title,
.home .page-title,
h1.page-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    margin-bottom: 40px;
    font-weight: 600;
}

/* Карточка поста - горизонтальная */
.blog article.post,
.home article.post {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 60px;
    padding-bottom: 60px;
    border-bottom: 1px solid #eee;
}

.blog article.post:last-child,
.home article.post:last-child {
    border-bottom: none;
}

/* Контент слева */
.blog .post-content-left,
.home .post-content-left,
.blog .entry-header,
.home .entry-header {
    order: 1;
}

/* Фото справа */
.blog .post-thumbnail,
.home .post-thumbnail,
.blog .post-gallery,
.home .post-gallery {
    order: 2;
}

/* Заголовок поста */
.blog .entry-title,
.home .entry-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 15px;
}

.blog .entry-title a,
.home .entry-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.blog .entry-title a:hover,
.home .entry-title a:hover {
    color: #666;
}

/* Превью текста */
.blog .entry-summary,
.home .entry-summary {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
}

/* Мета информация */
.blog .entry-meta,
.home .entry-meta {
    font-size: 13px;
    color: #999;
}

/* Фото поста */
.blog .post-thumbnail img,
.home .post-thumbnail img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 8px;
}

/* Галерея в посте */
.post-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    border-radius: 8px;
    overflow: hidden;
}

.post-gallery img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

/* Если одно фото */
.post-gallery img:only-child {
    grid-column: 1 / -1;
    aspect-ratio: 4/3;
    max-height: 400px;
}

/* Чётные посты - зеркально */
.blog article.post:nth-child(even),
.home article.post:nth-child(even) {
    direction: rtl;
}

.blog article.post:nth-child(even) > *,
.home article.post:nth-child(even) > * {
    direction: ltr;
}

/* Адаптив */
@media (max-width: 800px) {
    .blog article.post,
    .home article.post {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .blog article.post:nth-child(even),
    .home article.post:nth-child(even) {
        direction: ltr;
    }
    
    .blog .post-thumbnail img,
    .home .post-thumbnail img {
        height: 250px;
    }
    
    .blog .entry-title,
    .home .entry-title {
        font-size: 24px;
    }
}

/* === Одиночный пост === */
.single-post .site-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 30px;
}

.single-post .entry-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 20px;
}

.single-post .entry-meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 30px;
}

.single-post .entry-content {
    font-size: 18px;
    line-height: 1.8;
}

.single-post .entry-content p {
    margin-bottom: 1.5em;
}

.single-post .post-gallery {
    margin-bottom: 30px;
}

.single-post .post-gallery img:only-child {
    max-height: 500px;
}

/* === ИСПРАВЛЕНИЕ ГАЛЕРЕИ БЛОГА === */
.entry-content .post-gallery,
.post-gallery {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 25px !important;
    max-width: 100% !important;
}

.entry-content .post-gallery img,
.post-gallery img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1 !important;
    object-fit: cover !important;
    border-radius: 4px;
}

/* Если 1 фото - на всю ширину */
.post-gallery img:only-child {
    grid-column: 1 / -1 !important;
    aspect-ratio: 16/9 !important;
    max-height: 450px !important;
}

/* Если 2 фото */
.post-gallery img:first-child:nth-last-child(2),
.post-gallery img:first-child:nth-last-child(2) ~ img {
    grid-column: span 1;
    aspect-ratio: 4/3 !important;
}

/* Главная страница блога - список постов */
body.blog .site-main,
body.home:not(.page) .site-main {
    max-width: 900px !important;
    margin: 0 auto !important;
    padding: 30px !important;
}

body.blog article,
body.home:not(.page) article {
    margin-bottom: 50px !important;
    padding-bottom: 40px !important;
    border-bottom: 1px solid #eee !important;
}

body.blog .entry-title,
body.home:not(.page) .entry-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    margin-bottom: 20px !important;
}

body.blog .entry-title a {
    color: #1a1a1a;
    text-decoration: none;
}

body.blog .entry-content,
body.home:not(.page) .entry-content {
    font-size: 16px;
    line-height: 1.7;
}

body.blog .entry-content p {
    margin-bottom: 1em;
}

/* Скрываем лишнее */
body.blog .post-source,
body.home .post-source {
    display: none;
}

/* === ИСПРАВЛЕНИЕ ГАЛЕРЕИ БЛОГА === */
.entry-content .post-gallery,
.post-gallery {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 25px !important;
    max-width: 100% !important;
}

.entry-content .post-gallery img,
.post-gallery img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1 !important;
    object-fit: cover !important;
    border-radius: 4px;
}

/* Если 1 фото - на всю ширину */
.post-gallery img:only-child {
    grid-column: 1 / -1 !important;
    aspect-ratio: 16/9 !important;
    max-height: 450px !important;
}

/* Если 2 фото */
.post-gallery img:first-child:nth-last-child(2),
.post-gallery img:first-child:nth-last-child(2) ~ img {
    grid-column: span 1;
    aspect-ratio: 4/3 !important;
}

/* Главная страница блога - список постов */
body.blog .site-main,
body.home:not(.page) .site-main {
    max-width: 900px !important;
    margin: 0 auto !important;
    padding: 30px !important;
}

body.blog article,
body.home:not(.page) article {
    margin-bottom: 50px !important;
    padding-bottom: 40px !important;
    border-bottom: 1px solid #eee !important;
}

body.blog .entry-title,
body.home:not(.page) .entry-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    margin-bottom: 20px !important;
}

body.blog .entry-title a {
    color: #1a1a1a;
    text-decoration: none;
}

body.blog .entry-content,
body.home:not(.page) .entry-content {
    font-size: 16px;
    line-height: 1.7;
}

body.blog .entry-content p {
    margin-bottom: 1em;
}

/* Скрываем лишнее */
body.blog .post-source,
body.home .post-source {
    display: none;
}

/* === НОВЫЕ СТИЛИ БЛОГА === */
.blog-container,
.single-post-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
}

.blog-logo {
    margin-bottom: 30px;
}

.blog-logo img {
    max-height: 50px;
}

.blog-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    font-weight: 600;
    margin-bottom: 40px;
}

/* Карточка поста */
.post-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    padding: 40px 0;
    border-bottom: 1px solid #eee;
}

.post-card:first-child {
    padding-top: 0;
}

/* Чередование: чётные посты зеркально */
.post-card:nth-child(even) {
    direction: rtl;
}

.post-card:nth-child(even) > * {
    direction: ltr;
}

.post-card-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 15px;
}

.post-card-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.post-card-title a:hover {
    color: #666;
}

.post-card-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 15px;
}

.post-card-date {
    font-size: 13px;
    color: #999;
}

.post-card-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 8px;
}

/* Одиночный пост */
.back-to-blog {
    display: inline-block;
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
}

.back-to-blog:hover {
    color: #0066cc;
}

.single-post-title {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 20px;
}

.single-post-meta {
    color: #999;
    font-size: 14px;
    margin-bottom: 30px;
}

.single-post-content {
    font-size: 17px;
    line-height: 1.8;
}

.single-post-content p {
    margin-bottom: 1.5em;
}

.single-post-content .post-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 30px 0;
}

.single-post-content .post-gallery img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 6px;
}

.single-post-content .post-source {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #999;
}

/* Адаптив */
@media (max-width: 768px) {
    .post-card {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .post-card:nth-child(even) {
        direction: ltr;
    }
    
    .post-card-image {
        order: -1;
    }
    
    .post-card-title {
        font-size: 22px;
    }
    
    .single-post-title {
        font-size: 28px;
    }
}
