/* Hero entrance animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Hero Section === */
.hero-section {
    background-color: #fff;
    padding-top: 48px;
}

.hero-lead {
    min-width: 0;
}

.hero-content {
    max-width: 700px;
    min-width: 0;
    position: relative;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero-gears {
    position: absolute;
    right: -390px;
    top: 20px;
    width: 340px;
    height: auto;
    opacity: 0.08;
    pointer-events: none;
}

.hero-title {
    font-size: 53px;
    line-height: 1.15;
    color: #000;
    margin-bottom: 28px;
    margin-top: 0;
    animation: fadeInUp 0.7s ease both;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero-eyebrow + .hero-title {
    margin-top: 20px;
}

.hero-content .btn-navy {
    animation: fadeInUp 0.7s ease 0.2s both;
}

/* Shared highlight mark (hero + about) */
.hero-title mark,
.about-title mark {
    background: linear-gradient(
        to top,
        var(--bs-secondary-bg) 95%,
        transparent 95%
    );
    padding: 0 8px;
    color: inherit;
}

.hero-title mark {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* === Hero Categories === */
.hero-categories {
    gap: 27px;
    padding-top: 88px;
    padding-bottom: 0;
    animation: fadeInUp 0.7s ease 0.3s both;
}

.hero-cat-card {
    flex: 1;
    height: 290px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 32px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hero-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.hero-cat-card--blue {
    background-color: var(--bs-primary);
}

.hero-cat-card--blue-alt {
    background-color: var(--konpal-navy);
}

.hero-cat-icon {
    position: absolute;
    top: 44%;
    left: 50%;
    transform: translate(-50%, -60%);
    font-size: 124px;
    line-height: 1;
    color: #fff;
}

.hero-cat-name {
    font-family: 'Fira Sans', sans-serif;
    font-size: 27px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    width: 100%;
    margin: 0;
}

/* === О компании === */
.about-section {
    padding: 85px 0 50px;
}

.about-row {
    display: flex;
}

.about-left {
    flex: 0 0 57%;
    padding-right: 0;
}

.about-title {
    font-size: 52px;
    line-height: 1.2;
    letter-spacing: -0.4px;
    color: #000;
    margin-bottom: 32px;
}

.about-divider {
    width: 1px;
    background-color: var(--bs-border-color);
    margin: 0 37px 0 15px;
    flex-shrink: 0;
}

.about-right {
    flex: 1;
    padding-top: 8px;
}

.about-right-body {
    padding-left: 97px;
}

.about-right p {
    font-size: 16px;
    color: var(--bs-secondary-color);
    line-height: 1.5;
    margin-bottom: 24px;
}

/* === Responsive === */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 36px;
    }

    .hero-categories {
        flex-wrap: wrap;
        gap: 16px;
    }

    .hero-cat-card {
        flex: 0 0 calc(50% - 8px);
        height: 220px;
    }

    .hero-cat-name {
        font-size: 20px;
    }

    .hero-cat-icon {
        font-size: 92px;
    }

    .about-row {
        flex-direction: column;
    }

    .about-left {
        flex: none;
        padding-right: 0;
        margin-bottom: 24px;
    }

    .about-title {
        font-size: 30px;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding-top: 16px;
        /* clip, не hidden: hidden делает блок прокручиваемым по вертикали */
        overflow-x: clip;
    }

    .hero-content > :first-child,
    .hero-gears + .hero-eyebrow {
        margin-top: 0;
    }

    .hero-gears + .hero-title {
        margin-top: 2px;
    }

    .hero-eyebrow + .hero-title {
        margin-top: 16px;
    }

    .hero-title {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .btn-navy,
    .btn-light-navy {
        min-width: auto;
        width: 100%;
        padding: 14px 24px;
    }

    .hero-categories {
        flex-wrap: wrap;
        gap: 12px;
        padding-top: 32px;
    }

    .hero-cat-card {
        flex: 0 0 calc(50% - 6px);
        height: 160px;
    }

    .hero-cat-name {
        font-size: 16px;
    }

    .hero-cat-icon {
        font-size: 60px;
    }

    .hero-cat-card {
        padding: 16px 20px;
    }

    .about-section {
        padding: 24px 0 0;
    }
}

/* === Товарные подборки === */
.hero-section--showcase {
    padding-top: 32px;
}

.hero-lead--showcase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 32px;
    padding: 40px;
    background: var(--bs-secondary-bg);
}

.hero-lead--showcase .hero-content {
    min-width: 0;
}

.hero-eyebrow {
    margin: 0;
    color: var(--bs-primary);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero-lead--showcase .hero-title {
    margin: 20px 0 22px;
    color: var(--konpal-navy);
    font-size: clamp(30px, 3.1vw, 44px);
    line-height: 1.08;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    color: var(--konpal-navy);
    font-family: 'Fira Sans', sans-serif;
    font-size: 20px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero-brands span {
    color: var(--bs-primary);
}

.hero-lead--showcase .btn-navy {
    gap: 24px;
    min-width: 190px;
    min-height: 52px;
    margin-top: 30px;
    padding: 14px 24px;
}

.hero-section--showcase .hero-categories {
    padding-top: 40px;
}

.home-carousel {
    min-width: 0;
    padding: 20px 24px 24px;
    background: var(--bs-body-bg);
}

.home-carousel__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.home-carousel__title {
    margin: 0;
    color: var(--konpal-navy);
    font-family: var(--bs-body-font-family);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-carousel__track {
    display: flex;
    position: relative;
    /* Зазор скрывает соседний кадр при округлении scrollLeft. */
    gap: 1px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.home-carousel__track::-webkit-scrollbar {
    display: none;
}

.home-carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
}

.home-carousel__controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.home-carousel__controls[hidden] {
    display: none;
}

.home-carousel__controls > span {
    min-width: 44px;
    color: var(--konpal-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.home-carousel__controls button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0 0 4px;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--konpal-navy);
    font-size: 30px;
    line-height: 1;
}

.home-carousel__controls button:hover {
    background: var(--bs-secondary-bg);
}

.home-product-card {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    transition: border-color 0.18s ease;
}

.home-product-card:hover {
    border-color: var(--bs-primary);
}

.home-product-card__image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 196px;
    padding: 20px 24px 12px;
}

.home-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.home-product-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--bs-secondary-bg);
    overflow-wrap: anywhere;
}

.home-product-card__body p {
    margin: 0;
}

.home-product-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.home-product-card__availability {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--konpal-muted);
    font-size: 13px;
    line-height: 1.4;
}

.home-product-card__availability--in_stock {
    color: var(--konpal-green-strong);
}

.home-product-card__availability > span {
    width: 5px;
    height: 5px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

.home-product-card__article {
    color: var(--konpal-muted);
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.025em;
    overflow-wrap: anywhere;
}

.home-product-card__name {
    margin: 12px 0 20px;
    font-size: 20px;
    line-height: 1.2;
}

.home-product-card__name a {
    color: var(--konpal-navy);
    text-decoration: none;
}

.home-product-card__name a:hover {
    color: var(--bs-primary);
}

.home-product-card__purchase {
    margin-top: auto;
}

.home-product-card__price {
    color: var(--konpal-navy);
    font-family: 'Fira Sans', sans-serif;
    font-size: 25px;
    line-height: 1.2;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.home-product-card__price span {
    display: inline-block;
    color: var(--konpal-muted);
    font-family: var(--bs-body-font-family);
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}

.home-product-card__add {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 48px;
    margin-top: 16px;
    padding: 12px 16px;
    border: 1px solid var(--konpal-navy);
    background: var(--konpal-navy);
    color: var(--bs-body-bg);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;
    transition: background-color 0.18s ease;
}

.home-product-card__add:hover {
    background: var(--konpal-navy-hover);
}

.home-product-card__add > span {
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.home-product-card__add.is-added {
    border-color: var(--konpal-green-strong);
    background: var(--konpal-green-strong);
}

.home-product-card--featured {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
    gap: 20px;
    border: 0;
    transition: none;
}

.home-product-card--featured .home-product-card__image {
    min-height: 310px;
    height: auto;
    padding: 8px;
}

.home-product-card--featured .home-product-card__image img {
    height: 290px;
}

.home-product-card--featured .home-product-card__body {
    padding: 28px 0 12px;
    border: 0;
}

.home-product-card--featured .home-product-card__meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 8px;
}

.home-product-card--featured .home-product-card__name {
    margin: 0;
    font-size: 25px;
    line-height: 1.12;
}

.home-product-card--featured .home-product-card__purchase {
    padding-top: 24px;
}

.home-product-card--featured .home-product-card__price {
    font-size: 28px;
}

.home-recommendations {
    padding-top: 56px;
}

.home-recommendations__heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 24px;
}

.home-recommendations__heading h2 {
    margin: 0;
    color: var(--konpal-navy);
    font-size: 36px;
    line-height: 1.15;
}

.home-recommendations__heading > a {
    color: var(--bs-primary);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.home-recommendations__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.home-carousel :focus-visible,
.home-recommendations :focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: -3px;
}

@media (max-width: 1199.98px) {
    .hero-lead--showcase {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        gap: 24px;
        padding: 28px;
    }

    .hero-lead--showcase .hero-title {
        font-size: 36px;
    }

    .home-carousel {
        padding: 16px;
    }

    .home-product-card--featured {
        grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr);
        gap: 12px;
    }

    .home-product-card--featured .home-product-card__image {
        min-height: 290px;
        padding: 0;
    }

    .home-product-card--featured .home-product-card__image img {
        height: 240px;
    }

    .home-product-card--featured .home-product-card__name {
        font-size: 22px;
    }

    .home-product-card--featured .home-product-card__price {
        font-size: 25px;
    }

    .home-recommendations__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .hero-lead--showcase {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
        padding: 32px;
    }

    .hero-lead--showcase .hero-content {
        max-width: 620px;
    }

    .hero-lead--showcase .hero-title {
        max-width: 590px;
        font-size: 38px;
    }

    .home-product-card--featured {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
        gap: 24px;
    }

    .home-product-card--featured .home-product-card__image {
        min-height: 0;
        height: 230px;
    }

    .home-product-card--featured .home-product-card__image img {
        height: 230px;
    }

    .home-product-card--featured .home-product-card__body {
        padding-top: 8px;
    }

    .home-product-card--featured .home-product-card__name {
        font-size: 26px;
    }
}

@media (max-width: 575.98px) {
    .hero-section--showcase {
        padding-top: 10px;
    }

    .hero-lead--showcase {
        gap: 24px;
        padding: 16px 20px 24px;
    }

    .hero-lead--showcase .hero-content > :first-child {
        margin-top: 0;
    }

    .hero-lead--showcase .hero-title {
        margin: 16px 0;
        font-size: 29px;
        line-height: 1.1;
    }

    .hero-eyebrow {
        font-size: 10px;
    }

    .hero-brands {
        gap: 6px;
        font-size: 17px;
    }

    .hero-lead--showcase .btn-navy {
        width: 100%;
        margin-top: 22px;
    }

    .hero-section--showcase .hero-categories {
        padding-top: 28px;
    }

    .home-carousel {
        margin-inline: -8px;
        padding: 16px;
    }

    .home-carousel__heading {
        gap: 8px;
        margin-bottom: 12px;
    }

    .home-carousel__title {
        font-size: 11px;
        letter-spacing: 0;
    }

    .home-carousel__controls {
        gap: 6px;
    }

    .home-carousel__controls > span {
        min-width: 32px;
        font-size: 11px;
    }

    .home-product-card--featured {
        grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
        gap: 14px;
    }

    .home-product-card--featured .home-product-card__image,
    .home-product-card--featured .home-product-card__image img {
        height: 195px;
    }

    .home-product-card--featured .home-product-card__body {
        padding-block: 4px;
    }

    .home-product-card--featured .home-product-card__meta {
        gap: 8px;
    }

    .home-product-card--featured .home-product-card__article {
        font-size: 10px;
    }

    .home-product-card--featured .home-product-card__availability {
        font-size: 11px;
    }

    .home-product-card--featured .home-product-card__name {
        font-size: 19px;
    }

    .home-product-card--featured .home-product-card__purchase {
        padding-top: 16px;
    }

    .home-product-card--featured .home-product-card__price {
        font-size: 23px;
    }

    .home-product-card--featured .home-product-card__add {
        margin-top: 12px;
        padding-inline: 12px;
        font-size: 12px;
    }

    .home-recommendations {
        padding-top: 36px;
    }

    .home-recommendations__heading {
        gap: 12px;
        margin-bottom: 20px;
    }

    .home-recommendations__heading h2 {
        font-size: 28px;
    }

    .home-recommendations__heading > a {
        font-size: 13px;
    }

    .home-recommendations__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .home-recommendations .home-product-card {
        display: grid;
        grid-template-columns: 100px minmax(0, 1fr);
    }

    .home-recommendations .home-product-card__image {
        min-height: 160px;
        height: auto;
        padding: 16px 8px;
    }

    .home-recommendations .home-product-card__image img {
        height: auto;
        max-height: 150px;
    }

    .home-recommendations .home-product-card__body {
        padding: 16px 14px;
        border-top: 0;
        border-left: 1px solid var(--bs-secondary-bg);
    }

    .home-recommendations .home-product-card__meta {
        gap: 5px;
    }

    .home-recommendations .home-product-card__article {
        font-size: 10px;
    }

    .home-recommendations .home-product-card__name {
        margin: 10px 0 14px;
        font-size: 18px;
    }

    .home-product-card__add {
        margin-top: 12px;
    }
}

@media (max-width: 359.98px) {
    .hero-lead--showcase .hero-title {
        font-size: 26px;
    }

    .home-product-card--featured {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-product-card--featured .home-product-card__image,
    .home-product-card--featured .home-product-card__image img {
        height: 160px;
    }

    .home-product-card--featured .home-product-card__name {
        overflow-wrap: break-word;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-title,
    .hero-content .btn-navy,
    .hero-categories {
        animation: none;
    }

    .hero-cat-card,
    .home-product-card,
    .home-product-card__add {
        transition: none;
    }

    .home-carousel__track {
        scroll-behavior: auto;
    }
}
