/*
 * style-u-core — wp-overrides.css
 * Overrides WordPress's default global button/block styles that
 * break the Style-U design system components.
 *
 * Loaded with every shortcode: [styleu_homepage], [styleu_catalogue], [styleu_packages]
 */

/* ─────────────────────────────────────────────────────────
   1. GLOBAL BUTTON RESET
   WordPress 6.x adds global styles that set border-radius,
   background, border, font-size on all <button> elements.
   We undo those here for every button inside the shortcodes.
───────────────────────────────────────────────────────── */
.catalogue .cat-tab,
.catalogue .cat-chip,
.faq-q,
.cat-controls .lhs button,
.cat-controls .mid button,
.cat-controls .view-toggle button,
.bento-card button,
.style-card .fave,
.style-card .quick-actions button,
.btn-pay,
.meas-tab,
.billing-toggle button {
    font-family: 'Geist', 'Helvetica Neue', sans-serif !important;
    letter-spacing: inherit !important;
    text-transform: inherit !important;
}

/* ─────────────────────────────────────────────────────────
   2. CATALOGUE TABS — must stay on one line, never wrap
───────────────────────────────────────────────────────── */
.cat-tabs {
    flex-wrap: nowrap !important;
}
.cat-tab {
    display: inline-flex !important;
    width: auto !important;
    min-width: 0 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    border-radius: 100px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.cat-tab.active {
    background: #fff !important;
    color: #0a0a0f !important;
}

/* ─────────────────────────────────────────────────────────
   3. FILTER CHIPS — horizontal scroll on mobile, no wrapping
───────────────────────────────────────────────────────── */
.cat-filters {
    display: flex !important;
}
.cat-chip {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    border-radius: 100px !important;
    background: transparent !important;
    box-shadow: none !important;
}
@media (max-width: 1100px) {
    .cat-tabs {
        flex-wrap: nowrap !important;
    }
    .cat-filters {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }
    .cat-filters::-webkit-scrollbar { display: none; }
}
/* Same scroll treatment for catalogue page controls */
.cat-controls .mid {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cat-controls .mid::-webkit-scrollbar { display: none; }
.cat-controls .lhs {
    flex-wrap: nowrap !important;
}
.cat-controls .lhs button {
    display: inline-flex !important;
    width: auto !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    border-radius: 100px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.cat-controls .lhs button.active {
    background: #fff !important;
    color: #0a0a0f !important;
}

/* ─────────────────────────────────────────────────────────
   4. FAQ ITEMS — override WordPress button styles on .faq-q
───────────────────────────────────────────────────────── */
.faq-item {
    border: 1px solid var(--hair) !important;
    border-radius: 14px !important;
    padding: 0 24px !important;
    margin-bottom: 8px !important;
    background: var(--surface) !important;
    transition: border-color .2s, background .2s !important;
    overflow: hidden !important;
}
.faq-item:hover {
    border-color: var(--hair-2) !important;
}
.faq-item.open {
    border-color: rgba(163,123,255,0.35) !important;
    background: linear-gradient(180deg, rgba(163,123,255,0.05) 0%, var(--surface) 100%) !important;
}
.faq-q {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    gap: 18px !important;
    align-items: center !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 20px 0 !important;
    text-align: left !important;
    color: inherit !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    font-family: 'Geist', 'Helvetica Neue', sans-serif !important;
    letter-spacing: -0.01em !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer !important;
}
.faq-q:focus {
    outline: none !important;
    box-shadow: none !important;
}
.faq-q .qn {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 11px !important;
    letter-spacing: 0.14em !important;
    color: var(--purple) !important;
    flex-shrink: 0 !important;
}
.faq-q .plus {
    font-size: 22px !important;
    color: var(--dim-2) !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    background: none !important;
    border: none !important;
    transition: transform .25s, color .25s !important;
}
.faq-item.open .faq-q .plus {
    transform: rotate(45deg) !important;
    color: var(--purple) !important;
}
.faq-a {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height .35s cubic-bezier(.2,.7,.3,1) !important;
    padding: 0 !important;
}
.faq-item.open .faq-a {
    max-height: 400px !important;
    padding: 0 0 22px 56px !important;
}
.faq-a p {
    margin: 0 !important;
    color: var(--dim) !important;
    line-height: 1.65 !important;
    font-size: 14.5px !important;
}

/* ─────────────────────────────────────────────────────────
   5. REMOVE WPAUTOP INTERFERENCE
   WordPress's wpautop filter wraps orphaned text in <p> tags
   which adds unwanted spacing inside component containers.
───────────────────────────────────────────────────────── */
.faq-grid > div > p:empty,
.faq-list > p:empty,
.cat-marquee > p,
section > .container > p:empty,
.bento > p:empty,
.catalogue-grid > p:empty,
.hero-showcase > p:empty,
.steps-row > p:empty,
.pricing > p:empty,
.quotes > p:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

/* ─────────────────────────────────────────────────────────
   6. VIEW TOGGLE BUTTONS (catalogue page)
───────────────────────────────────────────────────────── */
.view-toggle button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    color: var(--dim-2) !important;
    padding: 6px 10px !important;
    cursor: pointer !important;
}
.view-toggle button.active {
    background: rgba(255,255,255,0.08) !important;
    color: #fff !important;
}

/* ─────────────────────────────────────────────────────────
   7. SORT DROPDOWN (catalogue page)
───────────────────────────────────────────────────────── */
.cat-controls .sort summary {
    list-style: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.cat-controls .sort summary::-webkit-details-marker { display: none !important; }
.cat-controls .sort .menu button {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    padding: 8px 12px !important;
    cursor: pointer !important;
}
