/* ============================================================
   AMS PILL FILTER — v8.0
   Black pills with white text. Pink hover & active state.
   Multi-instance compatible. Smart directional fade. Mobile-safe.
   ============================================================ */

/* ── Brand colors as CSS variables ── */
:root {
    --ams-pill-bg:           #1a1a1a;
    --ams-pill-color:        #ffffff;
    --ams-pill-border:       #1a1a1a;

    --ams-pill-hover-bg:     #E14A5C;
    --ams-pill-hover-color:  #ffffff;
    --ams-pill-hover-border: #E14A5C;

    --ams-pill-active-bg:    #E14A5C;
    --ams-pill-active-color: #ffffff;
    --ams-pill-active-border:#E14A5C;

    --ams-scrollbar-thumb:   #1a1a1a;
    --ams-scrollbar-track:   #f0f0f0;
}

/* ============================================================
   WRAPPER
   ============================================================ */

.ams-filter-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.ams-filter-instance + .ams-filter-instance {
    margin-top: 0;
    padding-top: 0;
}

/* Empty placeholder — keeps wrapper present for AJAX swap matching */
.ams-filter-empty {
    display: none !important;
}

/* ============================================================
   TIER ROW
   ============================================================ */

.ams-filter-tier {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 50px;
    width: 100%;
}

.ams-filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    white-space: nowrap;
    min-width: 110px;
    flex-shrink: 0;
}

/* ============================================================
   PILL TRACK — horizontally scrollable + smart directional fade
   ============================================================ */

.ams-pills-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 6px 8px 14px;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 60px;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
    scrollbar-color: var(--ams-scrollbar-thumb) var(--ams-scrollbar-track);

    transition: -webkit-mask-image 0.25s ease, mask-image 0.25s ease;
}

/* Default (overflowing): fade right edge only */
.ams-pills-track.is-overflowing {
    -webkit-mask-image: linear-gradient(
        to right,
        #000 0,
        #000 calc(100% - 32px),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        #000 0,
        #000 calc(100% - 32px),
        transparent 100%
    );
}

/* Scrolled away from start AND not at end: fade BOTH edges */
.ams-pills-track.is-overflowing.scrolled-from-start:not(.scrolled-to-end) {
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 32px,
        #000 calc(100% - 32px),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 32px,
        #000 calc(100% - 32px),
        transparent 100%
    );
}

/* Scrolled all the way to end: fade LEFT edge only */
.ams-pills-track.is-overflowing.scrolled-to-end {
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 32px,
        #000 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 32px,
        #000 100%
    );
}

/* WebKit scrollbar */
.ams-pills-track::-webkit-scrollbar {
    height: 6px;
    display: block;
}

.ams-pills-track::-webkit-scrollbar-track {
    background: var(--ams-scrollbar-track);
    border-radius: 3px;
}

.ams-pills-track::-webkit-scrollbar-thumb {
    background: var(--ams-scrollbar-thumb);
    border-radius: 3px;
}

.ams-pills-track::-webkit-scrollbar-thumb:hover {
    background: var(--ams-pill-hover-bg);
}

.ams-pills-track.is-grabbable {
    cursor: grab;
}

.ams-pills-track.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.ams-pills-track.is-dragging .ams-pill {
    pointer-events: none;
}

/* ============================================================
   PILL — bigger, black bg, white text
   ============================================================ */

.ams-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 3px;
    border: 1.5px solid #8c8c8c;
    background: #fff;
    color: #000!important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color 0.30s ease,
                border-color     0.30s ease,
                color            0.30s ease,
                transform        0.12s ease;
    flex-shrink: 0;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.ams-pill:hover,
.ams-pill:focus-visible {
    background: var(--ams-pill-hover-bg);
    color: var(--ams-pill-hover-color) !important;
    border-color: var(--ams-pill-hover-border);
    text-decoration: none !important;
    outline: none;
}

.ams-pill.active {
    background: var(--ams-pill-active-bg);
    color: var(--ams-pill-active-color) !important;
    border-color: var(--ams-pill-active-border);
}

.ams-pill.active:hover {
    background: var(--ams-pill-active-bg);
    border-color: var(--ams-pill-active-border);
    filter: brightness(0.92);
}

.ams-pill:active:not(.is-dragging) {
    transform: scale(0.97);
}

/* ============================================================
   CLEAR FILTERS BUTTON
   ============================================================ */

.ams-filter-actions {
    padding-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ams-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #666 !important;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 999px;
    text-decoration: none !important;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.ams-clear-btn:hover,
.ams-clear-btn:focus-visible {
    color: #fff !important;
    border-color: var(--ams-pill-hover-bg);
    background: var(--ams-pill-hover-bg);
    text-decoration: none !important;
    outline: none;
}

/* ============================================================
   ARCHIVE INTRO BLOCK
   ============================================================ */

.ams-archive-intro {
    background: #f8f8f8;
    border-left: 3px solid var(--ams-pill-bg);
    padding: 14px 18px;
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.75;
    color: #555;
    border-radius: 0 4px 4px 0;
}

.ams-archive-intro p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   WOODMART GRID COMPATIBILITY
   ============================================================ */

.elementor-widget-wd_archive_products .products.wd-products {
    transition: opacity 0.2s ease;
}

/* ============================================================
   TABLET (768px – 1024px)
   ============================================================ */

@media (min-width: 768px) and (max-width: 1024px) {

    .ams-filter-label {
        min-width: 90px;
        font-size: 10px;
    }

    .ams-pill {
        padding: 11px 22px;
        font-size: 13.5px;
    }

    .ams-pills-track {
        gap: 16px;
    }
  
}

/* ============================================================
   MOBILE (≤ 767px)
   ============================================================ */

@media (max-width: 767px) {

    .ams-filter-wrap {
        gap: 14px;
        padding: 12px 0;
    }

    .ams-filter-tier {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        min-height: unset;
    }

    .ams-filter-label {
        min-width: unset;
        font-size: 11px;
    }

    .ams-pills-track {
        width: 100%;
        gap: 16px;
        padding: 4px 7px 12px;
    }

    .ams-pill {
        padding: 10px 20px;
        font-size: 13px;
    }

    .ams-clear-btn {
        padding: 7px 13px;
        font-size: 12.5px;
    }

    .ams-filter-actions {
        width: 100%;
    }
}

/* ============================================================
   VERY SMALL (≤ 380px)
   ============================================================ */

@media (max-width: 380px) {
    .ams-pill {
        padding: 9px 17px;
        font-size: 12.5px;
    }

    .ams-pills-track {
        gap: 8px;
    }
}

/* ============================================================
   RTL SUPPORT
   ============================================================ */

[dir="rtl"] .ams-pills-track {
    direction: rtl;
}

[dir="rtl"] .ams-archive-intro {
    border-left: none;
    border-right: 3px solid var(--ams-pill-bg);
    border-radius: 4px 0 0 4px;
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
    .ams-filter-wrap,
    .ams-filter-actions {
        display: none !important;
    }
}


/* ============================================================
   FAQ ACCORDION — Clean minimalist design
   ============================================================ */

.ams-faq-block {
    width: 100%;
    margin: 48px auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* Title */
.ams-faq-title {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    color: #1a1a1a;
    margin: 0 0 32px 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Accordion list */
.ams-faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Each FAQ card */
.ams-faq-item {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.ams-faq-item:hover {
    border-color: #d8d8d8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ams-faq-item[open] {
    border-color: #e5e5e5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Question (clickable header) */
.ams-faq-question {
    list-style: none;
    cursor: pointer;
    padding: 20px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.4;
    transition: background 0.15s ease;
}

.ams-faq-question::-webkit-details-marker,
.ams-faq-question::marker {
    display: none;
    content: '';
}

.ams-faq-question:hover {
    background: #fafafa;
}

/* Plus / X icon */
.ams-faq-icon {
    position: relative;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ams-faq-icon::before,
.ams-faq-icon::after {
    content: '';
    position: absolute;
    background: #888;
    border-radius: 1px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.2s ease;
}

/* Horizontal bar */
.ams-faq-icon::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

/* Vertical bar */
.ams-faq-icon::after {
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

/* Open: rotate to form X */
.ams-faq-item[open] .ams-faq-icon::before {
    transform: translateY(-50%) rotate(45deg);
    background: #1a1a1a;
}

.ams-faq-item[open] .ams-faq-icon::after {
    transform: translateX(-50%) rotate(45deg);
    background: #1a1a1a;
}

/* Answer container */
.ams-faq-answer-wrap {
    overflow: hidden;
}

.ams-faq-answer {
    padding: 0 24px 22px;
    font-size: 14.5px;
    line-height: 1.75;
    color: #555;
    animation: ams-faq-slide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ams-faq-answer p {
    margin: 0 0 12px 0;
}

.ams-faq-answer p:last-child {
    margin-bottom: 0;
}

.ams-faq-answer ul,
.ams-faq-answer ol {
    margin: 12px 0 12px 22px;
}

.ams-faq-answer li {
    margin-bottom: 6px;
}

.ams-faq-answer a {
    color: #ec4899;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    transition: color 0.15s ease;
}

.ams-faq-answer a:hover {
    color: #db2777;
}

@keyframes ams-faq-slide {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Mobile ─────────────────────────────────────────────── */

@media (max-width: 767px) {
    .ams-faq-block {
        max-width: 100%;
        margin: 32px auto;
    }

    .ams-faq-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .ams-faq-question {
        padding: 16px 18px;
        font-size: 14px;
    }

    .ams-faq-answer {
        padding: 0 18px 18px;
        font-size: 13.5px;
    }

    .ams-faq-item {
        border-radius: 12px;
    }
}