.testimonial-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: clamp(20px, 3vw, 30px);
    padding: clamp(28px, 5vw, 44px) 0;
}

/* Card */
.testimonial-page-item {
    position: relative;
    width: 100%;
    min-width: 0;
    height: clamp(320px, 42vw, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(243, 112, 33, 0.65);
    background: #fff;
    cursor: zoom-in;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.1);
    isolation: isolate;
}

/* Image */
.testimonial-page-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* no crop, no distortion */
    background: #fff; /* optional clean background */
    display: block;
    transition: transform 0.45s ease;
}

.testimonial-page-item::before,
.testimonial-page-item::after {
    content: "";
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2;
}

.testimonial-page-item::before {
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
}

.card-search-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px; /* Smaller as requested */
    height: 32px;
    background-color: var(--nexus-orange);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    border-radius: 50%;
    z-index: 20;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.testimonial-page-item::after {
    display: none;
}

@media (min-width: 768px) {
    .card-search-icon {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        background-size: 20px 20px;
    }
}

/* Premium Magnifier Effect with Cursor Follow */
.testimonial-page-item::after {
    content: "";
    position: absolute;
    left: var(--mouse-x, 50%);
    top: var(--mouse-y, 50%);
    width: clamp(200px, 26vw, 260px);
height: clamp(200px, 26vw, 260px);
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: clamp(50px, 10vw, 70px);
    border: 6px solid rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    /* Subtle Nexus Orange outer border and premium shadows */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 
                inset 0 0 25px rgba(255, 255, 255, 0.2),
                0 0 0 1px rgba(0, 0, 0, 0.05),
                0 0 0 2px rgba(243, 112, 33, 0.15);
}

.testimonial-page-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* No hover trigger for icon: Hide magnifier when mouse is over the icon */
.testimonial-page-item:has(.card-search-icon:hover)::after {
    opacity: 0 !important;
    transform: translate(-50%, -50%) scale(0) !important;
}



.testimonial-page-item:hover img,
.testimonial-page-item:focus-visible img {
    transform: none;
}

.testimonial-page-item:hover::before,
.testimonial-page-item:focus-visible::before {
    opacity: 1;
}

.zoom-lens {
    position: absolute;
    width: clamp(200px, 26vw, 260px);
    height: clamp(200px, 26vw, 260px);
    border-radius: 50%;
    border: 2px solid var(--nexus-orange);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
    pointer-events: none;
    z-index: 12;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
    transition: opacity 140ms ease, transform 140ms ease;
    background-repeat: no-repeat;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    will-change: left, top, background-position;
}

.zoom-lens::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 54%);
}

.zoom-lens.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

body > section.bg-nexus-black.py-5 h1 {
    color: var(--nexus-orange) !important;
}

body > section.bg-nexus-black.py-5 .container.text-center > div[style*="width: 50px"] {
    display: none !important;
}

@media (min-width: 768px) {
    .testimonial-page-item {
        height: clamp(420px, 38vw, 500px);
    }
}

/* Mobile */
@media (max-width: 767px) {
    .testimonial-page-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .testimonial-page-item {
        height: auto;
        aspect-ratio: 1 / 1;
        border-radius: 16px;
    }

    
}

@media (hover: none), (pointer: coarse) {
    .testimonial-page-item:hover::before {
        opacity: 0;
        transform: none;
    }

    .testimonial-page-item:hover img {
        opacity: 1;
        transform: none;
    }

    .zoom-lens {
        display: none;
    }
}
