/* Banner Sliding — height follows screen width (aspect-ratio) */
#Gslider {
    /* brands2 ≈ 1024×655; keeps white edges flush with page */
    --gslider-aspect: 1024 / 655;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: var(--gslider-aspect);
    margin-top: 0 !important;
    overflow: hidden;
    border: 0;
    outline: 0;
    box-shadow: none;
}

#Gslider .carousel-inner {
    background: #fff;
    color: black;
    height: 100%;
    border: 0;
}

#Gslider .carousel-item {
    height: 100%;
    border: 0;
}

#Gslider .carousel-inner img {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-width: none !important;
    object-fit: cover;
    object-position: center;
    display: block;
    border: 0 !important;
    outline: 0;
    /* Clip 1px edge baked into some banner assets */
    transform: scale(1.01);
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

#Gslider .carousel-inner .carousel-caption {
    bottom: 45%;
}

#Gslider .carousel-inner .carousel-caption h1 {
    font-weight: bold;
    line-height: 1.2;
    color: #2b4392;
}

#Gslider .carousel-inner .carousel-caption h2 {
    font-weight: 600;
    color: #333;
}

#Gslider .carousel-inner .carousel-caption h3 {
    font-weight: 500;
    color: #555;
}

#Gslider .carousel-inner .carousel-caption p {
    color: black;
    margin: 28px 0 28px 0;
    line-height: 1.6;
}

#Gslider .carousel-indicators {
    bottom: 1rem;
    z-index: 2;
}

#Gslider .carousel-control-prev,
#Gslider .carousel-control-next {
    z-index: 2;
}

/* Desktop: carousel drives header height; chrome floats on top */
@media (min-width: 992px) {
    .header.shop.header--hero {
        position: relative;
        isolation: isolate;
        min-height: 0;
    }

    .header.shop.header--hero > .topbar,
    .header.shop.header--hero > .middle-inner {
        position: absolute;
        left: 0;
        right: 0;
        width: 100%;
        background: transparent !important;
    }

    .header.shop.header--hero > .topbar {
        top: 0;
        /* Выше middle-inner, иначе дропдаун телефона уходит под логотип */
        z-index: 20;
    }

    .header.shop.header--hero > .middle-inner {
        top: var(--home-topbar-height, 94px);
        z-index: 10;
    }

    .header.shop.header--hero > #Gslider {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: var(--gslider-aspect);
        margin: 0 !important;
        z-index: 1;
    }
}

@media (max-width: 991.98px) {
    #Gslider {
        margin-top: 0 !important;
        height: auto;
        min-height: 0;
    }

    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        margin-bottom: 0;
    }

    .main-categories {
        padding: 40px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    #Gslider.carousel-fade .carousel-item {
        transition: none;
    }
}

/* Main Categories Section Styles */
.main-categories {
    padding: 0;
    padding-bottom: 0px !important;
}

/* Home SEO headings: isolate from reset.css rules */
.home-seo-headings h1 {
    text-align: center;
    font-weight: 600;
    color: #222;
}

.home-seo-headings h2 {
    text-align: center;
    font-weight: 500;
    color: #222;
}

.home-seo-headings h3 {
    text-align: center;
    font-weight: 500;
    color: #222;
}

.home-products-seo-content {
    color: #333;
}
.home-products-seo-content__text.is-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.home-products-seo-content__toggle {
    margin-top: 0.75rem;
    padding: 0;
    border: 0;
    background: none;
    color: #2b4392;
    font-weight: 500;
    cursor: pointer;
}
.home-products-seo-content__toggle:hover {
    text-decoration: underline;
}
.home-products-seo-content p:last-child {
    margin-bottom: 0;
}

.main-categories .category-card {
    background: white;
    border-radius: 12px;
    padding: 20px 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.main-categories .category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-icon-placeholder {
    color: white;
    font-size: var(--fs-2xl);
}

/* Responsive adjustments for product area */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-area.section {
    padding-top: 0 !important;
}

/* Shared image box — overridden equally by .home-products-section below */
.product-img-container {
    width: 100%;
    border-radius: 8px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.category-tile {
    border-radius: 8px;
    box-shadow: none;
    transition: box-shadow 0.25s cubic-bezier(.4, 0, .2, 1), background 0.25s cubic-bezier(.4, 0, .2, 1), transform 0.18s;
    min-height: 180px;
    cursor: pointer;
    position: relative;
}

.category-tile:hover,
.category-tile.active {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13), 0 1.5px 8px rgba(0, 123, 255, 0.08);
    transform: translateY(-4px) scale(1.04);
    z-index: 2;
}

.category-link {
    color: inherit;
    text-decoration: none;
}

.category-icon {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.category-title {
    font-weight: 500;
    color: #222;
    margin: 0;
    margin-top: 8px;
    line-height: 1.3;
}

.category-tile.active .category-link,
.category-tile.active .category-title {
    color: #2b4392;
    font-weight: 600;
}

/* FAQ — same section title/spacing as product blocks */
.home-faq-section.section {
    padding-top: 1.5rem !important;
    padding-bottom: 2rem !important;
    background: #F6F7FB;
}
.home-faq-title.shop-section-title {
    margin-bottom: 20px;
}
.home-faq-title.shop-section-title h2,
.home-faq-section .shop-section-title h2 {
    line-height: 1.25 !important;
    font-weight: 700 !important;
    color: #2c2d3f !important;
    margin: 0 0 10px !important;
    padding-bottom: 10px !important;
    position: relative;
    text-transform: none !important;
}
.home-faq-title.shop-section-title h2::before,
.home-faq-section .shop-section-title h2::before {
    position: absolute;
    content: "";
    height: 2px;
    width: 50px;
    background: #2b4392;
    left: 0;
    bottom: -1px;
}
.home-faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.home-faq-item {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: none;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.home-faq-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}
.home-faq-question {
    padding: 0;
}
.home-faq-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #333;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}
.home-faq-btn:hover {
    color: #2b4392;
}
.home-faq-btn[aria-expanded="true"] {
    color: #2b4392;
}
.home-faq-btn-text {
    flex: 1;
    margin: 0;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    text-transform: none !important;
}
.home-faq-btn-icon {
    flex-shrink: 0;
    color: #2b4392;
    transition: transform 0.25s ease;
}
.home-faq-btn[aria-expanded="true"] .home-faq-btn-icon {
    transform: rotate(180deg);
}
.home-faq-answer-wrap {
    border-top: 1px solid #eee;
}
.home-faq-answer {
    padding: 0.75rem 1rem 1rem;
    color: #555;
    line-height: 1.6;
}
.home-faq-answer p:last-child {
    margin-bottom: 0;
}
@media (max-width: 576px) {
    .home-faq-section.section {
        padding-top: 1.25rem !important;
        padding-bottom: 1.5rem !important;
    }
    .home-faq-btn, .home-faq-answer {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}
[data-theme="dark"] .home-faq-section.section {
    background: var(--bg-secondary);
}
[data-theme="dark"] .home-faq-title.shop-section-title h2 {
    color: var(--text-primary);
}
[data-theme="dark"] .home-faq-item {
    background: var(--bg-tertiary);
    box-shadow: 0 2px 10px var(--shadow-color);
}
[data-theme="dark"] .home-faq-btn {
    color: var(--text-primary);
}
[data-theme="dark"] .home-faq-btn:hover,
[data-theme="dark"] .home-faq-btn[aria-expanded="true"] {
    color: var(--accent-color);
}
[data-theme="dark"] .home-faq-answer-wrap {
    border-top-color: var(--border-color);
}
[data-theme="dark"] .home-faq-answer {
    color: var(--text-secondary);
}

/* Mobile Grid Layout */
.categories-grid-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 0 15px;
}

.category-item-mobile {
    flex: 0 0 calc(33.333% - 8px);
    max-width: calc(33.333% - 8px);
    min-width: 90px;
}

.last-row-two-items-mobile {
    flex: 0 0 calc(50% - 6px);
    max-width: calc(50% - 6px);
}

@media (max-width: 575px) {
    .categories-grid-mobile {
        gap: 8px;
        padding: 0 8px;
    }
    
    .category-item-mobile {
        flex: 0 0 calc(33.333% - 5.33px);
        max-width: calc(33.333% - 5.33px);
        min-width: 70px;
    }
    
    .last-row-two-items-mobile {
        flex: 0 0 calc(50% - 4px);
        max-width: calc(50% - 4px);
    }
    
    .category-icon-wrapper {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .categories-grid-mobile {
        gap: 6px;
        padding: 0 6px;
    }
    
    .category-item-mobile {
        flex: 0 0 calc(33.333% - 4px);
        max-width: calc(33.333% - 4px);
        min-width: 60px;
    }
    
    .last-row-two-items-mobile {
        flex: 0 0 calc(50% - 3px);
        max-width: calc(50% - 3px);
    }
    
    .category-icon-wrapper {
        width: 90px;
        height: 90px;
    }
}

#category-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.category-filter-bar {
    gap: 8px;
}

.category-icon-wrapper {
    height: 70%;
}

#category-scroll-wrapper {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#category-scroll-wrapper button {
    background: #f7f7f8;
    color: #222;
    border: none;
    border-radius: 10px;
    margin-right: 8px;
    padding: 7px 18px 7px 18px;
    font-weight: 400;
    transition: background 0.18s, color 0.18s;
    height: 38px;
    line-height: 1.1;
    box-shadow: none;
    outline: none;
    white-space: nowrap;
}

#category-scroll-wrapper button:last-child {
    margin-right: 0;
}

#category-scroll-wrapper button:hover {
    background: #ececec;
    color: #222;
}

.btn.active-category,
.btn.active,
.btn.btn-outline-primary.active-category {
    background: #2b4392  !important;
    color: #fff !important;
    border: none !important;
    font-weight: 500;
}

@media (max-width: 575px) {

    #category-scroll-wrapper button,
    .cat-arrow-btn {
        height: 34px;
        padding: 6px 12px;
    }
}

/* Стили для фильтра популярных товаров */
.category-filter-btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid #e9ecef;
    background: #fff;
    color: #6c757d;
    white-space: nowrap;
}

.category-filter-btn:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

.category-filter-btn.active-category {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

/* Анимация загрузки */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Анимация появления товаров */
.product-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-item.filtering {
    opacity: 0.5;
    transform: scale(0.95);
}

.product-item.hidden {
    display: none !important;
}

/* Category scroll arrow buttons */
.cat-arrow-btn {
    background: #fff;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
    font-size: var(--fs-lg);
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: none;
}

.cat-arrow-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.cat-arrow-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .category-filter-btn {
        padding: 0.4rem 0.8rem;
    }
    
    .cat-arrow-btn {
        width: 28px;
        height: 28px;
    }
}

/* Стили для выбора цвета и размера в модальных окнах */
.modal .color-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 80px;
    border: 3px solid transparent;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.modal .color-btn.active {
    border-color: #2b4392 !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(43, 67, 146, 0.3);
}

.modal .color-btn:hover {
    transform: scale(1.05);
}

.modal .size-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

.modal .size-btn.active {
    background-color: #2b4392 !important;
    border-color: #2b4392 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 67, 146, 0.3);
}

.modal .size-btn:hover {
    transform: translateY(-1px);
}

.modal .selected-color,
.modal .selected-size {
    color: #2b4392 !important;
    font-weight: 600 !important;
}


/* Identical card geometry for "Новые" and "Популярные" */
.home-products-section.shop-home-list,
.home-products-section.product-area,
.home-products-section.section {
    padding-top: 1.5rem !important;
    padding-bottom: 2rem !important;
}

.home-products-section .shop-section-title {
    margin-bottom: 20px;
}

.home-products-section .shop-section-title h2 {
    line-height: 1.25 !important;
    font-weight: 700 !important;
    margin: 0 0 10px !important;
    padding-bottom: 10px !important;
    position: relative;
    text-transform: none !important;
}

.home-products-section .shop-section-title h2::before {
    position: absolute;
    content: "";
    height: 2px;
    width: 50px;
    background: #2b4392;
    left: 0;
    bottom: -1px;
}

.home-products-section .products-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0.5rem 0;
    width: 100%;
}

.home-products-section .products-grid .product-item {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

@media (min-width: 576px) {
    .home-products-section .products-grid .product-item {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 768px) {
    .home-products-section .products-grid .product-item {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (min-width: 992px) {
    .home-products-section .products-grid .product-item {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

.home-products-section .product-card {
    height: 100%;
    min-height: 0;
}

.home-products-section .product-img-container {
    width: 100% !important;
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

.home-products-section .product-img {
    width: 100% !important;
    height: 100% !important;
    max-height: 180px !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center;
    padding: 12px !important;
}

.home-products-section .product-card .card-body {
    padding: 0.75rem !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1;
}

.home-products-section .product-card .product-title,
.home-products-section [data-context="home"] .product-title {
    min-height: 2.4rem;
    max-height: 2.4rem;
}

.main-categories .category-title,
.category-tile .category-title {
    line-height: 1.3;
}

@media (max-width: 575.98px) {
    .home-products-section .products-grid .product-item {
        padding: 0;
    }

    .home-products-section .product-img-container {
        height: 160px !important;
        min-height: 160px !important;
        max-height: 160px !important;
    }

    .home-products-section .product-img {
        max-height: 150px !important;
        padding: 8px !important;
    }

    .home-products-section .product-card .product-title,
    .home-products-section [data-context="home"] .product-title {
        min-height: 2.2rem;
        max-height: 2.2rem;
    }
}

/* Service cards contrast (moved from head inline) */
.shop-services .single-service p {
    color: #4a4a4a;
}
