/* ==========================================================================
   Brand Archive Page -- [fx_brand_products] shortcode
   The shortcode outputs .fx-brand-layout directly. Divi controls everything
   outside the shortcode (masthead, CTA, etc.) via Theme Builder.
   ========================================================================== */

.fx-brand-layout {
    font-family: 'Open Sans', sans-serif;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.fx-brand-sidebar {
    flex: 0 0 280px;
    position: sticky;
    top: 120px;
}

.fx-brand-sidebar__inner {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 24px 20px;
}

.fx-filter-group {
    margin-bottom: 18px;
}

.fx-filter-label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 6px;
}

.fx-filter-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    border: 1px solid #bbb;
    border-radius: 5px;
    background: #fff;
    color: #333;
    appearance: auto;
}

.fx-model-dropdown {
    position: relative;
}

.fx-model-dropdown__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #bbb;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    user-select: none;
}

.fx-model-dropdown__text {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.fx-model-dropdown__arrow {
    flex-shrink: 0;
    color: #666;
    transition: transform 0.2s;
}

.fx-model-dropdown--open .fx-model-dropdown__arrow {
    transform: rotate(180deg);
}

.fx-model-dropdown__body {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #bbb;
    border-top: none;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
}

.fx-model-dropdown--open .fx-model-dropdown__body {
    display: block;
}

.fx-model-search {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
}

.fx-model-search input {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Open Sans', sans-serif;
}

.fx-model-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 6px 10px;
}

.fx-model-item {
    margin-bottom: 4px;
}

.fx-model-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    font-size: 13px;
    color: #333;
}

.fx-model-item input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid #888;
    border-radius: 4px;
    margin-right: 8px;
    flex-shrink: 0;
    position: relative;
    background: #fff;
    cursor: pointer;
}

.fx-model-item input[type="checkbox"]:checked {
    background: #8B0100;
    border-color: #8B0100;
}

.fx-model-item input[type="checkbox"]:checked::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.fx-model-item input[type="checkbox"]:checked + .fx-model-name {
    color: #8B0100;
    font-weight: 600;
}

.fx-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.fx-btn {
    display: inline-block;
    padding: 10px 20px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    text-align: center;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.fx-btn--primary {
    background: #8B0100;
    color: #fff;
    border: 2px solid #8B0100;
}

.fx-btn--primary:hover {
    background: #6d0100;
    border-color: #6d0100;
    color: #fff;
}

.fx-btn--clear {
    background: transparent;
    color: #8B0100;
    border: 1px solid #bbb;
    font-size: 13px;
    padding: 8px 16px;
}

.fx-btn--clear:hover {
    background: #f0f0f0;
    color: #8B0100;
}

.fx-btn--small {
    padding: 7px 16px;
    font-size: 13px;
    background: #8B0100;
    color: #fff !important;
    border-radius: 4px;
}

.fx-btn--small:link,
.fx-btn--small:visited,
.fx-btn--small:hover,
.fx-btn--small:focus,
.fx-btn--small:active {
    color: #fff !important;
}

.fx-btn--small:hover {
    background: #6d0100;
    color: #fff;
}

.fx-brand-products {
    flex: 1;
    min-width: 0;
}

.fx-brand-products__header {
    margin-bottom: 16px;
}

.fx-brand-products__count {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.fx-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    transition: opacity 0.2s;
}

.fx-product-grid.fx-loading {
    opacity: 0.4;
    pointer-events: none;
}

.fx-product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fx-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.fx-product-card__image-link {
    display: block;
    width: 100%;
    /* aspect-ratio: 1 / 1; */
    overflow: hidden;
    background: #fafafa;
}

.fx-product-card__image-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.fx-product-card:hover .fx-product-card__image-link img {
    transform: scale(1.05);
}

.fx-product-card__info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.fx-product-card__title {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 8px;
    text-transform: uppercase;
    min-height: 3.9em;
}

.fx-product-card__title a {
    color: #8B0100;
    text-decoration: none;
}

.fx-product-card__title a:hover {
    text-decoration: underline;
}

.fx-product-card__price {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    margin-top: auto;
}

.fx-brand-builder-placeholder {
    padding: 24px;
    border: 1px dashed #bbb;
    border-radius: 8px;
    background: #f8f8f8;
    color: #333;
    font-family: 'Open Sans', sans-serif;
}

.fx-brand-builder-placeholder strong {
    display: block;
    font-family: 'Poppins', sans-serif;
    color: #8B0100;
    margin-bottom: 8px;
}

.fx-brand-builder-placeholder p {
    margin: 0;
}

.fx-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 15px;
}

.fx-pagination {
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
}

.fx-pagination a,
.fx-pagination span.current {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border-radius: 4px;
    text-decoration: none;
}

.fx-pagination a {
    color: #333;
    border: 1px solid #ddd;
    background: #fff;
}

.fx-pagination a:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.fx-pagination span.current {
    background: #8B0100;
    color: #fff;
    border: 1px solid #8B0100;
}

@media (max-width: 991px) {
    .fx-brand-layout {
        flex-direction: column;
    }

    .fx-brand-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .fx-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 479px) {
    .fx-product-grid {
        grid-template-columns: 1fr;
    }
}
