/* ==========================================================================
   BahaMoments — Custom Shortcode Styling
   Pairs with [bahamoments_search] shortcode from bahamoments-search-filter.php
   Paste into: Appearance → Customize → Additional CSS
   ========================================================================== */

:root {
    --bm-primary: #F4A100;
    --bm-primary-hover: #E09000;
    --bm-dark: #0B2A3A;
    --bm-muted: #6B7B85;
    --bm-line: #E5EAEE;
    --bm-bg: #FFFFFF;
    --bm-shadow-pill: 0 12px 40px rgba(11, 42, 58, .18);
    --bm-shadow-card: 0 6px 24px rgba(11, 42, 58, .08);
    --bm-font: 'Poppins', system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   1. HERO SEARCH PILL
   ========================================================================== */
.bm-hero-search {
    max-width: 980px;
    margin: 0 auto;
    background: var(--bm-bg);
    border-radius: 999px;
    padding: 14px 14px 14px 28px;
    box-shadow: var(--bm-shadow-pill);
    display: flex;
    align-items: center;
    font-family: var(--bm-font);
    color: var(--bm-dark);
    position: relative;
    z-index: 5;
}

.bm-field {
    flex: 1;
    padding: 6px 22px;
    border-right: 1px solid var(--bm-line);
    position: relative;
}
.bm-field:last-of-type { border-right: none; }

/* Icon before each label */
.bm-field::before {
    content: "";
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: .8;
    pointer-events: none;
}
.bm-field.bm-loc::before,
.bm-field.bm-cat::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230B2A3A'><path d='M12 2C7.6 2 4 5.6 4 10c0 5.5 7 11.5 7.3 11.7.4.4 1 .4 1.4 0C13 21.5 20 15.5 20 10c0-4.4-3.6-8-8-8zm0 11a3 3 0 110-6 3 3 0 010 6z'/></svg>");
}
.bm-field.bm-in::before,
.bm-field.bm-out::before,
.bm-field.bm-when::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230B2A3A'><path d='M19 4h-2V2h-2v2H9V2H7v2H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm0 16H5V9h14v11z'/></svg>");
}

.bm-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--bm-dark);
    margin: 0 0 2px 22px;
    cursor: pointer;
}

.bm-field select,
.bm-field input[type="text"] {
    border: none !important;
    background: transparent !important;
    padding: 0 0 0 22px !important;
    margin: 0 !important;
    font-family: var(--bm-font);
    font-size: 13px;
    color: var(--bm-muted);
    width: 100%;
    box-shadow: none !important;
    outline: none !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    height: auto !important;
    line-height: 1.4;
}
.bm-field select:focus,
.bm-field input:focus {
    color: var(--bm-dark);
}
.bm-field select option {
    color: var(--bm-dark);
}

/* Search button */
.bm-search-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bm-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    transition: background .2s ease, transform .2s ease;
    flex-shrink: 0;
    padding: 0;
}
.bm-search-btn svg {
    width: 22px;
    height: 22px;
}
.bm-search-btn:hover {
    background: var(--bm-primary-hover);
    transform: scale(1.05);
}

/* Flatpickr tweaks to match brand */
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--bm-primary) !important;
    border-color: var(--bm-primary) !important;
}
.flatpickr-day.today {
    border-color: var(--bm-primary);
}

/* ==========================================================================
   2. RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .bm-hero-search {
        flex-direction: column;
        align-items: stretch;
        border-radius: 22px;
        padding: 16px;
    }
    .bm-field {
        border-right: none;
        border-bottom: 1px solid var(--bm-line);
        padding: 14px 18px 14px 44px;
    }
    .bm-field:last-of-type { border-bottom: none; }
    .bm-search-btn {
        width: 100%;
        border-radius: 12px;
        margin: 8px 0 0 0;
        height: 52px;
    }
}

/* ==========================================================================
   3. SEARCH RESULTS PAGE (rendered by BMSF_Results_Renderer)
   ========================================================================== */

/* Header: title + subtitle */
.bm-results-header {
    max-width: 1180px;
    margin: 30px auto 0;
    padding: 0 24px;
    font-family: var(--bm-font);
}
.bm-results-title {
    font-size: 26px !important;
    font-weight: 700 !important;
    color: var(--bm-dark) !important;
    margin: 0 0 4px !important;
    padding: 0 !important;
}
.bm-results-sub {
    font-size: 14px;
    color: var(--bm-muted);
    margin: 0 0 20px;
}

/* Filter chips + sort toolbar */
.bm-results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--bm-line);
    margin-bottom: 24px;
}
.bm-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.bm-chip {
    background: var(--bm-primary);
    color: #fff;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .2s;
}
.bm-chip:hover { background: var(--bm-primary-hover); color: #fff; }
.bm-chip-x { font-size: 14px; opacity: .9; }

.bm-toolbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
    color: var(--bm-muted);
}
.bm-filter-link {
    color: var(--bm-primary) !important;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 13px;
}
.bm-sort-wrap { display: inline-flex; align-items: center; gap: 8px; }
.bm-sort-label {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 12px;
    color: var(--bm-muted);
}
.bm-sort-select {
    border: 1px solid var(--bm-line) !important;
    background: #fff !important;
    border-radius: 999px !important;
    padding: 6px 32px 6px 14px !important;
    font-family: var(--bm-font);
    font-size: 13px;
    color: var(--bm-dark);
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230B2A3A'><path d='M7 10l5 5 5-5z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 14px !important;
}

/* Loop list */
.woocommerce ul.products {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
    list-style: none !important;
    max-width: 1180px !important;
}

/* Card */
.woocommerce ul.products li.product.bm-card,
.bm-card {
    width: 100% !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    font-family: var(--bm-font);
    float: none !important;
    clear: both !important;
}
.bm-card::before,
.bm-card::after { display: none !important; }

.bm-card-inner {
    display: grid;
    grid-template-columns: minmax(280px, 38%) 1fr;
    background: #fff;
    border: 1px solid var(--bm-line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--bm-shadow-card);
    transition: transform .25s ease, box-shadow .25s ease;
}
.bm-card-inner:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 38px rgba(11, 42, 58, .14);
}

.bm-card-media {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    /* Lock aspect ratio so every product card is the same height,
       regardless of source image dimensions. 4:3-ish like the mockup. */
    aspect-ratio: 4 / 3;
    min-height: 240px;
    background: #f4f6f8;
}
.bm-card-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    inset: 0 !important;
    max-width: none !important;
}
.bm-photos-badge {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(11, 42, 58, .72);
    color: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    backdrop-filter: blur(6px);
}

.bm-card-body {
    padding: 22px 26px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.bm-tag {
    position: absolute;
    top: 18px;
    right: 18px;
    background: var(--bm-primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.bm-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 6px;
}
.bm-rating-num {
    color: var(--bm-dark);
    font-weight: 700;
}
.bm-rating-stars {
    color: var(--bm-primary);
    letter-spacing: 1px;
    font-size: 12px;
}
.bm-rating-count {
    color: var(--bm-muted);
    font-size: 12px;
}

.bm-card-title-link { text-decoration: none; }
.bm-card-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--bm-dark) !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    line-height: 1.25 !important;
}

.bm-card-desc {
    font-size: 13px;
    color: var(--bm-muted);
    line-height: 1.55;
    margin: 0 0 14px;
}

.bm-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    padding-top: 12px;
    margin-bottom: 14px;
    border-top: 1px dashed var(--bm-line);
    font-size: 13px;
    color: var(--bm-dark);
}
.bm-features span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bm-features span::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bm-primary);
    display: inline-block;
}

.bm-price-row {
    background: #F4F6F8;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.bm-price-note {
    font-size: 12px;
    color: var(--bm-muted);
    line-height: 1.35;
}
.bm-price-amount {
    text-align: right;
}
.bm-price-amount .bm-price,
.bm-price-amount .bm-price * {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: var(--bm-dark) !important;
    line-height: 1;
    text-decoration: none !important;
}
.bm-price-amount .bm-price del { display: none !important; }
.bm-price-amount .bm-price-sub {
    display: block;
    font-size: 11px;
    color: var(--bm-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* Hide WooCommerce result count / default sort dropdown on these pages */
.bm-results-page .woocommerce-result-count,
.bm-results-page .woocommerce-ordering,
.bm-results-page .woocommerce-breadcrumb,
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
    display: none !important;
}

/* Hide WCFM marketplace store info inside cards */
.bm-results-page .wcfm_enquiry_button_wrapper,
.bm-results-page .wcfmmp_sold_by_container,
.bm-results-page .wcfmmp_sold_by_label,
.bm-results-page .star-rating,
.bm-results-page .wcfm-product-policies-tab-wrap,
.bm-card .wcfm_enquiry_button_wrapper,
.bm-card .wcfmmp_sold_by_container {
    display: none !important;
}

/* ==========================================================================
   4. RESULTS PAGE HERO BANNER (auto-injected above the loop)
   ========================================================================== */
.bm-results-hero {
    position: relative;
    background-color: #0B2A3A;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 60px 24px 80px;
    color: #fff;
    font-family: var(--bm-font);
    margin: 0 0 60px;
}
.bm-results-hero-inner {
    max-width: 1180px;
    margin: 0 auto;
    position: relative;
}
.bm-results-hero-title {
    font-size: 42px !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    line-height: 1.1 !important;
    max-width: 580px;
}
.bm-results-hero-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, .9);
    margin: 0 0 44px;
    max-width: 480px;
}
/* Pull the search pill down so it overlaps the bottom of the hero */
.bm-results-hero .bm-hero-search {
    margin-bottom: -50px;
    position: relative;
    z-index: 10;
}

@media (max-width: 900px) {
    .bm-results-hero {
        padding: 50px 16px 80px;
        margin-bottom: 40px;
    }
    .bm-results-hero-title { font-size: 30px !important; }
    .bm-results-hero-sub { margin-bottom: 30px; }
    .bm-card-inner {
        grid-template-columns: 1fr;
    }
    .bm-card-media { min-height: 200px; }
    .bm-card-media img { min-height: 200px; }
    .bm-results-toolbar { flex-direction: column; align-items: stretch; }
    .bm-toolbar-right { justify-content: space-between; }
}
