.search-bar {
    flex: 1 1 420px;
    min-width: 260px;
    max-width: 520px;
    position: relative;
}

.search-bar form {
    width: 100%;
    position: relative;
}

.search-bar-spacing {
    margin-left: 12px !important;
    margin-right: 12px !important;
}

/* Navbar: keep a single stable row on desktop */
@media (min-width: 992px) {
    .navbar > .container,
    .navbar > .container-fluid {
        flex-wrap: nowrap;
    }

    .navbar-nav {
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .navbar-nav .nav-item {
        flex: 0 0 auto;
    }

    /* Allow search to shrink instead of pushing menu to next line */
    .search-bar {
        min-width: 240px;
    }
}

/* Truncate long user names (prevents header shifting) */
.nav-user-name {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

@media (max-width: 1199.98px) {
    .nav-user-name {
        max-width: 120px;
    }
}

@media (max-width: 991.98px) {
    .nav-user-name {
        max-width: none;
    }
}

.search-input {
    width: 100%;
    height: 42px;
    padding: 0 50px 0 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    font-size: 15px;
    transition: all 0.25s ease;
}

.search-input::placeholder {
    color: #777;
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.18);
    outline: none;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    height: 32px;
    width: 32px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 70%, white));
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--bs-primary) 35%, transparent);
}

.search-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--bs-primary) 45%, transparent);
    background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 50%, white));
}

.search-btn i {
    transition: 0.3s;
}

.search-btn:hover i {
    transform: scale(1.15);
}

/* Force Bootstrap primary buttons to match site primary */
.btn-primary,
.btn-primary:focus,
.btn-primary:focus-visible,
.btn-primary:active {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.btn-primary:hover {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    filter: brightness(0.95);
}

.btn-outline-primary {
    color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    box-shadow: none !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary:focus,
.btn-outline-primary:focus-visible {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;
}

/* Shared "continue shopping" pill button (cart + wishlist) */
.cart-continue-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    border-radius: 999px !important;
    border-width: 1.5px !important;
    box-shadow: 0 10px 22px rgba(16, 24, 40, 0.08) !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

.cart-continue-btn i {
    font-size: 14px;
}

.cart-continue-btn:hover {
    transform: translateY(-1px);
}

.cart-continue-btn:focus,
.cart-continue-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--bs-primary) 18%, transparent) !important;
}

.search-bar-mobile {
    width: 100%;
    position: relative;
    margin-bottom: 12px;
}

.search-bar-mobile form {
    width: 100%;
    position: relative;
}

.search-input-mobile {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 14px;
    border-radius: 12px;
    border: 2px solid var(--bs-primary);
    background: #fff;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 0 0 0 color-mix(in srgb, var(--bs-primary) 35%, transparent);
    transition: 0.2s;
    animation: search-mobile-pulse 2.4s ease-in-out infinite;
}

.search-input-mobile:focus {
    animation: none;
    border-color: var(--bs-primary);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.1),
        0 0 0 4px color-mix(in srgb, var(--bs-primary) 22%, transparent);
    background: #fff;
}

.search-btn-mobile {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    height: 34px;
    width: 34px;
    border-radius: 999px;
    border: none;
    background: var(--bs-primary);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--bs-primary) 40%, transparent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.search-btn-mobile:hover {
    transform: translateY(-50%) scale(1.07);
    background: color-mix(in srgb, var(--bs-primary) 88%, #000);
}

.search-btn-mobile:active {
    transform: translateY(-50%) scale(0.98);
}

.search-btn-mobile:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-primary) 35%, transparent);
}

@keyframes search-mobile-pulse {
    0%,
    100% {
        box-shadow:
            0 4px 16px rgba(0, 0, 0, 0.08),
            0 0 0 0 color-mix(in srgb, var(--bs-primary) 0%, transparent);
    }

    50% {
        box-shadow:
            0 6px 20px rgba(0, 0, 0, 0.1),
            0 0 0 5px color-mix(in srgb, var(--bs-primary) 28%, transparent);
    }
}

@media (prefers-reduced-motion: reduce) {
    .search-input-mobile {
        animation: none;
    }
}

.offcanvas {
    width: 280px !important;
    z-index: 9999;
}

/* Mobile offcanvas menu (Trendyol-ish) */
.offcanvas-header {
    padding: 14px 14px;
}

.offcanvas-body {
    padding: 10px 14px 16px;
}

.mobile-menu-user {
    margin-bottom: 12px;
}

.mobile-menu-user__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border: 1px solid #eee;
    border-radius: 16px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
}

.mobile-menu-user__avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bs-primary) 12%, transparent);
    color: var(--bs-primary);
    border: 1px solid color-mix(in srgb, var(--bs-primary) 18%, #eee);
    flex: 0 0 auto;
}

.mobile-menu-user__avatar i {
    font-size: 18px;
}

.mobile-menu-user__meta {
    min-width: 0;
    display: grid;
    line-height: 1.15;
}

.mobile-menu-user__name {
    font-weight: 900;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.mobile-menu-user__sub {
    margin-top: 3px;
    font-size: 12px;
    color: #7a7a7a;
    font-weight: 700;
}

.mobile-menu-user__chev {
    margin-left: auto;
    color: #999;
}

.mobile-menu-user__guest {
    padding: 14px 12px;
    border: 1px solid #eee;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
}

.mobile-menu-user__guestTitle {
    font-weight: 900;
    color: #111;
    margin-bottom: 10px;
}

.mobile-menu-user__guestActions {
    display: flex;
    gap: 10px;
}

.mobile-menu-nav {
    display: grid;
    gap: 6px;
    padding-top: 6px;
}

.mobile-menu-link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 12px !important;
    border-radius: 14px;
    color: #111 !important;
    transition: background-color 0.14s ease, transform 0.08s ease;
}

.mobile-menu-link i {
    font-size: 18px;
    width: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.mobile-menu-link:hover {
    background: #f6f7f9;
}

.mobile-menu-link:active {
    transform: scale(0.99);
}

.mobile-menu-badge {
    margin-left: auto;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--bs-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.mobile-menu-logout {
    border-radius: 14px;
    padding: 12px 12px;
    font-weight: 900;
}

.navbar-toggler {
    border: 0;
    padding: 6px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Mobile hamburger: rounded strokes like the design */
.navbar-toggler-icon {
    width: 26px;
    height: 26px;
    background-size: 26px 26px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23111' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M5 8h20M5 15h20M5 22h20'/%3e%3c/svg%3e");
}

.cart-badge-mobile {
    background: var(--bs-primary);
    color: #fff;
    border: 2px solid #fff;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    animation: cartBadgePulse 1.6s ease-in-out infinite;
}

.cart-badge {
    background: var(--bs-primary);
    color: #fff;
}

.cart-icon-mobile {
    font-size: 26px;
    color: #111;
}

@keyframes cartBadgePulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(255, 106, 0, 0.45);
    }
    55% {
        transform: translate(-50%, -50%) scale(1.08);
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(255, 106, 0, 0);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(255, 106, 0, 0);
    }
}

.logo-img {
    object-fit: contain;
}
.cart-hover-wrapper {
    position: relative;
}

.cart-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    width: 320px;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    display: none;
    z-index: 9999;
    border: 1px solid #eee;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cart-hover-wrapper:hover .cart-dropdown {
    display: block;
}

.cart-item {
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 600;
}

.cart-dropdown-footer {
    margin-top: 10px;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    margin-top: 8px;
    display: none;
    z-index: 9999;
    border: 1px solid #eee;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown.show {
    display: block;
}

.search-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s;
}

.search-dropdown-item:hover {
    background-color: #f8f9fa;
    color: #333;
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

.search-dropdown-item-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
}

.search-dropdown-item-info {
    flex: 1;
    min-width: 0;
}

.search-dropdown-item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dropdown-item-price {
    font-size: 13px;
    color: var(--bs-primary);
    font-weight: 600;
}

.search-dropdown-show-all {
    padding: 12px 16px;
    text-align: center;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

.search-dropdown-show-all-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: linear-gradient(
        135deg,
        var(--bs-primary),
        rgba(var(--bs-primary-rgb), 0.8)
    );
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.search-dropdown-show-all-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(var(--bs-primary-rgb), 0.9),
        rgba(var(--bs-primary-rgb), 0.7)
    );
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.3);
    color: white;
}

.search-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: #777;
    font-size: 14px;
}

.search-dropdown-loading {
    padding: 20px;
    text-align: center;
    color: #777;
    font-size: 14px;
}

/* Mobile bottom nav */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    min-height: 68px;
    padding-top: 6px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.mobile-bottom-nav__item {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: #8a8a8a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 2px;
}

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

.mobile-bottom-nav__label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.mobile-bottom-nav__item.is-active {
    color: #ff6a00;
}

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

.mobile-bottom-nav__badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ff6a00;
    color: #fff;
    border: 2px solid #fff;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.mobile-bottom-nav__badge.is-hidden {
    display: none;
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }

    /* Keep WhatsApp floating button above bottom nav */
    .waflt-widget {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 0.5rem) !important;
        z-index: 1090;
    }
}
