/* === WRAPPER: центрирование + адаптивная сетка === */
.agat-horizontal-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    perspective: 1600px;
}

/* === CARD === */
.agat-hcard {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 720px;

    background: var(--agat-bg-blur);
    border: 1px solid var(--agat-border);
    backdrop-filter: blur(18px);

    border-radius: var(--agat-radius-sm);
    overflow: hidden;
    text-decoration: none;
    color: var(--agat-text);

    box-shadow: 0 14px 32px rgba(15,23,42,0.18);
    transition: transform .35s cubic-bezier(.22,.61,.36,1),
                box-shadow .35s ease,
                filter .35s ease;

    position: relative;
    transform-style: preserve-3d;

    font-size: 1.55rem;
    line-height: 1.45;
}

/* === PARALLELEPIPED SKEW === */
.agat-hcard::before {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 40%);
    pointer-events: none;

    transform: skewX(-6deg);
    transform-origin: top left;
}

/* === ORANGE GLOW + 3D === */
.agat-hcard:hover {
    box-shadow:
        0 22px 48px rgba(15,23,42,0.32),
        0 0 22px rgba(196,90,26,0.55),
        0 0 42px rgba(196,90,26,0.35);
    filter: brightness(1.05);
    transform: translateY(-10px) rotateX(6deg) rotateY(-6deg);
}

/* === IMAGE LEFT === */
.agat-hcard-img {
    width: 42%;
    min-height: 180px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    position: relative;
}

/* === ICON INSIDE IMAGE (эмодзи) === */
.agat-hcard-img::after {
    content: attr(data-icon);
    position: absolute;
    bottom: 12px;
    right: 12px;

    font-size: 2rem;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 0 12px rgba(0,0,0,0.45);
}

/* === CONTENT RIGHT === */
.agat-hcard-content {
    position: relative;
    padding: 1.3rem 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 58%;

    padding-right: 80px; /* место под иконку справа */
}

/* === ICON RIGHT OF TEXT === */
.agat-hcard-icon-right {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.45;
    pointer-events: none;
}

.agat-hcard-icon-right svg {
    width: 56px;
    height: 56px;
    fill: var(--agat-accent);
}

/* === TITLE === */
.agat-hcard-title {
    font-size: 1.7rem;
    font-family: var(--agat-font-head);
    font-weight: 700;
    color: #c45a1a;
    margin-bottom: 0.45rem;
    letter-spacing: 0.5px;
    line-height: 1.25;
}

/* === DESCRIPTION === */
.agat-hcard-desc {
    font-size: 1.55rem;
    color: var(--agat-text-muted);
    line-height: 1.55;
}

/* === SPECS === */
.agat-specs-toggle {
    font-size: 1.35rem;
    color: var(--agat-accent-primary);
}

.agat-specs-body p {
    font-size: 1.35rem;
    margin: 0.35rem 0;
    color: var(--agat-text-muted);
}

/* === ADAPTIVE === */
@media (max-width: 1024px) {
    .agat-hcard {
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .agat-hcard {
        flex-direction: column;
        max-width: 100%;
        transform: none !important;
    }

    .agat-hcard-img {
        width: 100%;
        height: 200px;
    }

    .agat-hcard-content {
        width: 100%;
        padding-right: 1.4rem; /* убираем место под иконку */
    }

    .agat-hcard-icon-right {
        right: 12px;
        top: auto;
        bottom: 12px;
        transform: none;
    }
}

@media (max-width: 480px) {
    .agat-hcard {
        font-size: 1.35rem;
    }

    .agat-hcard-title {
        font-size: 1.45rem;
    }

    .agat-hcard-desc {
        font-size: 1.25rem;
    }
}

/* Расширенное мобильное поведение: показывать только компактные иконки на смартфонах */
@media (max-width: 768px) {
    .agat-horizontal-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.5rem;
        grid-auto-rows: 1fr;
        align-items: stretch;
    }

    .agat-hcard {
        display: block;
        width: 100%;
        max-width: none;
        border-radius: 0.6rem;
        box-shadow: none;
        background: var(--agat-bg-blur);
        border: 1px solid var(--agat-border);
        overflow: hidden;
        min-height: 0;
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .agat-hcard-img,
    .agat-hcard-desc,
    .agat-hcard-icon-right {
        display: none !important;
    }

    .agat-hcard-content {
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }

    .agat-compact {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.95rem 0.6rem;
        text-align: center;
        height: 100%;
    }

    .agat-compact-icon svg,
    .agat-compact-icon i {
        width: 46px;
        height: 46px;
        display: block;
        fill: var(--agat-accent);
        color: var(--agat-accent);
        font-size: 46px;
        line-height: 46px;
    }

    .agat-compact-title {
        font-size: 0.9rem;
        font-weight: 700;
        color: #c45a1a;
        line-height: 1.1;
    }

    .agat-hcard + .agat-hcard {
        margin-top: 0;
    }
}

/* Скрыть компактные версии на десктопе (показываем только справа большую иконку) */
@media (min-width: 769px) {
    .agat-compact { display: none !important; }
    .agat-hcard-img { display: block !important; }
    .agat-hcard-desc { display: block !important; }
}

/* На десктопе скрываем большой заголовок внутри контента и показываем подпись у иконки */
@media (min-width: 769px) {
    .agat-hcard-icon-right {
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        pointer-events: none;
        opacity: 0.95;
    }

    .agat-hcard-icon-right .agat-hcard-icon-label {
        display: block;
        font-size: 0.95rem;
        color: #c45a1a;
        font-weight: 700;
        white-space: nowrap;
        text-align: center;
    }

}

/* На мобильных скрываем крупный заголовок внутри карточки и подпись у правой иконки */
@media (max-width: 768px) {
    .agat-hcard-title { display: none !important; }
    .agat-hcard-icon-right .agat-hcard-icon-label { display: none !important; }
}

/* Ещё более компактные шрифты для очень маленьких экранов */
@media (max-width: 420px) {
    .agat-compact-title { font-size: 0.78rem; }
    .agat-compact-icon i, .agat-compact-icon svg { font-size: 36px; width:36px; height:36px; }
}

/* Компактная сетка иконок для мобильных: 2 столбца × 3 ряда */
@media (max-width: 480px) {
    .agat-horizontal-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.5rem;
        grid-auto-rows: 1fr;
        align-items: stretch;
    }

    .agat-hcard {
        display: block;
        width: 100%;
        max-width: none;
        border-radius: 0.6rem;
        box-shadow: none;
        background: var(--agat-bg-blur);
        border: 1px solid var(--agat-border);
        overflow: hidden;
        min-height: 0;
        aspect-ratio: 1 / 1;
        height: auto;
    }

    /* Скрываем большие изображения и описания, показываем компактную иконку */
    .agat-hcard-img,
    .agat-hcard-desc,
    .agat-hcard-icon-right {
        display: none !important;
    }

    .agat-hcard-content {
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }

    .agat-compact {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.9rem 0.6rem;
        text-align: center;
        height: 100%;
    }

    .agat-compact-icon svg {
        width: 46px;
        height: 46px;
        display: block;
        fill: var(--agat-accent);
        color: var(--agat-accent);
    }

    .agat-compact-title {
        font-size: 1.05rem;
        font-weight: 700;
        color: #c45a1a;
        line-height: 1.1;
    }

    /* Убираем излишние отступы карточки на мобильных */
    .agat-hcard + .agat-hcard {
        margin-top: 0;
    }
}
