/*
 * Responsive / mobile layer. Loaded last in <head> (see inc/ui.php) so it
 * wins over theme.css and style.css.
 */

:root {
    --bbh-accent: var(--footer-color, #aa81a1);
    --bbh-accent-dark: #8f6a87;
    --bbh-ink: #4a4a4a;
    --bbh-muted: #8a8a8a;
    --bbh-line: #ececec;
    --bbh-tabbar-h: 64px;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--bbh-accent); outline-offset: 2px; }

/* 16px inputs stop iPhones zooming the page when a field is tapped. */
@media (max-width: 991.98px) {
    input[type="text"], input[type="email"], input[type="tel"], input[type="search"],
    input[type="number"], input[type="password"], select, textarea { font-size: 16px !important; }
}

/* Desktop nav: underline for the current page + hover dropdown for Categories. */
@media (min-width: 992px) {
    .navbar-ul .nav-link { position: relative; }
    .navbar-ul .nav-link::after {
        content: "";
        position: absolute;
        left: 50%;
        right: 50%;
        bottom: 2px;
        height: 1px;
        background: #fff;
        transition: left .25s, right .25s;
    }
    .navbar-ul .nav-link:hover::after,
    .navbar-ul .nav-link.active::after { left: 1rem; right: 1rem; }

    .navbar-ul .dropdown > .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity .2s, transform .2s, visibility .2s;
        margin-top: 0;
        min-width: 230px;
        padding: 8px 0;
        border: 0;
        box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
    }
    .navbar-ul .dropdown:hover > .dropdown-menu,
    .navbar-ul .dropdown:focus-within > .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
    .navbar-ul .dropdown-menu .dropdown-item { padding: 10px 22px; font-size: 13px; letter-spacing: 1.5px; }
    .bbh-caret { margin-left: 4px; transition: transform .2s; vertical-align: 1px; }
    .navbar-ul .dropdown:hover .bbh-caret { transform: rotate(180deg); }
}

/* ---------- Mobile menu ---------- */
.bbh-menu.offcanvas {
    width: min(88vw, 380px) !important;
    border-right: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
}
/* Slide-out panels (menu, bag, shop filter) sit above the sticky header and tab bar,
   each above its own backdrop. */
.offcanvas-backdrop { z-index: 1040; }
.offcanvas { z-index: 1045; }
.bbh-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bbh-accent);
}
.bbh-menu__logo .header-logo { width: 104px; height: auto; object-fit: contain; }
.bbh-menu__close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    display: grid;
    place-items: center;
    transition: background .2s;
}
.bbh-menu__close:hover { background: rgba(255, 255, 255, .28); }
.bbh-menu__body { flex: 1; overflow-y: auto; padding: 18px 18px 8px; -webkit-overflow-scrolling: touch; }

.bbh-menu__search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 48px;
    background: #f5f2f4;
    color: var(--bbh-muted);
    margin-bottom: 14px;
}
.bbh-menu__search input {
    flex: 1;
    border: 0;
    background: transparent;
    outline: 0;
    height: 100%;
    color: var(--bbh-ink);
    font-size: 16px;
}

.bbh-menu__list, .bbh-menu__sub { list-style: none; margin: 0; padding: 0; }
.bbh-menu__list > li { border-bottom: 1px solid var(--bbh-line); }
.bbh-menu__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 56px;
    padding: 0 4px;
    border: 0;
    background: none;
    text-align: left;
    color: var(--bbh-ink) !important;
    font-size: 15px !important;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    font-family: HarmonyOS, sans-serif !important;
}
.bbh-menu__link.active { color: var(--bbh-accent) !important; }
.bbh-menu__chev { color: #c4c4c4; flex-shrink: 0; }
.bbh-menu__plus { transition: transform .25s; color: var(--bbh-muted); }
.bbh-menu__toggle[aria-expanded="true"] .bbh-menu__plus { transform: rotate(180deg); }
.bbh-menu__sub { padding: 0 0 12px 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bbh-menu__sub a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 12px;
    background: #f7f4f6;
    color: var(--bbh-ink) !important;
    font-size: 14px !important;
    text-decoration: none;
    line-height: 1.25 !important;
}
.bbh-menu__sub a.active { background: var(--bbh-accent); color: #fff !important; }

.bbh-menu__quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0 8px; }
.bbh-menu__quick a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 72px;
    border: 1px solid var(--bbh-line);
    color: var(--bbh-ink) !important;
    font-size: 13px !important;
    text-decoration: none;
    transition: border-color .2s, color .2s;
}
.bbh-menu__quick a:hover { border-color: var(--bbh-accent); color: var(--bbh-accent) !important; }
.bbh-menu__quick svg { color: var(--bbh-accent); }

.bbh-menu__foot {
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--bbh-line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
}
.bbh-menu__contact { color: var(--bbh-muted) !important; font-size: 14px !important; text-decoration: none; }
.bbh-menu__social { display: flex; gap: 10px; margin-left: auto; }
.bbh-menu__social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #f5f2f4;
    color: var(--bbh-accent) !important;
    transition: background .2s, color .2s;
}
.bbh-menu__social a:hover { background: var(--bbh-accent); color: #fff !important; }

/* Bigger tap targets for the header icons on phones. */
@media (max-width: 991.98px) {
    .menu_btn, .main-header .shop_btn a { min-width: 44px; min-height: 44px; display: inline-flex !important; align-items: center; justify-content: center; }
}

/* ---------- Bottom tab bar (phones) ---------- */
.bbh-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1020;
    display: flex;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--bbh-line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .05);
}
.bbh-tabbar__item {
    flex: 1;
    min-height: var(--bbh-tabbar-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #9a9a9a !important;
    font-size: 11px !important;
    letter-spacing: .5px;
    text-decoration: none;
    position: relative;
}
.bbh-tabbar__item.active { color: var(--bbh-accent) !important; }
.bbh-tabbar__item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 30%;
    right: 30%;
    height: 2px;
    background: var(--bbh-accent);
}
.bbh-tabbar__icon { position: relative; display: inline-flex; }
.bbh-tabbar .bbh-cart-count {
    position: absolute;
    top: -6px !important;
    right: -10px !important;
    width: 18px !important;
    height: 18px !important;
    font-size: 10px !important;
    background: var(--bbh-accent) !important;
    color: #fff !important;
    border: 2px solid #fff;
    box-sizing: content-box;
}
@media (max-width: 767.98px) {
    body { padding-bottom: calc(var(--bbh-tabbar-h) + env(safe-area-inset-bottom)); }
    .bbh-toast { bottom: calc(var(--bbh-tabbar-h) + 16px + env(safe-area-inset-bottom)); }
}

/* ---------- Images ---------- */
/* Product cards: one consistent 4:5 portrait shape instead of fixed 164–206px boxes. */
/* The frame (.bbh-media, see bbh_card_image()) holds the shape, so a photo that is
   still loading or missing can't stretch the card. */
.bbh-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background-color: #ebe7ea;
}
.bbh-media img,
.best-seller-card .bbh-media img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    aspect-ratio: auto !important;
    object-fit: cover;
    color: transparent; /* hide the alt text of a photo that failed to load */
    background-color: #ebe7ea;
}
/* Card images that aren't inside a frame yet (e.g. from other plugins). */
.best-seller-card img:not(.bbh-media img) {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 5 !important;
    object-fit: cover;
}
.best-seller-card figure { overflow: hidden; }
@media (hover: hover) {
    .bbh-media img { transition: transform .5s ease; }
    .best-seller-card:hover .bbh-media img { transform: scale(1.04); }
}
.category-card img {
    width: 100%;
    height: auto !important;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

/* Inner page banners: shorter on phones so content starts sooner.
   (The homepage hero keeps its full height.) */
.banner_img { object-fit: cover; }
@media (max-width: 767.98px) {
    body:not(.home) section .banner_img { height: clamp(260px, 42vh, 360px) !important; }
    body:not(.home) .banner-overlay .main-title { font-size: clamp(30px, 9vw, 40px) !important; }
}

/* ---------- Product cards on small screens ---------- */
@media (max-width: 575.98px) {
    .best-seller-card { padding: 8px !important; }
    .best-seller-card .card-body { padding-top: 10px !important; }
    .bouquet-title { font-size: 15px !important; line-height: 1.3; display: block; }
    .bouquet-price bdi { font-size: 14px !important; }
    .best-seller-card .group_btn .btn-add-to-cart,
    .best-seller-card .group_btn .add_to_cart_button_2 { min-width: 44px; min-height: 40px; display: flex !important; align-items: center; justify-content: center; padding: 8px 12px !important; }
}

/* Single product page styles live in css/product.css. */

/* ---------- Shop / categories ---------- */
/* The left padding makes room for the filter sidebar, which only shows from 992px. */
@media (min-width: 768px) and (max-width: 991.98px) {
    .col-lg-9 .ps-md-12 { padding-left: calc(var(--bs-gutter-x, 1.5rem) * .5) !important; }
}
@media (max-width: 991.98px) {
    #offcanvasExample { width: min(88vw, 380px); }
    #offcanvasExample .navbar-nav-cate .nav-item a { min-height: 44px; display: flex !important; align-items: center; }
    .pagination, .page-numbers { flex-wrap: wrap; gap: 6px; }
    .page-numbers li a, .page-numbers li span { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
}

/* ---------- Footer ---------- */
@media (max-width: 767.98px) {
    .main-footer .main-title { font-size: clamp(28px, 8vw, 36px) !important; }
    .main-footer .email_ul { justify-content: center; text-align: center; }
    .main-footer .socail_media_ul a { min-height: 44px; align-items: center; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Prices: "£" the same size as the amount ---------- */
/* header.php sets "bdi span" to 17px, so the £ symbol was bigger than the 15px number. */
.woocommerce-Price-amount .woocommerce-Price-currencySymbol,
bdi .woocommerce-Price-currencySymbol {
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit;
    vertical-align: baseline;
    color: inherit !important;
}

/* ---------- "&" and "!" in headings (see js/ampersand-fix.js) ---------- */
.bbh-glyph {
    /* A plain, classic "&" (Playfair's is a decorative curly one). */
    font-family: Georgia, "Times New Roman", "Noto Serif", serif !important;
    font-weight: 400 !important;
    font-style: normal !important;
    padding: 0 .04em;
}

/* ---------- Search results page ---------- */
.bbh-search { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(48px, 7vw, 90px); }
.bbh-search__form {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 720px;
    margin: 0 auto 18px;
    padding: 6px 6px 6px 20px;
    background: #fff;
    border: 1px solid #eadfe8;
    border-radius: 999px;
    box-shadow: 0 6px 24px rgba(170, 129, 161, .12);
    color: #8a8a8a;
}
.bbh-search__form:focus-within { border-color: var(--bbh-accent); }
.bbh-search__form input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;
    color: var(--bbh-ink);
}
.bbh-search__form button {
    height: 46px;
    padding: 0 26px;
    border: 0;
    border-radius: 999px;
    background: var(--bbh-accent);
    color: #fff;
    font-size: 14px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: background-color .2s;
}
.bbh-search__form button:hover { background: var(--bbh-accent-dark); }
.bbh-search__count { text-align: center; color: var(--bbh-muted); margin-bottom: clamp(24px, 4vw, 40px); }
.bbh-search__count strong { color: var(--bbh-ink); font-weight: 500; }

.bbh-search__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 28px);
}
@media (max-width: 991.98px) { .bbh-search__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .bbh-search__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.bbh-search-card.best-seller-card { padding: 0 !important; border: 0 !important; background: transparent !important; }
.bbh-search-card .bbh-media { border-radius: 14px; }
.bbh-search-card .card-body { padding: 12px 2px 0 !important; }
/* Name and price at the same size, in the body font. */
.bbh-search-card__title,
.bbh-search-card__price,
.bbh-search-card__price bdi,
.bbh-search-card__price .amount {
    font-family: HarmonyOS, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
    letter-spacing: .3px;
}
.bbh-search-card__title { margin: 0 0 4px; font-weight: 400 !important; }
.bbh-search-card__title a { color: var(--bbh-ink) !important; text-decoration: none; }
.bbh-search-card__title a:hover { color: var(--bbh-accent) !important; }
.bbh-search-card__price,
.bbh-search-card__price bdi { color: var(--bbh-accent) !important; font-weight: 600 !important; }
.bbh-search-card__price del,
.bbh-search-card__price del bdi { color: var(--bbh-muted) !important; font-weight: 400 !important; margin-right: 6px; }
.bbh-search-card__price ins { text-decoration: none; }
.bbh-search-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bbh-accent);
    color: #fff;
    font-size: 12px;
    letter-spacing: 1px;
}
@media (max-width: 575.98px) {
    .bbh-search-card__title, .bbh-search-card__price, .bbh-search-card__price bdi, .bbh-search-card__price .amount { font-size: 14px !important; }
}

/* The theme makes WordPress's .pagination wrapper a flex row, which pinned the numbers to the left. */
.bbh-search__pagination .navigation { display: flex; justify-content: center; width: 100%; }
.bbh-search__pagination .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.bbh-search__pagination .page-numbers {
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #eadfe8;
    background: #fff;
    color: var(--bbh-ink) !important;
    text-decoration: none;
    letter-spacing: 0 !important;
}
.bbh-search__pagination .page-numbers.current { background: var(--bbh-accent); border-color: var(--bbh-accent); color: #fff !important; }

.bbh-search__empty { max-width: 620px; margin: 24px auto 0; text-align: center; color: var(--bbh-muted); }
.bbh-search__empty svg { color: #d6c3d3; margin-bottom: 16px; }
.bbh-search__empty h2 { font-size: clamp(24px, 4vw, 32px) !important; color: var(--bbh-ink) !important; margin-bottom: 10px; }
.bbh-search__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px 0 28px; }
.bbh-search__chips a {
    padding: 10px 18px;
    border-radius: 999px;
    background: #f7f2f6;
    color: var(--bbh-ink) !important;
    font-size: 14px;
    text-decoration: none;
    transition: background-color .2s, color .2s;
}
.bbh-search__chips a:hover { background: var(--bbh-accent); color: #fff !important; }

/* ---------- "Shopping Agent" chat plugin: keep it clear of the phone tab bar ---------- */
@media (max-width: 767.98px) {
    #sa-btn { bottom: calc(var(--bbh-tabbar-h, 64px) + 14px + env(safe-area-inset-bottom)) !important; right: 14px !important; width: 52px !important; height: 52px !important; }
    #sa-box { bottom: calc(var(--bbh-tabbar-h, 64px) + 76px + env(safe-area-inset-bottom)) !important; max-height: calc(100vh - var(--bbh-tabbar-h, 64px) - 110px) !important; }
    /* Product pages: above the sticky "Add to cart" bar too. */
    .single-product #sa-btn { bottom: calc(var(--bbh-tabbar-h, 64px) + 90px + env(safe-area-inset-bottom)) !important; }
    .single-product #sa-box { bottom: calc(var(--bbh-tabbar-h, 64px) + 150px + env(safe-area-inset-bottom)) !important; max-height: calc(100vh - var(--bbh-tabbar-h, 64px) - 180px) !important; }
}
