/* Hides the main "Filters" button container */
#loop-bundle-filters-btn-container {
    display: none !important;
}

/* Force the main filter wrapper to stack vertically instead of in a row */
.loop-filters-selector-new-wrapper .flex-row {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    align-items: center !important; /* <--- This forces the main column to the center */
}

/* Ensure the individual filter blocks take up the full width */
.loop-bundle-filter-item-container {
    width: 100% !important;
}

/* Ensure the buttons inside wrap nicely so they don't break off the screen */
.loop-bundle-filter-values {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important; /* <--- This is the crucial line pulling them to the middle */
    align-items: center !important;
    gap: 12px !important; 
    width: 100% !important;
}

/* 1. Inject the titles manually */
#filter-values-0::before { content: "How do you brew your coffee?"; }
#filter-values-1::before { content: "Whole Bean or Ground Coffee?"; }
#filter-values-2::before { content: "What brew device?"; }
#filter-values-3::before { content: "How much coffee do you drink?"; }

/* 2. Style and center the titles */
#filter-values-0::before,
#filter-values-1::before,
#filter-values-2::before,
#filter-values-3::before {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 18px !important;
    margin-bottom: 20px !important; /* Slightly increased for better balance */
    margin-top: 45px !important;    /* <--- THIS ADDS THE GAP ABOVE THE TITLES */
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Keep the very first title slightly closer to the top heading so it doesn't float too far down */
#filter-values-0::before {
    margin-top: 25px !important; 
}

/* Force the frequency buttons to wrap nicely instead of bleeding off the screen */
.loop-frequency-size-selector {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 10px !important; /* Adds a tiny safety margin on the left/right edges */
    margin-top: 45px !important; /* <--- THIS ADDS THE GAP ABOVE THE FREQUENCY TITLE */
}

/* Target the inner wrapper holding the buttons and force them to wrap */
.loop-frequency-size-selector > div, 
.loop-frequency-size-selector .flex-row {
    display: flex !important;
    flex-wrap: wrap !important; /* This is the magic command that stops the overflow */
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
}

/* Hide the 'X' icon that appears inside selected filter buttons */
.loop-bundle-filter-swatch-value svg {
    display: none !important;
}

/* Styling for the injected button icons */
.custom-btn-icon {
    width: 170px !important;       /* Adjust this number to make the icon bigger or smaller */
    height: 170px !important;
    object-fit: contain !important;
    margin-right: 8px !important; /* Adds a nice gap between the icon and the text */
}

/* Magically turn the icon white when the button is hovered OR selected */
.loop-btn-selected .custom-btn-icon,
.loop-bundle-filter-swatch-value:hover .custom-btn-icon {
    filter: brightness(0) invert(1) !important;
    transition: filter 0.2s ease-in-out !important; /* Makes the color change smooth */
}

/* Master styling for the dual-line tasting notes */
.custom-flavor-notes {
    display: flex !important;
    flex-direction: column !important; /* Forces the two lines to stack */
    width: 100% !important;
    flex-basis: 100% !important;
    text-align: center !important;
    margin-top: 6px !important;
    margin-bottom: 10px !important;
    line-height: 1.4 !important;
}

/* Specific style for Line 1: Roast Style */
.note-roast {
    font-size: 11px !important;
    letter-spacing: 1.5px !important;
    color: #040404 !important; /* Darker text to stand out */
    margin-bottom: 2px !important;
}

/* Specific style for Line 2: Flavor Profile */
.note-flavor {
    font-size: 13px !important;
    font-weight: 500 !important; /* Slightly bolder for visual hierarchy */
    letter-spacing: 1px !important;
    color: #040404 !important; /* The subtle grey from before */
}

/* ==========================================
   CUSTOM PERKS SECTION (LOOP DESCRIPTION)
   ========================================== */
.custom-perks-section {
    display: block !important;
    width: 100% !important;
    padding: 20px 0 !important;
    text-align: center !important;
}

/* The 3-column grid layout */
.perks-grid {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 15px !important;
    width: 100% !important;
}

/* Individual Perk Column */
.perk-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    flex: 1 !important; /* Makes all 3 columns equal width */
}

/* Styling the Icons */
.perk-item img.icon-img {
    width: auto !important;
    height: 60px !important; /* Size of the icons */
    object-fit: contain !important;
    margin-bottom: 15px !important; 
}

/* Styling the Perk Titles */
.perk-item h3.perk-title {
    font-size: 14px !important;
    font-weight: bold !important;
    color: #040404 !important; /* Matches your premium dark color */
    margin: 0 0 8px 0 !important;
    line-height: 1.2 !important;
}

/* Styling the Perk Description */
.perk-item p.perk-desc {
    font-size: 11px !important;
    line-height: 1.4 !important;
    color: #040404 !important;
    margin: 0 !important;
}

/* Mobile Fix: Stack them on small screens */
@media screen and (max-width: 600px) {
    .perks-grid {
        flex-direction: column !important;
        gap: 30px !important;
    }
}