/* ============================
   GLOBAL SAFETY
============================ */
html, body {
    overflow-x: hidden;
}

/* ============================
   MAIN NAV STYLE
============================ */
.custom-navbar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 100%;
    max-width: 100vw;
    overflow: visible;
}

body {
    padding-top: 70px;
}

.nav-container {
    position: relative;
    z-index: 1;
    overflow: visible;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Allow flex items to shrink */
.nav-left,
.nav-right,
.nav-menu {
    min-width: 0;
}

.nav-left {
    flex: 1 1 auto;
}
.nav-left.gap-5 {
    gap: 1.5rem !important;
}

.nav-right {
    flex: 0 0 auto;
    margin-left: 10px;
}

.nav-left > a {
    flex: 0 0 auto;
}

/* LOGO */
.nav-logo {
    height: 50px;
    max-width: 100%;
}
.nav-logo-mobile {
    display: none;
}

/* ============================
   DESKTOP MENU
============================ */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 1rem;
    flex-wrap: nowrap;
    padding: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
    overflow: hidden;
}
.origami-user-name {
    display: none !important;
}
.nav-menu .px-0 {
    padding-right: 7px !important;
    padding-left: 7px !important;
}
.nav-menu li {
    min-width: 0;
    flex: 0 1 auto;
}
.nav-menu .nav-link {
    display: block;
    text-decoration: none;
    color: #222;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu .nav-link.menu-link {
    background: linear-gradient(135deg, #cc0f2c, #d40015);
    color: #fff !important;
    border-radius: 999px;
    padding: 0.35rem 1.1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    border-bottom: 0;
    box-shadow: 0 4px 12px rgba(212, 0, 21, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.nav-menu .nav-link.menu-link:hover,
.nav-menu .nav-link.menu-link.active {
    background: #d40015 !important;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(176, 16, 48, 0.45);
    border-bottom: 0;
}

.nav-menu .nav-link.active:not(.menu-link) {
    background: transparent;
    color: #d40015;
    border-radius: 0;
    padding: 0;
    border-bottom: 2px solid #d40015;
}

/* ============================
   RIGHT SIDE ICONS
============================ */
.nav-right {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px ;
}

.cart-icon {
    width: auto;
    height: auto;
    font-size: 16px;
    line-height: 1;
    color: #fff;
}

.cart-badge {
    background: #d40015 !important;
    color: #fff !important;
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 11px;
    border-radius: 50%;
    padding: 2px 5px;
    z-index: 2;
}

/* Loyalty points pill */
.points-badge {
    background-color: #d40015 !important;
    color: #ffffff !important;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ROUND ICON BUTTONS (cart, loyalty, user) */
.nav-right .icon-round-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 33px;
    height: 33px;
    background: #d40015;
    border-radius: 50%;
}
.nav-right .icon-round-link:hover {
    text-decoration: none;
}
.nav-right .loyalty-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 33px;
    height: 33px;
    background: #d40015;
    border-radius: 50%;
    text-decoration: none;
}

.nav-right .loyalty-icon {
    color: #fff;
    font-size: 14px;
    line-height: 1;
}

.loyalty-points-badge {
    background: #ffffff !important;
    color: #d40015 !important;
    position: absolute;
    top: -6px;
    right: -8px;
    font-size: 10px;
    border-radius: 999px;
    padding: 2px 5px;
    z-index: 3;
    min-width: 18px;
    text-align: center;
    border: 1px solid #d40015;
    line-height: 1;
}

.nav-right .cart-icon {
    pointer-events: none;
    filter: none;
    color: #fff;
}

/* ============================
   USER DROPDOWN
============================ */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

.user-dropdown-toggle {
    display: flex !important;
    align-items: center;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.user-dropdown-toggle::after {
    display: none !important;
}

/* Dropdown menu */
.nav-right .dropdown-menu {
    background-color: #fff;
    border: 1px solid #eee;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    z-index: 10001;
}

.nav-right .user-dropdown a.origami-user-link {
  display: flex !important;
  align-items: center !important;
  text-decoration: none;
  line-height: 1;
}

.origami-user-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.origami-user-avatar {
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline-block;
  background: transparent;
  padding: 0;
  box-sizing: border-box;
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

/* Safety: if avatar is rendered as <img>, keep it constrained inside round button */
.origami-user-link .origami-user-avatar.o_object_fit_cover {
  width: 16px !important;
  height: 16px !important;
  display: block;
  object-fit: contain;
  border-radius: 0 !important;
}

.origami-user-name {
  font-size: 12px;
  line-height: 1;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #222;
}

@media (max-width: 992px) {
    .nav-logo {
        display: none;
    }

    .nav-logo-mobile {
        display: inline-block;
    }
  .origami-user-avatar {
    width: auto;
    height: auto;
    padding: 0;
    font-size: 26px;
  }
.px-4 {
    padding-right: 0.5rem !important;
    padding-left: 1.5rem !important;
}
  .nav-right .user-dropdown > a.origami-user-link > span.origami-user-name {
    display: none !important;
  }

  .origami-user-stack .origami-user-name {
    display: none !important;
  }
}

.nav-right .dropdown-menu .dropdown-item {
    color: #1a1a1a;
}

.nav-right .dropdown-menu .dropdown-item i {
    color: #d40015 !important;
}

.nav-right .dropdown-menu .dropdown-item:hover {
    background-color: #fff1f1;
    color: #d40015;
}

/* ============================
   BUTTONS
============================ */
.nav-right .btn.btn-primary {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #d40015 !important;
    border-color: #d40015 !important;
}

.nav-right .btn.btn-primary:hover {
    background-color: #b01030 !important;
    border-color: #b01030 !important;
}

/* ============================
   BURGER MENU
============================ */
.burger-btn {
    width: 30px;
    height: 26px;
    cursor: pointer;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.burger-btn span {
    height: 3px;
    background: #000;
    width: 100%;
    border-radius: 4px;
}

/* ============================
   MOBILE MENU
============================ */
@media (max-width: 992px) {

    .custom-navbar {
        background: #d40015;
        border-bottom-color: rgba(255, 255, 255, 0.2);
    }

    .custom-navbar .nav-menu .nav-link {
        color: #000;
    }

    .custom-navbar .nav-menu .nav-link.active {
        background: transparent;
        color: #d40015;
    }

    .custom-navbar .nav-right a,
    .custom-navbar .nav-right span {
        color: #fff;
    }

    .custom-navbar .burger-btn span {
        background: #fff;
    }

    .custom-navbar .cart-icon {
        color: #fff;
    }

    .custom-navbar .cart-badge {
        background: #fff;
        color: #fff !important;
        background-color: transparent !important;
        top: -6px;
        font-size: 14px;
    }

    .custom-navbar .points-badge {
        color: #fff !important;
        border: 1px #fff solid !important;
    }

    .nav-right .loyalty-icon-link {
        width: 35px;
        height: 35px;
    }

    .nav-right .loyalty-icon {
        font-size: 26px;
    }

    .loyalty-points-badge {
        top: -6px;
        right: -8px;
        font-size: 10px;
        min-width: 18px;
    }


    .nav-menu {
        display: none !important;
        flex-direction: column;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: #fff;
        padding: 20px;
        gap: 20px;
        border-top: 1px solid #eee;
        z-index: 10000;
        pointer-events: auto;
    }

    .nav-menu.active {
        display: flex !important;
    }

    .burger-btn {
        display: flex !important;
    }

    .nav-logo,
    .nav-logo-mobile {
        height: 42px;
        margin-left: 25%;
    }
}

/* ============================
   TABLET / SMALL DESKTOP
============================ */
@media (max-width: 1280px) {
    .custom-navbar {
        font-size: 0.95rem;
    }

    .nav-logo {
        height: 48px !important;
    }

    .cart-icon {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }

    .nav-right .loyalty-icon {
        font-size: 26px;
    }

    .user-avatar {
        width: 26px;
        height: 26px;
    }

    .nav-left.gap-5 {
        gap: 1rem !important;
    }

    .nav-menu {
        gap: 0.45rem;
    }

    .nav-menu .nav-link {
        font-size: 11px;
    }

    .nav-menu .px-0 {
        padding-right: 5px !important;
        padding-left: 5px !important;
    }

    .nav-menu .nav-link.menu-link {
        padding: 0.3rem 0.8rem;
        letter-spacing: 0.05em;
    }
}

/* ============================
   SMALL LAPTOPS
============================ */
@media (max-width: 1100px) {
    .custom-navbar {
        font-size: 0.9rem;
    }

    .nav-menu {
        gap: 0.3rem;
    }

    .points-badge {
        font-size: 14px;
        padding: 4px 8px;
    }

    .nav-menu .nav-link {
        font-size: 10.5px;
    }

    .nav-menu .px-0 {
        padding-right: 3px !important;
        padding-left: 3px !important;
    }

    .nav-menu .nav-link.menu-link {
        padding: 0.24rem 0.6rem;
    }

    .nav-right {
        margin-left: 6px;
    }
}

/* ============================
   DESKTOP ONLY
============================ */
@media (min-width: 993px) {
    .burger-btn {
        display: none !important;
    }

    .nav-right .user-dropdown > a.origami-user-link {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .nav-right .user-dropdown > a.origami-user-link > span.origami-user-name {
        display: block !important;
    }

    .origami-user-avatar {
        border: 0;
    }
}

/* ============================
   CLEAN LIST STYLES
============================ */
.nav-right li,
.user-dropdown {
    list-style: none !important;
}
@media (max-width: 472px) {
    /* Hide the username text inside the user dropdown */
    .dropdown-toggle > span {
        display: none !important;
    }

    /* Make sure avatar remains visible */
    .dropdown-toggle img {
        display: inline-block !important;
    }
}
@media (max-width: 992px) {

    /* Make nav-left behave correctly */
    .nav-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }
.cart-icon {
    font-size: 26px;
}
    /* Burger goes first (LEFT) */
    .burger-btn {
        order: 1;
        margin-right: 6px;
    }

    /* Logo goes right after burger */
    .nav-left > a {
        order: 2;
    }

    /* Hide desktop menu (already done, just safety) */
    .nav-menu {
        display: none !important;
    }

    /* Push right icons to the far right */
    .nav-right {
        margin-left: auto;
    }
}
