/* Entaje mobile UX overlay — loaded after custom.css */

:root {
    --entaje-bottom-nav-height: 64px;
    --entaje-safe-bottom: env(safe-area-inset-bottom, 0px);
    --entaje-mobile-nav-offset: calc(var(--entaje-bottom-nav-height) + var(--entaje-safe-bottom));
}

/* ---------- Bottom navigation ---------- */
.entaje-mobile-bottom-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    min-height: var(--entaje-bottom-nav-height);
    padding-bottom: var(--entaje-safe-bottom);
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.06);
}

.entaje-mobile-bottom-nav__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 8px 4px;
    margin: 0;
    border: 0;
    background: transparent;
    color: #6c757d;
    text-decoration: none;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.entaje-mobile-bottom-nav__item:hover,
.entaje-mobile-bottom-nav__item:focus {
    color: var(--web-primary, #8b5e3c);
    text-decoration: none;
    outline: none;
}

.entaje-mobile-bottom-nav__item.is-active {
    color: var(--web-primary, #8b5e3c);
    font-weight: 600;
}

.entaje-mobile-bottom-nav__icon {
    font-size: 20px;
    line-height: 1;
}

.entaje-mobile-bottom-nav__icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.entaje-mobile-bottom-nav__badge {
    position: absolute;
    top: -6px;
    inset-inline-end: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--web-primary, #8b5e3c);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.entaje-mobile-bottom-nav__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space:nowrap;
}

/* ---------- Role entry FAB (corner) ---------- */
.entaje-role-fab {
    position: fixed;
    z-index: 1050;
    inset-inline-start: 16px;
    bottom: calc(16px + var(--entaje-safe-bottom));
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

html[dir="rtl"] .entaje-role-fab {
    align-items: flex-end;
}

.entaje-role-fab__toggle {
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--web-primary, #8b5e3c);
    color: #fff;
    box-shadow: 0 8px 20px rgba(139, 94, 60, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.entaje-role-fab__toggle-close {
    display: none;
}

.entaje-role-fab.is-open .entaje-role-fab__toggle-icon {
    display: none;
}

.entaje-role-fab.is-open .entaje-role-fab__toggle-close {
    display: inline-block;
}

.entaje-role-fab__menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 190px;
}

.entaje-role-fab__menu[hidden] {
    display: none !important;
}

.entaje-role-fab__action {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff;
    color: #333;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    font-size: 13px;
    font-weight: 600;
}

.entaje-role-fab__action:hover,
.entaje-role-fab__action:focus {
    color: var(--web-primary, #8b5e3c);
    text-decoration: none;
}

.entaje-role-fab__action i {
    width: 18px;
    text-align: center;
    color: var(--web-primary, #8b5e3c);
}

/* Lift FAB + WhatsApp above bottom nav on mobile */
@media (max-width: 991.98px) {
    body.has-entaje-mobile-ux {
        padding-bottom: var(--entaje-mobile-nav-offset);
    }

    body.has-entaje-mobile-ux .entaje-role-fab {
        bottom: calc(var(--entaje-mobile-nav-offset) + 12px);
    }

    body.has-entaje-mobile-ux .floating-btn-grp {
        bottom: calc(var(--entaje-mobile-nav-offset) + 12px);
    }

    body.has-entaje-mobile-ux .floating-btn-grp.has-product-details-sticky {
        bottom: calc(var(--entaje-mobile-nav-offset) + 150px);
    }

    body.has-entaje-mobile-ux .entaje-role-fab.has-product-details-sticky {
        bottom: calc(var(--entaje-mobile-nav-offset) + 150px);
    }

    body.has-entaje-mobile-ux .product-details-sticky.active {
        bottom: var(--entaje-mobile-nav-offset);
        padding-bottom: 8px;
    }

    /* Header touch targets */
    body.has-entaje-mobile-ux .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
    }

    body.has-entaje-mobile-ux .navbar-tool-icon-box {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    body.has-entaje-mobile-ux .__close-announcement {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
        cursor: pointer;
    }

    body.has-entaje-mobile-ux .navbar-stuck-toggler .navbar-tool-icon-box,
    body.has-entaje-mobile-ux .open-search-form-mobile .navbar-tool-icon-box {
        border-radius: 50%;
    }

    /* Home / listing cards */
    body.has-entaje-mobile-ux .product-card {
        margin-bottom: 12px;
    }

    body.has-entaje-mobile-ux .product .product-card .card-body,
    body.has-entaje-mobile-ux .product-card .card-body {
        padding: 10px;
    }

    body.has-entaje-mobile-ux .row {
        max-width: 100%;
    }

    body.has-entaje-mobile-ux img {
        max-width: 100%;
        height: auto;
    }

    /* Filter / shop sidebar affordance */
    body.has-entaje-mobile-ux #shop-sidebar {
        max-width: min(320px, 88vw);
    }

    /* Cart mobile cards */
    body.has-entaje-mobile-ux .cart_information,
    body.has-entaje-mobile-ux .__cart-table {
        border-radius: 12px;
    }

    body.has-entaje-mobile-ux .cart_information .btn,
    body.has-entaje-mobile-ux .quantity__minus,
    body.has-entaje-mobile-ux .quantity__plus,
    body.has-entaje-mobile-ux .qty_plus,
    body.has-entaje-mobile-ux .qty_minus {
        min-width: 40px;
        min-height: 40px;
    }

    /* Checkout forms */
    body.has-entaje-mobile-ux .checkout-details .form-control,
    body.has-entaje-mobile-ux .checkout-section .form-control,
    body.has-entaje-mobile-ux form.checkout-form .form-control,
    body.has-entaje-mobile-ux .shipping-form .form-control,
    body.has-entaje-mobile-ux #payment-form .form-control,
    body.has-entaje-mobile-ux .physical_product_wrapper .form-control {
        min-height: 44px;
        font-size: 16px; /* prevents iOS zoom */
    }

    body.has-entaje-mobile-ux .checkout-details .btn,
    body.has-entaje-mobile-ux .shipping-form .btn,
    body.has-entaje-mobile-ux #payment-form .btn,
    body.has-entaje-mobile-ux .proceed_to_next_button,
    body.has-entaje-mobile-ux .checkout-continue-btn {
        min-height: 48px;
    }

    body.has-entaje-mobile-ux .custom-control-label::before,
    body.has-entaje-mobile-ux .custom-control-label::after {
        width: 1.15rem;
        height: 1.15rem;
    }

    /* Sticky ATC collapse button */
    body.has-entaje-mobile-ux .product-details-sticky-collapse-btn {
        --size: 44px !important;
        width: 44px;
        height: 44px;
    }

    /* Mobile nav drawer readability */
    body.has-entaje-mobile-ux #navbarCollapse .nav-link,
    body.has-entaje-mobile-ux #navbarCollapse .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        font-size: 14px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

@media (min-width: 992px) {
    .entaje-mobile-bottom-nav {
        display: none !important;
    }

    body.has-entaje-mobile-ux .entaje-role-fab {
        bottom: 24px;
        inset-inline-start: 20px;
    }
}

/* Hide bottom nav while mobile search overlay is open */
body.search-form-mobile-open .entaje-mobile-bottom-nav {
    transform: translateY(110%);
    pointer-events: none;
}

/* Reduce collision: WhatsApp stays on opposite corner from role FAB */
@media (max-width: 991.98px) {
    body.has-entaje-mobile-ux .floating-btn-grp {
        inset-inline-end: 16px;
        inset-inline-start: auto;
        right: 16px;
        left: auto;
    }

    html[dir="rtl"] body.has-entaje-mobile-ux .floating-btn-grp {
        right: auto;
        left: 16px;
    }

    /* Core shop flow spacing so content clears bottom nav */
    body.has-entaje-mobile-ux .footer,
    body.has-entaje-mobile-ux footer {
        margin-bottom: 8px;
    }

    body.has-entaje-mobile-ux .cart_information.d-lg-none,
    body.has-entaje-mobile-ux .__cart-total,
    body.has-entaje-mobile-ux .checkout_details,
    body.has-entaje-mobile-ux #ajax-products-view {
        padding-bottom: 8px;
    }

    body.has-entaje-mobile-ux .cart_information.d-lg-none .qty_plus,
    body.has-entaje-mobile-ux .cart_information.d-lg-none .qty_minus,
    body.has-entaje-mobile-ux .cart_information.d-lg-none .action-update-cart-quantity-list-mobile {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.has-entaje-mobile-ux .cart_information.d-lg-none .qty_input {
        min-height: 44px;
        min-width: 48px;
        text-align: center;
        font-size: 16px;
    }

    body.has-entaje-mobile-ux .product-details-sticky-bottom .btn,
    body.has-entaje-mobile-ux .product-details-sticky .add-to-cart-sticky-form .btn {
        min-height: 44px;
        font-size: 14px;
    }

    body.has-entaje-mobile-ux .product-list-filter .btn,
    body.has-entaje-mobile-ux [data-toggle="sidebar"],
    body.has-entaje-mobile-ux .filter-btn,
    body.has-entaje-mobile-ux .cz-sidebar-header .close {
        min-height: 44px;
        min-width: 44px;
    }

    body.has-entaje-mobile-ux .list-group-item.add-another-address,
    body.has-entaje-mobile-ux .checkout_details .list-group-item {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    body.has-entaje-mobile-ux .checkout_details .custom-control,
    body.has-entaje-mobile-ux .checkout_details .form-check {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Prevent fixed-width desktop utilities from causing overflow */
    body.has-entaje-mobile-ux .min-width-600px,
    body.has-entaje-mobile-ux .__w-20rem,
    body.has-entaje-mobile-ux .transaction-filter_dropdown {
        min-width: 0 !important;
        max-width: 100%;
    }

    body.has-entaje-mobile-ux .container,
    body.has-entaje-mobile-ux .container-fluid {
        overflow-x: clip;
    }
}
