@charset "UTF-8";

/**
 * All Brands page — logo tiles, no crop, theme-aware
 * Used by: resources/views/all_brand.blade.php + partials/brands_grid.blade.php
 */

/* ============================================================
   PAGE
   ============================================================ */

.nx-all-brand-page {
    --nx-brand-radius: 0.875rem;
    --nx-brand-pad: 0.875rem;
    background: var(--filter-bg, #f5f5f7);
    min-height: 50vh;
    padding: 1.5rem 0 3rem;
    font-family: var(--font-system, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

@media (min-width: 768px) {
    .nx-all-brand-page {
        padding: 2rem 0 4rem;
        --nx-brand-pad: 1.125rem;
    }
}

.nx-all-brand-page .nx-all-brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #1c1c1e);
    margin: 0 auto 1.25rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
    position: relative;
    display: table;
    padding-bottom: 0.5rem;
    text-align: center;
}

.nx-all-brand-page .nx-all-brand-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 3rem;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--primary, #0d6efd),
        transparent
    );
}

@media (min-width: 768px) {
    .nx-all-brand-page .nx-all-brand-title {
        font-size: 1.875rem;
        margin-bottom: 1.5rem;
    }

    .nx-all-brand-page .nx-all-brand-title::after {
        width: 4rem;
        height: 4px;
    }
}

/* ============================================================
   SEARCH
   ============================================================ */

.nx-all-brand-page .brand-search-wrapper {
    max-width: 28rem;
    margin: 0 auto 1.75rem;
    position: relative;
}

.nx-all-brand-page .brand-search-input {
    height: 48px;
    border-radius: 999px;
    padding-left: 48px;
    padding-right: 48px;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--card-bg, #ffffff);
    color: var(--text-primary, #212529);
    font-size: 16px; /* prevent iOS zoom */
}

.nx-all-brand-page .brand-search-input:focus {
    border-color: var(--primary, #0d6efd);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #0d6efd) 22%, transparent);
    outline: none;
}

.nx-all-brand-page .brand-search-input::placeholder {
    color: var(--text-secondary, #6c757d);
}

.nx-all-brand-page .brand-search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--text-secondary, #999);
    pointer-events: none;
    z-index: 5;
}

.nx-all-brand-page .brand-search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary, #999);
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    z-index: 5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nx-all-brand-page .brand-search-clear:hover {
    background-color: color-mix(in srgb, var(--text-primary, #000) 6%, transparent);
    color: var(--text-primary, #333);
}

.nx-all-brand-page .brand-search-spinner {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid color-mix(in srgb, var(--text-primary, #000) 12%, transparent);
    border-top-color: var(--primary, #0d6efd);
    border-radius: 50%;
    animation: nx-brand-spin 0.8s linear infinite;
    z-index: 5;
    display: none;
}

@keyframes nx-brand-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ============================================================
   GRID + CARD
   ============================================================ */

.nx-all-brand-page #brands-list {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .nx-all-brand-page #brands-list {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
}

.nx-all-brand-page .nx-brand-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: var(--nx-brand-radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    text-decoration: none;
}

.nx-all-brand-page .nx-brand-card:hover,
.nx-all-brand-page .nx-brand-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    border-color: color-mix(in srgb, var(--primary, #0d6efd) 35%, var(--border-color, #ddd));
    outline: none;
}

.nx-all-brand-page .nx-brand-card:focus-visible {
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--primary, #0d6efd) 28%, transparent),
        0 10px 28px rgba(0, 0, 0, 0.08);
}

/* Logo canvas — padded so wide wordmarks stay fully visible */
.nx-all-brand-page .nx-brand-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--nx-brand-pad);
    background:
        linear-gradient(
            160deg,
            color-mix(in srgb, var(--card-bg, #fff) 88%, var(--filter-bg, #f5f5f7)) 0%,
            var(--filter-bg, #f5f5f7) 100%
        );
    overflow: hidden;
}

.nx-all-brand-page .nx-brand-card__img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    /* Neutralize legacy .ratio-1-1 { object-fit: cover } */
    aspect-ratio: auto;
}

.nx-all-brand-page .nx-brand-card__img.is-fallback,
.nx-all-brand-page .nx-brand-card__img[src*="default.webp"] {
    opacity: 0.65;
    max-width: 56%;
    max-height: 56%;
}

.nx-all-brand-page .nx-brand-card__name {
    display: block;
    margin: 0;
    padding: 0.65rem 0.75rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--card-text, var(--text-primary, #1c1c1e));
    background: var(--card-bg, #ffffff);
    border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
    text-transform: capitalize;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

@media (min-width: 768px) {
    .nx-all-brand-page .nx-brand-card__name {
        font-size: 0.875rem;
        padding: 0.75rem 0.875rem;
    }
}

.nx-all-brand-page .nx-brand-card:hover .nx-brand-card__name,
.nx-all-brand-page .nx-brand-card:focus-visible .nx-brand-card__name {
    color: var(--primary, #0d6efd);
}

/* Kill legacy featured-item / thumb / bg-thm look inside brand page */
.nx-all-brand-page .nx-brand-card .hover-dark::before,
.nx-all-brand-page .featured-item .hover-dark::before {
    display: none;
}

.nx-all-brand-page .nx-brand-card .content.bg-thm,
.nx-all-brand-page .nx-brand-card .bg-thm {
    background: transparent !important;
    margin-top: 0 !important;
}

.nx-all-brand-page .nx-brand-empty {
    color: var(--text-secondary, #6c757d);
    font-weight: 500;
    padding: 2.5rem 1rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.nx-all-brand-page #brands-pagination .pagination {
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nx-all-brand-page #brands-pagination .page-link {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 0.5rem;
    color: var(--text-primary, #1c1c1e);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nx-all-brand-page #brands-pagination .page-link:hover {
    background: color-mix(in srgb, var(--primary, #0d6efd) 10%, var(--card-bg, #fff));
    border-color: var(--primary, #0d6efd);
    color: var(--primary, #0d6efd);
}

.nx-all-brand-page #brands-pagination .page-item.active .page-link {
    background: var(--primary, #0d6efd);
    border-color: var(--primary, #0d6efd);
    color: #fff;
}

.nx-all-brand-page #brands-pagination .page-item.disabled .page-link {
    opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
    .nx-all-brand-page .nx-brand-card,
    .nx-all-brand-page .nx-brand-card__name,
    .nx-all-brand-page .brand-search-input {
        transition: none;
    }

    .nx-all-brand-page .nx-brand-card:hover {
        transform: none;
    }

    .nx-all-brand-page .brand-search-spinner {
        animation: none;
    }
}
