/**
 * ACI Business Partners - Filterable Logo Grid
 * Self-contained CSS for the grid shortcode with filter bar and pagination.
 * Logo items reuse .aci-partner-logo-item from the carousel for modal clicks.
 *
 * @package ACIBusinessPartners
 * @version 1.3.0
 */

/* ──────────────────────────────────────────────
   GRID SECTION WRAPPER
   ────────────────────────────────────────────── */

.aci-partners-grid-section {
    padding: 10px 0;
    overflow: hidden;
}

/* ──────────────────────────────────────────────
   FILTER BAR
   ────────────────────────────────────────────── */

.aci-partners-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.aci-pf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    color: #333;
    line-height: 1.4;
}

.aci-pf-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.aci-pf-btn.active,
.aci-pf-btn.aci-pf-all.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.aci-pf-count {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 0 7px;
    font-size: 12px;
    line-height: 1.6;
    min-width: 20px;
    text-align: center;
}

.aci-pf-all.active .aci-pf-count {
    background: rgba(255, 255, 255, 0.3);
}

.aci-pf-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
    min-width: 200px;
    cursor: pointer;
    line-height: 1.4;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.aci-pf-select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.aci-pf-apply {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.aci-pf-apply:hover {
    background: #005a87;
    border-color: #005a87;
}

/* ──────────────────────────────────────────────
   GRID LAYOUT
   ────────────────────────────────────────────── */

.aci-partners-grid {
    display: grid;
    grid-template-columns: repeat(var(--aci-grid-cols, 4), minmax(0, 1fr));
    gap: 24px;
}

.aci-partner-grid-item {
    text-align: center;
    min-width: 0;
    transition: opacity 0.3s ease;
}

.aci-partner-grid-item.aci-hidden {
    display: none;
}

/* ──────────────────────────────────────────────
   LOGO ITEMS (GRID CONTEXT)
   The base .aci-partner-logo-item styles come from
   partners-carousel.css. These are grid-specific
   overrides for the contained logo display.
   ────────────────────────────────────────────── */

.aci-partners-grid-section .aci-partner-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    height: 120px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    box-sizing: border-box;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.aci-partners-grid-section .aci-partner-logo-item:hover {
    opacity: 0.85;
    transform: scale(1.03);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.aci-partners-grid-section .aci-partner-logo-item img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.aci-partner-grid-placeholder {
    font-size: 48px;
    color: #ccc;
    line-height: 1;
}

.aci-partner-grid-title {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ──────────────────────────────────────────────
   PAGINATION
   ────────────────────────────────────────────── */

.aci-partners-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.aci-partners-pagination:empty {
    display: none;
}

.aci-partners-pagination .aci-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    color: #333;
}

.aci-partners-pagination .aci-page-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.aci-partners-pagination .aci-page-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.aci-partners-pagination .aci-page-btn.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* ──────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .aci-partners-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .aci-partners-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .aci-partners-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .aci-pf-select {
        min-width: 0;
        width: 100%;
    }

    .aci-pf-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .aci-partners-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
