/* Font and Brand Updates */

/* Import DM Sans */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/* Apply DM Sans globally */
:root {
    --thm-font: 'DM Sans', sans-serif;
    --thm-heading-font: 'DM Sans', sans-serif;
}

body {
    font-family: var(--thm-font);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--thm-heading-font);
}

/* Static Brand Grid Layout */
.brand-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Center items, so 9 items = 5 + 4 centered */
    align-items: center;
    gap: 40px 60px;
    /* Vertical gap 40px, Horizontal gap 60px */
    padding: 40px 0;
    margin: 0 auto;
    max-width: 1200px;
}

.brand-item {
    width: 180px;
    /* Reduced width for better fit (5 per row) */
    position: relative;
    display: block;
    transition: transform 0.3s ease;
}

.brand-item:hover {
    transform: translateY(-5px);
    /* Subtle lift on hover */
}

/* Hover Effects Refinement */
/* Ensure images fit the box */
.brand-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.4s ease;
}

/* Base Image (Gray or Default) */
.brand-item .img-box {
    position: relative;
    z-index: 1;
    /* Do NOT fade out base image to avoid flickering if transparency exists */
}

/* Overlay Image (Color or Active) */
.brand-item .img-box2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    /* Center absolute */
    width: 100%;
    opacity: 0;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* Let clicks pass through to link */
}

.brand-item .img-box2 img {
    width: 100%;
}

/* Hover State */
.brand-item:hover .img-box2 {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .brand-grid {
        gap: 30px;
    }

    .brand-item {
        width: 140px;
        /* Smaller on mobile (2 per row usually) */
    }
}