/* =================================================================
   Musana Loop Filter v1.1 — Styles
   Brand palette:
     Dark teal    #00383E
     Mid teal     #004D55
     Accent gold  #FF8F00
     Gold hover   #E67E00
     Cream        #FDF6EC
     Cream dim    #D4C9B8
     Body dark    #2D2D2D
   ================================================================= */

:root {
    --mlf-dark:       #00383E;
    --mlf-dark-mid:   #004D55;
    --mlf-gold:       #FF8F00;
    --mlf-gold-hover: #E67E00;
    --mlf-cream:      #FDF6EC;
    --mlf-cream-dim:  #D4C9B8;
    --mlf-white:      #ffffff;
    --mlf-black:      #2D2D2D;
    --mlf-border:     rgba(255,255,255,.15);
    --mlf-radius:     8px;
    --mlf-ease:       .25s cubic-bezier(.4,0,.2,1);
}

/* ------------------------------------------------------------------ *
 *  DESKTOP FILTER BAR
 * ------------------------------------------------------------------ */
.mlf-bar {
    position: relative;
    z-index: 50;
    background: var(--mlf-dark);
    border-bottom: 1px solid var(--mlf-border);
}
.mlf-bar__inner {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
}

/* Labels */
.mlf-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mlf-gold);
}

/* Field sizing */
.mlf-field           { flex: 1 1 0%; min-width: 0; }
.mlf-field--search   { flex: 1.3; }
.mlf-field--reset    { flex: 0 0 auto; align-self: flex-end; }

/* Inputs + selects */
.mlf-input,
.mlf-select {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--mlf-cream);
    background: var(--mlf-dark-mid);
    border: 1px solid var(--mlf-border);
    border-radius: var(--mlf-radius);
    outline: none;
    transition: border-color var(--mlf-ease), box-shadow var(--mlf-ease);
    -webkit-appearance: none;
    appearance: none;
}
.mlf-input::placeholder { color: var(--mlf-cream-dim); opacity: .55; }
.mlf-input:focus,
.mlf-select:focus {
    border-color: var(--mlf-gold);
    box-shadow: 0 0 0 3px rgba(255,143,0,.18);
}

/* Select arrow */
.mlf-select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23D4C9B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    cursor: pointer;
}
.mlf-select option { background: var(--mlf-dark); color: var(--mlf-cream); }

/* Search icon */
.mlf-input-wrap { position: relative; }
.mlf-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--mlf-cream-dim);
    opacity: .5;
    pointer-events: none;
}
.mlf-field--search .mlf-input { padding-right: 38px; }

/* Reset button */
.mlf-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--mlf-cream-dim);
    background: transparent;
    border: 1px solid var(--mlf-border);
    border-radius: var(--mlf-radius);
    cursor: pointer;
    transition: all var(--mlf-ease);
    white-space: nowrap;
}
.mlf-reset-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.mlf-reset-btn:hover {
    color: var(--mlf-gold);
    border-color: var(--mlf-gold);
    background: rgba(255,143,0,.06);
}

/* ------------------------------------------------------------------ *
 *  PER-SECTION LOADER OVERLAY
 * ------------------------------------------------------------------ */
.mlf-loader-wrap { position: relative; }

.mlf-loader-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    border-radius: 4px;
}
.mlf-loader-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.mlf-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(0,56,62,.1);
    border-top-color: var(--mlf-gold);
    border-radius: 50%;
    animation: mlf-spin .65s linear infinite;
}
@keyframes mlf-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ *
 *  NO RESULTS + SECTION HIDE
 * ------------------------------------------------------------------ */
.mlf-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    font-size: 15px;
    color: #888;
    font-style: italic;
}
.mlf-section-hidden { display: none !important; }

/* ------------------------------------------------------------------ *
 *  MOBILE TRIGGER
 * ------------------------------------------------------------------ */
.mlf-mobile-trigger {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 48px);
    max-width: 420px;
    margin: 0 auto;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--mlf-cream);
    background: var(--mlf-dark-mid);
    border: 1px solid var(--mlf-border);
    border-radius: 40px;
    cursor: pointer;
    transition: all var(--mlf-ease);
}
.mlf-mobile-trigger svg { width: 18px; height: 18px; flex-shrink: 0; }
.mlf-mobile-trigger:hover { border-color: var(--mlf-gold); }

.mlf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px; height: 20px;
    padding: 0 6px;
    font-size: 11px; font-weight: 700;
    color: var(--mlf-dark);
    background: var(--mlf-gold);
    border-radius: 20px;
}

/* ------------------------------------------------------------------ *
 *  MOBILE DRAWER
 * ------------------------------------------------------------------ */
.mlf-drawer {
    position: fixed;
    inset: 0;
    z-index: 99999;
    visibility: hidden;
    pointer-events: none;
}
.mlf-drawer.is-open { visibility: visible; pointer-events: auto; }

.mlf-drawer__overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.55);
    opacity: 0;
    transition: opacity .3s ease;
}
.mlf-drawer.is-open .mlf-drawer__overlay { opacity: 1; }

.mlf-drawer__panel {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 340px; max-width: 90vw;
    display: flex;
    flex-direction: column;
    background: var(--mlf-dark);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    box-shadow: -4px 0 30px rgba(0,0,0,.3);
}
.mlf-drawer.is-open .mlf-drawer__panel { transform: translateX(0); }

.mlf-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--mlf-border);
}
.mlf-drawer__header h3 {
    margin: 0;
    font-size: 16px; font-weight: 700;
    color: var(--mlf-cream);
    letter-spacing: .02em;
}
.mlf-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--mlf-border);
    border-radius: 50%;
    color: var(--mlf-cream-dim);
    cursor: pointer;
    transition: all var(--mlf-ease);
}
.mlf-drawer__close:hover { border-color: var(--mlf-gold); color: var(--mlf-gold); }
.mlf-drawer__close svg { width: 18px; height: 18px; }

.mlf-drawer__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px;
}
.mlf-drawer-field { margin-bottom: 20px; }
.mlf-drawer-field:last-child { margin-bottom: 0; }

.mlf-drawer__footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--mlf-border);
}
.mlf-drawer-reset {
    flex: 0 0 auto;
    padding: 0 20px;
    height: 44px;
    font-family: inherit;
    font-size: 13px; font-weight: 600;
    color: var(--mlf-cream-dim);
    background: transparent;
    border: 1px solid var(--mlf-border);
    border-radius: var(--mlf-radius);
    cursor: pointer;
    transition: all var(--mlf-ease);
}
.mlf-drawer-reset:hover { color: var(--mlf-gold); border-color: var(--mlf-gold); }

.mlf-drawer-apply {
    flex: 1 1 0%;
    height: 44px;
    font-family: inherit;
    font-size: 14px; font-weight: 700;
    letter-spacing: .03em;
    color: var(--mlf-dark);
    background: var(--mlf-gold);
    border: none;
    border-radius: var(--mlf-radius);
    cursor: pointer;
    transition: background var(--mlf-ease);
}
.mlf-drawer-apply:hover { background: var(--mlf-gold-hover); }

/* ------------------------------------------------------------------ *
 *  CUSTOM LOAD-MORE BUTTON (filtered state)
 * ------------------------------------------------------------------ */
.mlf-load-more {
    display: flex;
    justify-content: center;
    padding: 24px 0 4px;
}
.mlf-load-more button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    font-family: inherit;
    font-size: 14px; font-weight: 600;
    color: var(--mlf-black);
    background: transparent;
    border: 1.5px solid var(--mlf-black);
    border-radius: 40px;
    cursor: pointer;
    transition: all var(--mlf-ease);
}
.mlf-load-more button:hover {
    background: var(--mlf-black);
    color: var(--mlf-white);
}
.mlf-load-more button .mlf-btn-spin {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(0,0,0,.15);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: mlf-spin .6s linear infinite;
}
.mlf-load-more button.is-loading .mlf-btn-spin { display: block; }
.mlf-load-more button:disabled { opacity: .6; cursor: default; }

/* ------------------------------------------------------------------ *
 *  FALLBACK CARD (shown when template_id = 0)
 * ------------------------------------------------------------------ */
.mlf-fallback-card a { color: var(--mlf-dark); text-decoration: none; }
.mlf-fallback-card a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ *
 *  RESPONSIVE
 * ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .mlf-bar { display: none !important; }
    .mlf-mobile-trigger { display: inline-flex; }
}
