/* primary navbar */

#primary-nav {
    background: #161D26;
    color: #FFFFFF;
    padding: 13px 20px;
    margin: 0;
}

.nav-section-primary {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-home-link,
.nav-home-link:hover,
.nav-home-link:visited,
.nav-home-link:active {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #FFFFFF;
    text-decoration: none;
}

/* Powered by Amazon Business */

.nav-powered-by {
    margin-left: auto;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.nav-powered-by__logo {
    height: 20px;
    width: auto;
    vertical-align: middle;
    margin-left: 6px;
}

/* secondary navbar */

#secondary-nav {
    background: #FFFFFF;
    border: 1px solid #E8EAEB;
    box-shadow: 0px 2px 14.2px 0px #97979726;
    overflow: hidden;
    margin: 0;
}

#secondary-nav.nav-two-row {
    min-height: 100px;
}

#secondary-nav.nav-one-row {
    height: 62px;
}



/* Right section flex layout */

.nav-right-flex {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.nav-search-flex {
    flex: 1;
    min-width: 150px;
}

.nav-actions-flex {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

#secondary-nav.a-container {
    padding-bottom: 10px !important;
}

/* Catalogs */

.nav-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.categories-list {
    display: flex;
    gap: 50px;
}

.category-nav-link {
    font-weight: 500;
}

.category-nav-link:hover {
    text-decoration: none !important;
}

.category-nav-link.active {
    position: relative;
    padding-bottom: 8px;
    font-weight: normal;
}

.category-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: #2162A1;
}

.catalog-section {
    height: 37px;
}

/* Credit */

.credit-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remaining-credit {
    display: flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
}

.credit-zero {
    color: #D6001B;
}

.credit-available {
    color: #0B7B3C;
}

/* Location */

.location {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 102px;
    min-height: 24px;
}

#glow-ingress-trigger {
    cursor: default;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #000;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 4px 8px;
}

#glow-ingress-trigger:hover {
    border-color: #888;
}

.glow-ingress-text {
    font-size: 13px;
    line-height: 15px;
    max-width: 120px;
}

#glow-ingress-line2 {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#glow-ingress-line1 {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Account */

.account {
    display: flex;
    flex-direction: column;
    width: fit-content;
    padding: 2px 6px;
    cursor: pointer;
}

.account:hover {
    box-shadow: 0 0 0 1px #888;
    border-radius: 3px;
    color: #000 !important;
    text-decoration: none !important;
}

.account:hover *,
.account:hover .a-link-normal {
    color: #000 !important;
    text-decoration: none !important;
}

.my-account {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: -5px;
    outline: none;
}

.my-account:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

.account:has(.my-account:focus:not(:focus-visible)) {
    box-shadow: none;
}

.my-account:focus-visible {
    outline: none;
}

.account:has(.my-account:focus-visible) {
    box-shadow: 0 0 0 1px #888;
    border-radius: 3px;
}

.account-hello {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.my-account .a-icon-popover {
    margin-bottom: 0px;
}

/* Cart */

.cart-value-text {
    margin-left: 10px;
}

.cart {
    position: relative;
    width: 42px;
    height: 28px;
}

.cart-count {
    position: absolute;
    top: 18%;
    left: 58%;
    transform: translate(-50%, -50%);
    line-height: 1;
    font-weight: 700;
}

.cart-link {
    position: relative;
    display: inline-block;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 4px 4px;
}

.cart-link:hover {
    border-color: #888;
}

.cart-exceeds-credit {
    color: #D6001B;
}

.cart-within-credit {
    color: #0B7B3C;
}

.cart-oop-mobile-wrapper {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.cart-oop-mobile-trigger {
    position : absolute;
    top : 0;
    left : 0;
    width : 100%;
    height : 100%;
    pointer-events : none;
}

/* Right group (mobile) */

.right-group {
    display: flex;
    gap: 45px;
    align-items: flex-end;
}

/* Cart and Order Placed page specific styles */
[data-page-type="cart"] .category-nav-link.active::after,
[data-page-type="order-placed"] .category-nav-link.active::after {
    display: none;
}

/* Checkout mode layout */

.checkout-layout {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    flex: 1;
}

.checkout-layout .a-icon-popover {
    filter: brightness(0) invert(1);
}

.checkout-center {
    position: absolute;
    left: 40%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkout-cart-corner {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

/* Responsive: tablet/smaller desktop */

@media (max-width: 1250px) {
    .credit-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    #secondary-nav .a-fixed-left-grid-inner {
        padding-left: 245px !important;
    }

    #secondary-nav .a-fixed-left-grid-col.a-col-left {
        width: 245px !important;
        margin-left: -245px !important;
    }
}

/* Mobile */

@media (max-width: 480px) {
    #primary-nav,
    #secondary-nav {
        overflow-x: hidden;
        padding: 12px 16px;
    }

    #secondary-nav .nav-container {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 10px;
    }

    #secondary-nav .catalog-section {
        width: 100%;
        height: auto;
    }

    #secondary-nav .remaining-credit {
        flex-wrap: wrap;
    }

    #secondary-nav .categories-list {
        gap: 24px;
    }

    #secondary-nav .right-group {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
    }

}

/* Mobile navbar */

#primary-nav-mobile {
    background: #161D26;
    color: #FFFFFF;
    padding: 12px 16px;
    margin: 0;
}

#primary-nav-mobile .nav-home-link {
    gap: 4px;
}

#secondary-nav-mobile {
    background: #FFFFFF;
    margin: 0;
}

/* labelText="Catalog" is required on the dropdown to render the "Catalog" header
   in the AUI mobile modal. optionPrompt does not produce a modal header.
   This rule hides the label from the collapsed dropdown button only. */
#secondary-nav-mobile .a-button-dropdown.mobile-catalog-dropdown .a-dropdown-label {
    display: none !important;
}

#secondary-nav-mobile .a-button-dropdown.mobile-catalog-dropdown {
    border: none;
}

#secondary-nav-mobile .a-button-dropdown.mobile-catalog-dropdown .a-button-inner {
    display: flex;
    align-items: center;
    gap: 4px;
}

#secondary-nav-mobile .a-button-dropdown.mobile-catalog-dropdown .a-button-text {
    padding-left: 0;
    padding-right: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

#secondary-nav-mobile .a-button-dropdown.mobile-catalog-dropdown .a-icon-dropdown {
    position: static;
    flex-shrink: 0;
    margin: 0;
}

.mobile-location-bar {
    background: #37475A;
}

.mobile-location-bar .glow-ingress-text-mobile,
.mobile-location-bar .glow-ingress-text-mobile span {
    color: #FFFFFF;
    font-size: 12px;
}

.mobile-nav-row {
    padding: 8px 16px;
}

.mobile-right-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.mobile-account-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.mobile-account-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Utility */

.s-spacing-right-small {
    margin-right: 20px;
}
