/* ============================================================
   Ah Product Section — Category Grid 2 (Overlay style)
   ============================================================ */

.elementor-widget-ah_category_grid_2 {
    flex-shrink: 0 !important;
    height: auto !important;
}

.elementor-widget-ah_category_grid_2 > .elementor-widget-container {
    height: auto !important;
}

.ahcat2-wrap {
    padding: 10px 0;
    background: #fff;
}

.ahcat2-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 65px;
    font-family: inherit;
}

/* Title */
.ahcat2-title {
    font-size: 28px;
    font-weight: 700;
    color: #1c1b1b;
    margin-bottom: 24px;
}

/* Grid */
.ahcat2-grid {
    display: grid;
    grid-template-columns: repeat( var(--ahcat2-cols, 3), 1fr );
    gap: 6px;
}

/* Card */
.ahcat2-card {
    position: relative;
    display: block;
    width: 100%;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    text-decoration: none;
    transition: box-shadow .5s ease;
}
.ahcat2-card:hover {
    box-shadow: 0 16px 40px rgba(0,0,0,.22);
}

/* The image stays in normal flow so Elementor can measure the full grid. */
.ahcat2-img-wrap {
    aspect-ratio: 3 / 3;
    overflow: hidden;
    width: 100%;
    position: relative;
}
.ahcat2-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 1s ease;
    backface-visibility: hidden;
}
.ahcat2-card:hover .ahcat2-img {
    transform: scale(1.03);
}

/* Overlay */
.ahcat2-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.10);
    transition: opacity .5s ease;
    pointer-events: none;
    z-index: 2;
}
.ahcat2-card:hover .ahcat2-overlay {
    opacity: .4;
}

/* Text container — absolute over card */
.ahcat2-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 18px 16px;
    z-index: 3;
    background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.42) 38%, rgba(0,0,0,0) 100%);
    transition: transform .5s ease;
}
.ahcat2-card:hover .ahcat2-text {
    transform: translateY(-6px);
}

/* Title row with border */
.ahcat2-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,.3);
    padding-bottom: 10px;
}
.ahcat2-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.ahcat2-arrow {
    color: #fff;
    font-size: 16px;
    line-height: 1;
    transition: transform .3s ease;
    flex-shrink: 0;
    margin-bottom: 0;
}
.ahcat2-card:hover .ahcat2-arrow { transform: translateX(6px); }

/* Subtitle — fades in on hover */
.ahcat2-subtitle {
    opacity: 0;
    color: rgba(255,255,255,.90);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    transition: opacity .5s ease, max-height .5s ease, margin-top .5s ease;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
}

.ahcat2-card:hover .ahcat2-subtitle {
    opacity: 1;
    margin-top: 10px;
    max-height: 20px;
}

/* Responsive */
@media (max-width: 900px) {
    .ahcat2-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}
@media (max-width: 768px) {
    .ahcat2-container { padding: 0 5px; }
    .ahcat2-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .ahcat2-card {
        flex: 0 0 calc(50% - 3px);
    }
    .ahcat2-grid--desktop-3.ahcat2-grid--count-3 .ahcat2-card:first-child {
        flex-basis: 100%;
    }
}
@media (max-width: 480px) {
    .ahcat2-name { font-size: 18px; }
    .ahcat2-text { padding: 22px 14px 14px; }
}
