/*
 * ─────────────────────────────────────────────────────────────
 *  Modern overrides for .box_menu / .content_page_2
 *  Add these rules to your theme's style.css (after the existing
 *  .box_menu block) so they take precedence.
 * ─────────────────────────────────────────────────────────────
 */

/* ── Grid container ── */
.content_page_2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    padding: 32px 0 48px;
    margin-top: 0;          /* was 100px – not needed with the new grid */
    align-items: start;
}

/* ── Each card ── */
.box_menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;

    height: 160px;          /* was 230px – more compact */
    width: 100%;

    border-radius: 16px;    /* slightly tighter than 28px */
    border: 1px solid transparent;

    background-color: #f0f0f0;  /* single neutral tone; alternating handled below */
    color: #4c4c4c;
    text-decoration: none;

    padding: 16px 12px;
    position: relative;
    overflow: hidden;

    /* smooth transitions for all interactive states */
    transition: transform 0.2s ease,
                box-shadow 0.2s ease,
                background-color 0.2s ease,
                border-color 0.2s ease;
}

/* Keep the alternating tones from the original theme */
.box_menu:nth-child(odd)  { background-color: #ececec; }
.box_menu:nth-child(even) { background-color: #f6f6f6; }

/* ── Hover / active ── */
.box_menu:hover,
.box_menu.hover-box-menu {
    background-color: #ffffff;
    border-color: #d0d0d0;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    color: #3a81c0;
}

.box_menu:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ── Inner image wrapper ── */
.box_menu .box-img-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.box_menu .box-img-category img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    /* subtle tint that shifts to brand blue on hover */
    filter: grayscale(30%);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.box_menu:hover .box-img-category img {
    filter: grayscale(0%) brightness(0.9) sepia(40%) hue-rotate(180deg);
    transform: scale(1.08);
}

/* ── Title ── */
.box_menu .title-category,
.box_menu p {
    font-family: 'Quicksand-Bold', sans-serif;
    font-size: 14px;
    line-height: 1.3;
    color: inherit;          /* inherits the hover colour change */
    text-align: center;
    margin: 0;
    padding: 0;
    transition: color 0.2s ease;
}

/* ── Remove the pseudo-element that forced a square aspect ratio ── */
.box_menu::before {
    content: none;
}

/* ── Gap spacers – keep them invisible ── */
.gap {
    height: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
}

/* ── Responsive tweaks ── */
@media (max-width: 576px) {
    .content_page_2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 16px 0 32px;
    }

    .box_menu {
        height: 130px;
        border-radius: 12px;
    }
}

@media (min-width: 1561px) {
    /* let it breathe on very wide screens */
    .content_page_2 {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }
}