/*
 * MadBaits Bundle Builder v2
 * Presentation-only refinements.
 * Scoped to bundle product pages.
 */

body.mad-bundle-product-page {
    --mbbb-v2-yellow: #fff202;
    --mbbb-v2-panel: #151515;
    --mbbb-v2-border: rgba(255,255,255,.13);
}

/* Cleaner product introduction */
body.mad-bundle-product-page .mad-bundle-product-template__hero {
    gap: clamp(18px, 2.5vw, 36px);
    padding: clamp(16px, 2vw, 26px);
    border-radius: 18px;
    box-shadow: none;
}

body.mad-bundle-product-page .mad-bundle-product-template__hero::before {
    opacity: .08;
}

body.mad-bundle-product-page .mad-bundle-product-template__summary .product_title {
    max-width: none;
    line-height: 1.12;
    font-size: clamp(1.8rem, 2.6vw, 2.55rem);
}

/* Builder container */
body.mad-bundle-product-page .mbbb-shell {
    border-radius: 18px;
}

body.mad-bundle-product-page .mbbb-builder__slots {
    gap: 12px;
}

/* Accordion steps */
body.mad-bundle-product-page .mbbb-slot {
    border: 1px solid var(--mbbb-v2-border);
    border-radius: 14px;
    overflow: hidden;
}

body.mad-bundle-product-page .mbbb-slot__trigger {
    min-height: 76px;
    padding: 16px 20px;
}

body.mad-bundle-product-page .mbbb-slot__trigger-title {
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.35;
}

body.mad-bundle-product-page .mbbb-slot__body {
    padding: 8px 18px 20px;
}

/* Easier-to-read selection cards */
body.mad-bundle-product-page .mbbb-option {
    min-height: 76px;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.mad-bundle-product-page .mbbb-option__label {
    font-size: .95rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

body.mad-bundle-product-page .mbbb-option[aria-pressed="true"],
body.mad-bundle-product-page .mbbb-option.is-selected {
    border-color: var(--mbbb-v2-yellow);
    box-shadow: inset 0 0 0 1px var(--mbbb-v2-yellow);
}

/* Progress */
body.mad-bundle-product-page .mbbb-builder__progress-bar {
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
}

/* Checkout */
body.mad-bundle-product-page .mbbb-checkout-panel {
    border-radius: 16px;
}

body.mad-bundle-product-page .mbbb-checkout-panel__actions {
    gap: 12px;
}

/* Mobile */
@media (max-width: 767px) {
    body.mad-bundle-product-page .mad-bundle-product-template__hero {
        gap: 16px;
        padding: 14px;
    }

    body.mad-bundle-product-page .mbbb-slot__trigger {
        min-height: 68px;
        padding: 14px;
    }

    body.mad-bundle-product-page .mbbb-slot__body {
        padding: 8px 12px 16px;
    }

    body.mad-bundle-product-page .mbbb-option {
        min-height: 68px;
        padding: 12px;
    }

    body.mad-bundle-product-page .mbbb-option__label {
        font-size: .92rem;
    }
}

/* MADBAITS V2 — COMPACT PREMIUM REDESIGN */

body.mad-bundle-product-page {
    --mbbb-accent: #fff200;
    --mbbb-surface: #101010;
}

/* Compact product header */
body.mad-bundle-product-page .mad-bundle-product-template__hero {
    grid-template-columns: minmax(180px, 32%) minmax(0, 1fr);
    gap: 24px;
    padding: 18px;
    border-radius: 16px;
}

body.mad-bundle-product-page .mad-bundle-product-template__media .woocommerce-product-gallery__image img.wp-post-image {
    max-height: 210px !important;
    object-fit: contain;
}

body.mad-bundle-product-page .mad-bundle-product-template__summary .product_title {
    font-size: clamp(1.6rem, 2.2vw, 2.3rem) !important;
}

body.mad-bundle-product-page .mad-bundle-product-template__summary .mad-pdp-summary-inner {
    padding: 16px !important;
}

/* Cleaner builder */
body.mad-bundle-product-page .mad-bundle-product-template__builder {
    margin-top: 20px;
}

body.mad-bundle-product-page .mbbb-shell {
    padding: 18px !important;
    background: #0c0c0c;
    border: 1px solid rgba(255,242,0,.22);
}

body.mad-bundle-product-page .mbbb-slot {
    background: #141414;
    border: 1px solid #292929;
    border-radius: 12px;
}

body.mad-bundle-product-page .mbbb-slot.is-active {
    border-color: rgba(255,242,0,.65);
}

body.mad-bundle-product-page .mbbb-slot__trigger {
    min-height: 66px;
    padding: 14px 18px;
}

body.mad-bundle-product-page .mbbb-slot__body {
    padding: 12px 18px 20px !important;
}

/* Clear, readable selections */
body.mad-bundle-product-page .mbbb-slot__options.mbbb-display-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

body.mad-bundle-product-page .mbbb-option {
    min-height: 84px !important;
    padding: 14px !important;
    border: 1px solid #333;
    border-radius: 12px;
    background: #1b1b1b;
    transition: border-color .15s, background .15s;
}

body.mad-bundle-product-page .mbbb-option:hover {
    border-color: #fff200;
    background: #252525;
}

body.mad-bundle-product-page .mbbb-option[aria-pressed="true"] {
    border: 2px solid #fff200;
    background: #302e08;
}

body.mad-bundle-product-page .mbbb-option__label {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Checkout */
body.mad-bundle-product-page .mbbb-checkout-panel {
    margin-top: 16px;
    padding: 16px;
    background: #111;
    border-radius: 14px;
}

/* Reduce description and recommendations spacing */
body.mad-bundle-product-page .mad-bundle-product-template__after {
    margin-top: 24px;
}

body.mad-bundle-product-page .woocommerce-tabs {
    margin-bottom: 24px;
}

/* Tablet */
@media (max-width: 1023px) {
    body.mad-bundle-product-page .mbbb-slot__options.mbbb-display-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */
@media (max-width: 767px) {
    body.mad-bundle-product-page .mad-bundle-product-template__hero {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }

    body.mad-bundle-product-page .mad-bundle-product-template__media .woocommerce-product-gallery__image img.wp-post-image {
        max-height: 160px !important;
    }

    body.mad-bundle-product-page .mbbb-shell {
        padding: 10px !important;
    }

    body.mad-bundle-product-page .mbbb-slot__options.mbbb-display-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.mad-bundle-product-page .mbbb-option {
        min-height: 76px !important;
        padding: 12px !important;
    }
}

/* MadBaits v2 — grouped configurator */

body.mad-bundle-product-page .mbbb-v2-group-heading {
    margin: 30px 0 12px;
    padding: 20px 22px;
    background: linear-gradient(120deg, #202000, #111);
    border-left: 4px solid #fff200;
    border-radius: 12px;
}

body.mad-bundle-product-page .mbbb-v2-group-heading:first-child {
    margin-top: 0;
}

body.mad-bundle-product-page .mbbb-v2-group-heading h2 {
    margin: 0 0 6px;
    color: #fff200;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 800;
    line-height: 1.2;
}

body.mad-bundle-product-page .mbbb-v2-group-heading p {
    margin: 0;
    color: #ddd;
    font-size: .92rem;
}

body.mad-bundle-product-page .mbbb-slot {
    margin-bottom: 4px;
}

body.mad-bundle-product-page .mbbb-v2-group-boilies {
    border-left: 2px solid rgba(255,242,0,.5);
}

body.mad-bundle-product-page .mbbb-v2-group-hookbaits {
    border-left: 2px solid rgba(255,242,0,.35);
}

body.mad-bundle-product-page .mbbb-v2-group-liquids {
    border-left: 2px solid rgba(255,242,0,.35);
}

@media (max-width: 767px) {
    body.mad-bundle-product-page .mbbb-v2-group-heading {
        margin-top: 22px;
        padding: 16px;
    }

    body.mad-bundle-product-page .mbbb-v2-group-heading h2 {
        font-size: 1.15rem;
    }
}

/* ====================================================
   MADBAITS V2 — PROGRESS LAYOUT CORRECTION
   ==================================================== */

/* Remove conflicting sticky positioning */
body.mad-bundle-product-page.single-product .mbbb-progress-dock {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: 1 !important;
    margin: 0 0 18px !important;
    padding: 14px 18px !important;
    transform: none !important;
}

/* Keep progress and groups in normal document flow */
body.mad-bundle-product-page.single-product .mbbb-builder {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow: visible !important;
}

body.mad-bundle-product-page.single-product .mbbb-builder__slots {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
}

/* Stop headings being covered */
body.mad-bundle-product-page.single-product .mbbb-v2-group-heading {
    position: relative !important;
    z-index: 1 !important;
    clear: both !important;
    scroll-margin-top: 110px;
}

/* Compact the progress section */
body.mad-bundle-product-page.single-product .mbbb-progress-dock__inner {
    padding: 0 !important;
    margin: 0 !important;
}

body.mad-bundle-product-page.single-product .mbbb-builder__progress {
    margin: 4px 0 8px !important;
    line-height: 1.3 !important;
}

body.mad-bundle-product-page.single-product .mbbb-builder__progress-bar {
    height: 6px !important;
}

/* Prevent unnecessary spacer height */
body.mad-bundle-product-page.single-product .mbbb-builder-spacer {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
}

/* Mobile */
@media (max-width: 767px) {
    body.mad-bundle-product-page.single-product .mbbb-progress-dock {
        padding: 12px !important;
        margin-bottom: 14px !important;
    }
}


/* MadBaits v2 — Bundle added confirmation */

body.mbbb-product .mbbb-success:not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

body.mbbb-product .mbbb-success__backdrop {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(0,0,0,.82) !important;
}

body.mbbb-product .mbbb-success__sheet {
    position: relative !important;
    width: min(100%, 540px) !important;
    max-width: 540px !important;
    max-height: min(85dvh, 760px) !important;
    overflow-y: auto !important;
    margin: 0 auto !important;
    padding: 28px !important;
    border: 1px solid rgba(255,242,0,.45) !important;
    border-radius: 20px !important;
    background: #111 !important;
    box-shadow: 0 30px 90px rgba(0,0,0,.7) !important;
    transform: none !important;
}

body.mbbb-product .mbbb-success__title {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
    margin-bottom: 10px !important;
}

body.mbbb-product .mbbb-success__lead {
    font-size: .95rem !important;
    line-height: 1.5 !important;
}

body.mbbb-product .mbbb-success__list {
    max-height: 280px !important;
    overflow-y: auto !important;
    margin: 18px 0 !important;
}

body.mbbb-product .mbbb-success__actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

body.mbbb-product .mbbb-success__btn {
    width: 100% !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 12px !important;
    border-radius: 10px !important;
}

body.mbbb-product .mbbb-success__btn--ghost {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    body.mbbb-product .mbbb-success:not([hidden]) {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    body.mbbb-product .mbbb-success__sheet {
        width: 100% !important;
        max-width: none !important;
        max-height: 88dvh !important;
        margin: 0 !important;
        padding: 24px 18px !important;
        border-radius: 20px 20px 0 0 !important;
    }
}


/* =====================================================
   MADBAITS BUNDLE BUILDER — FINAL UI REFINEMENTS
   ===================================================== */

/* Full-width progress indicator */
body.mad-bundle-product-page.single-product #mbbb-progress-dock {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    align-self: stretch !important;
    flex: 0 0 auto !important;
    margin: 0 0 20px !important;
    padding: 16px 20px !important;
    box-sizing: border-box !important;
}

body.mad-bundle-product-page #mbbb-progress-dock .mbbb-progress-dock__inner {
    width: 100% !important;
    max-width: none !important;
}

body.mad-bundle-product-page #mbbb-progress-text {
    font-size: 1rem !important;
    font-weight: 700 !important;
}

body.mad-bundle-product-page #mbbb-progress-dock .mbbb-builder__progress-bar {
    display: block !important;
    width: 100% !important;
    height: 7px !important;
    margin-top: 10px !important;
}

/* Cleaner group headings */
body.mad-bundle-product-page .mbbb-v2-group-heading {
    margin: 22px 0 12px !important;
    padding: 16px 20px !important;
    border-radius: 10px !important;
    background: linear-gradient(100deg, #1d1d09, #101010) !important;
}

/* Improve selection readability */
body.mad-bundle-product-page .mbbb-option {
    min-height: 86px !important;
    padding: 16px !important;
    text-align: left !important;
}

body.mad-bundle-product-page .mbbb-option__label {
    font-size: 1rem !important;
    font-weight: 650 !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
}

/* More obvious selection feedback */
body.mad-bundle-product-page .mbbb-option[aria-pressed="true"],
body.mad-bundle-product-page .mbbb-option.is-selected {
    border: 2px solid #fff200 !important;
    background: #302d0b !important;
    box-shadow: inset 0 0 0 1px rgba(255,242,0,.3) !important;
}

body.mad-bundle-product-page .mbbb-slot.is-complete {
    border-color: rgba(255,242,0,.4) !important;
}

/* Checkout focus */
body.mad-bundle-product-page #mbbb-checkout-panel {
    margin-top: 18px !important;
    padding: 16px !important;
    border-radius: 12px !important;
}

body.mad-bundle-product-page .single_add_to_cart_button {
    min-height: 52px !important;
    font-weight: 800 !important;
}

/* Remove redundant trust strip below builder.
   Keep product-header reassurance. */
body.mad-bundle-product-page .mbbb-trust-strip {
    display: none !important;
}

/* Compact related products */
body.mad-bundle-product-page .mad-bundle-product-template__after {
    margin-top: 28px !important;
}

body.mad-bundle-product-page .related.products,
body.mad-bundle-product-page .upsells.products {
    margin-top: 24px !important;
    padding: 18px !important;
    border-radius: 14px !important;
}

body.mad-bundle-product-page .related.products h2,
body.mad-bundle-product-page .upsells.products h2 {
    margin-bottom: 14px !important;
}

/* Mobile refinements */
@media (max-width: 767px) {
    body.mad-bundle-product-page.single-product #mbbb-progress-dock {
        padding: 14px !important;
        margin-bottom: 16px !important;
    }

    body.mad-bundle-product-page .mbbb-v2-group-heading {
        padding: 14px !important;
        margin-top: 18px !important;
    }

    body.mad-bundle-product-page .mbbb-option {
        min-height: 76px !important;
        padding: 12px !important;
    }

    body.mad-bundle-product-page .mbbb-option__label {
        font-size: .93rem !important;
    }

    body.mad-bundle-product-page .related.products,
    body.mad-bundle-product-page .upsells.products {
        padding: 12px !important;
    }
}


/* MadBaits v2 — integrated review and checkout */

body.mad-bundle-product-page .mbbb-v2-review {
    margin: 18px 0;
    padding: clamp(18px, 2vw, 28px);
    border: 1px solid rgba(255,242,0,.28);
    border-radius: 16px;
    background: linear-gradient(145deg, #171717, #0b0b0b);
}

body.mad-bundle-product-page .mbbb-v2-review__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

body.mad-bundle-product-page .mbbb-v2-review__kicker {
    color: #fff200;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
}

body.mad-bundle-product-page .mbbb-v2-review h2 {
    margin: 5px 0 0;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

body.mad-bundle-product-page .mbbb-v2-review__price {
    color: #fff200;
    font-size: 1.4rem;
    white-space: nowrap;
}

body.mad-bundle-product-page .mbbb-v2-review__progress {
    margin: 12px 0;
    color: #ccc;
}

body.mad-bundle-product-page .mbbb-v2-review__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

body.mad-bundle-product-page .mbbb-v2-review__list li {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    border: 1px solid #303030;
    border-radius: 9px;
    background: #191919;
}

body.mad-bundle-product-page .mbbb-v2-review__list li span {
    color: #aaa;
    font-size: .8rem;
}

body.mad-bundle-product-page .mbbb-v2-review__list li strong {
    color: #fff;
    font-size: .95rem;
}

/* Hide early PayPal presentation without deleting its buttons. */
body.mad-bundle-product-page:not(.mbbb-bundle-complete)
.mad-bundle-product-template__summary .ppc-button-wrapper {
    position: absolute !important;
    left: -10000px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Completed bundle: express payment below the builder. */
body.mad-bundle-product-page .mbbb-express-checkout:not([hidden]) {
    display: block;
    margin: 18px 0 !important;
    padding: 20px !important;
    border: 1px solid rgba(255,242,0,.25);
    border-radius: 14px;
    background: #111;
}

body.mad-bundle-product-page .mbbb-v2-details-toggle {
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 20px 0;
    padding: 12px 18px;
    border: 1px solid rgba(255,242,0,.4);
    border-radius: 10px;
    background: #171717;
    color: #fff200;
    font-weight: 700;
    cursor: pointer;
}

body.mad-bundle-product-page
.woocommerce-Tabs-panel--description[hidden] {
    display: none !important;
}

/* Smaller related-product area */
body.mad-bundle-product-page
.mad-bundle-product-template__after .mad-session-upsell {
    padding: 16px !important;
}

body.mad-bundle-product-page
.mad-bundle-product-template__after .mad-session-upsell .products
> li:nth-child(n+3) {
    display: none !important;
}

@media (max-width: 767px) {
    body.mad-bundle-product-page .mbbb-v2-review__list {
        grid-template-columns: 1fr;
    }

    body.mad-bundle-product-page .mbbb-v2-review__head {
        align-items: flex-start;
    }

    body.mad-bundle-product-page .mbbb-v2-review__price {
        font-size: 1.1rem;
    }
}
