/* Homedash Customizations - frontend styles. */

/* iPhone/WebKit: product grid columns were forced wider than the screen by the
   large product photos' intrinsic width (1fr = minmax(auto, 1fr)), growing as
   images lazy-loaded while scrolling. */
.tf-grid-layout > * {
    min-width: 0;
}

/* Chaty: its stylesheet points the WhatsApp popup background at /images/whatsapp.png
   on the site root (404); use the copy inside the Chaty plugin. */
body .chaty-whatsapp-form:before {
    background-image: url("../../../chaty/dist/images/whatsapp.png");
}

/* Chaty: lift the WhatsApp button on mobile. */
@media (max-width: 767px) {
    body .chaty-widget {
        padding-bottom: 40px;
    }
}

/* Shop sort: pill buttons instead of a dropdown.
   Keeps the theme's .tf-dropdown-sort / .dropdown-menu / .select-item classes because
   shop.js reads the active pill from them, so the Bootstrap dropdown styles are reset here. */
.tf-shop-control .tf-control-sorting:has(.tf-sort-pills) {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
}

.tf-dropdown-sort.tf-sort-pills {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    max-width: 100%;
    cursor: default;
    border-radius: 0;
}

.tf-sort-pills__label {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-2);
    white-space: nowrap;
}

.tf-dropdown-sort.tf-sort-pills .dropdown-menu.tf-sort-pills__list {
    display: flex !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    float: none;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    max-height: none;
    margin: 0;
    padding: 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    z-index: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.tf-dropdown-sort.tf-sort-pills .dropdown-menu.tf-sort-pills__list::-webkit-scrollbar {
    display: none;
}

.tf-dropdown-sort.tf-sort-pills .select-item {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    width: auto;
    margin: 0;
    padding: 8px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-transform: none;
    white-space: nowrap;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    scroll-snap-align: start;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tf-dropdown-sort.tf-sort-pills .select-item:hover {
    background: var(--white);
    border-color: var(--text);
}

.tf-dropdown-sort.tf-sort-pills .select-item.active,
.tf-dropdown-sort.tf-sort-pills .select-item.active:hover {
    color: var(--white);
    background: var(--text);
    border-color: var(--text);
}

.tf-dropdown-sort.tf-sort-pills .select-item:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .tf-shop-control .tf-control-sorting:has(.tf-sort-pills) {
        flex: 1 0 100%;
        order: 3;
    }

    .tf-sort-pills__label {
        display: none;
    }

    .tf-dropdown-sort.tf-sort-pills .select-item {
        padding: 7px 14px;
        font-size: 13px;
    }
}

/* Header logo on the mobile/tablet header (amerce caps it at 120px wide below 1200px). */
@media (max-width: 1199px) {
    body .tf-header .logo-site img {
        max-width: 160px;
    }
}

/* Search bar and popup: no category picker, the search always covers all categories. */
.form_search-product .select-category,
.form_search-product .line-border {
    display: none !important;
}

.header-02 .form_search-product input {
    padding-left: 20px;
}

.offcanvas-search .popup-content .form_search-product .ajax-search-input {
    padding-left: 24px;
}

/* Header: "Browse all products" button before the account icon (desktop header only). */
.tf-header .nav-icon-list .nav-browse {
    display: none;
}

@media (min-width: 1200px) {
    .tf-header .nav-icon-list .nav-browse {
        display: flex;
        align-items: center;
    }
}

.tf-header .hd-header-browse {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: var(--white);
    background-color: var(--text);
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.tf-header .hd-header-browse:hover {
    color: var(--white);
    background-color: var(--primary);
}

.tf-header .hd-header-browse:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

/* Mobile/tablet drawer: "Browse all products" after the menu. */
#mobileMenu .hd-drawer-browse {
    margin-top: 20px;
}

#mobileMenu .hd-drawer-browse__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: var(--white);
    background-color: var(--text);
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

#mobileMenu .hd-drawer-browse__btn:hover,
#mobileMenu .hd-drawer-browse__btn:focus-visible {
    color: var(--white);
    background-color: var(--primary);
}

/* Hidden from view, still read by search engines and screen readers. */
.hd-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Shop/category pages: centre the category carousel when all items fit (class set by category-carousel.php). */
.section-category .swiper.hd-carousel-fits .swiper-wrapper {
    justify-content: center;
}

.section-category .swiper.hd-carousel-fits .swiper-slide:last-child {
    margin-right: 0 !important;
}
