:root {
    --tw-user-blue: #0007a3;
    --tw-user-blue-bright: #2847df;
    --tw-user-blue-deep: #071742;
    --tw-user-text: #111b3b;
    --tw-user-muted: #707a94;
    --tw-user-border: #e2e7f1;
    --tw-user-shadow: 0 14px 38px rgba(7, 23, 66, .16);
}

/* One Townway customer header for every public page. */
body .tw-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    width: 100%;
    background: linear-gradient(105deg, var(--tw-user-blue-deep), var(--tw-user-blue));
    box-shadow: 0 9px 28px rgba(0, 7, 100, .20);
}

body .tw-header__inner {
    position: relative;
    width: min(1600px, calc(100% - 32px));
    min-height: 74px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto auto minmax(300px, 1fr) minmax(170px, 220px) auto;
    gap: 18px;
    align-items: center;
}

body .tw-header__brand {
    display: inline-flex;
    align-items: center;
    min-width: 120px;
    background: transparent !important;
}

body .tw-header__brand img {
    display: block;
    width: auto;
    max-width: 145px;
    height: 42px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

body .tw-header__nav {
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
}

body .tw-header__nav a,
body .tw-header__nav a:visited {
    color: rgba(255, 255, 255, .90) !important;
    background: transparent !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
}

body .tw-header__nav a:hover,
body .tw-header__nav a:focus,
body .tw-header__nav a.is-active {
    color: #fff !important;
}

body .tw-header__search {
    position: relative;
    display: flex;
    min-width: 0;
    height: 48px;
    overflow: visible;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}

body .tw-header__search input[type="search"] {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 16px;
    border: 0 !important;
    border-radius: 14px 0 0 14px;
    outline: 0;
    color: var(--tw-user-text) !important;
    background: transparent !important;
    font-size: 14px;
}

body .tw-header__search button {
    min-width: 94px;
    height: 48px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 0 13px 13px 0;
    background: var(--tw-user-blue-bright) !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

body .tw-header__search button i {
    color: #fff !important;
    font-size: 18px;
}

body .tw-header__search-results {
    position: absolute;
    top: 55px;
    left: 0;
    right: 0;
    display: none;
    max-height: 420px;
    overflow: auto;
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--tw-user-shadow);
}

body .tw-header__location-wrap {
    position: relative;
    min-width: 0;
}

body .tw-header__location {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 14px;
    background: rgba(255, 255, 255, .12) !important;
    color: #fff !important;
    cursor: pointer;
    text-align: left;
}

body .tw-header__location i,
body .tw-header__location small,
body .tw-header__location strong {
    color: #fff !important;
}

body .tw-header__location span,
body .tw-header__location small,
body .tw-header__location strong {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body .tw-header__location small {
    opacity: .76;
    font-size: 10px;
    font-weight: 600;
}

body .tw-header__location strong {
    font-size: 12px;
    font-weight: 800;
}

body .tw-location-panel {
    position: absolute;
    top: 57px;
    right: 0;
    z-index: 1060;
    width: min(390px, calc(100vw - 28px));
    padding: 18px;
    border: 1px solid var(--tw-user-border);
    border-radius: 18px;
    background: #fff !important;
    color: var(--tw-user-text) !important;
    box-shadow: 0 24px 70px rgba(6, 22, 70, .22);
}

body .tw-location-panel[hidden] {
    display: none !important;
}

body .tw-location-panel__head {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

body .tw-location-panel__head strong,
body .tw-location-panel__head small {
    display: block;
    color: var(--tw-user-text) !important;
}

body .tw-location-panel__head small {
    margin-top: 3px;
    color: var(--tw-user-muted) !important;
    font-size: 11px;
    line-height: 1.45;
}

body .tw-location-panel__head button {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 0;
    border-radius: 50%;
    background: #f0f3fa;
    color: var(--tw-user-text);
    font-size: 20px;
}

body .tw-location-panel label {
    display: block;
    margin: 10px 0 5px;
    color: var(--tw-user-text) !important;
    font-size: 11px;
    font-weight: 800;
}

body .tw-location-panel input[type="text"] {
    width: 100%;
    height: 43px;
    padding: 0 12px;
    border: 1px solid #dce1ec;
    border-radius: 11px;
    color: var(--tw-user-text) !important;
    background: #fff !important;
}

body .tw-location-panel__actions {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

body .tw-location-panel__actions button {
    min-height: 42px;
    padding: 8px 11px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 800;
}

body .tw-location-current {
    border: 1px solid rgba(0, 7, 163, .20);
    background: #eef2ff !important;
    color: var(--tw-user-blue) !important;
}

body .tw-location-save {
    border: 1px solid var(--tw-user-blue);
    background: var(--tw-user-blue) !important;
    color: #fff !important;
}

body .tw-location-status {
    min-height: 18px;
    margin: 10px 0 0;
    color: #18864b;
    font-size: 11px;
    font-weight: 700;
}

body .tw-header__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

body .tw-header__cart,
body .tw-header__cart:visited,
body .tw-header__menu {
    color: #fff !important;
    background: transparent !important;
}

body .tw-header__cart {
    position: relative;
    font-size: 23px;
}

body .tw-header__cart i {
    color: #fff !important;
}

body .tw-header__cart > span {
    position: absolute;
    top: -10px;
    right: -12px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    border: 2px solid #fff;
    background: #3d70ff !important;
    color: #fff !important;
    font-size: 10px;
    font-weight: 800;
}

/* Strong override for category/product pages that were applying a white
   generic account-button background over white account text. */
body .tw-header a.tw-header__account,
body .tw-header a.tw-header__account:visited,
body .tw-header a.tw-header__account:hover,
body .tw-header a.tw-header__account:focus,
body .tw-header a.tw-header__account:active {
    min-width: 118px;
    min-height: 44px;
    padding: 5px 9px;
    display: flex !important;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, .28) !important;
    border-radius: 12px !important;
    background-color: rgba(255, 255, 255, .12) !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #fff !important;
    text-decoration: none !important;
    white-space: nowrap;
}

body .tw-header a.tw-header__account .tw-header__account-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .30) !important;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12) !important;
}

body .tw-header a.tw-header__account .tw-header__account-icon,
body .tw-header a.tw-header__account .tw-header__account-icon i,
body .tw-header a.tw-header__account .tw-header__account-copy,
body .tw-header a.tw-header__account .tw-header__account-copy small,
body .tw-header a.tw-header__account .tw-header__account-copy strong {
    color: #fff !important;
    background: transparent !important;
}

body .tw-header__account-copy {
    min-width: 0;
}

body .tw-header__account-copy small,
body .tw-header__account-copy strong {
    display: block;
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body .tw-header__account-copy small {
    opacity: .76;
    font-size: 10px;
}

body .tw-header__account-copy strong {
    font-size: 12px;
    font-weight: 800;
}

body .tw-header__menu {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 10px;
    background: rgba(255, 255, 255, .10) !important;
    font-size: 20px;
}

body .tw-header__cart-source {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
}

@media (max-width: 1399px) {
    body .tw-header__inner {
        grid-template-columns: auto minmax(300px, 1fr) minmax(170px, 210px) auto;
    }

    body .tw-header__nav {
        position: absolute;
        top: 67px;
        left: 0;
        display: none;
        min-width: 430px;
        padding: 14px 16px;
        flex-wrap: wrap;
        border-radius: 15px;
        background: #fff !important;
        box-shadow: var(--tw-user-shadow);
    }

    body .tw-header__nav.is-open {
        display: flex;
    }

    body .tw-header__nav a,
    body .tw-header__nav a:visited,
    body .tw-header__nav a.is-active {
        color: var(--tw-user-text) !important;
    }

    body .tw-header__menu {
        display: inline-grid;
        place-items: center;
    }
}

@media (max-width: 1199px) {
    body .tw-header__inner {
        width: min(100% - 28px, 1160px);
        grid-template-columns: auto minmax(250px, 1fr) minmax(165px, 195px) auto;
        gap: 13px;
    }

    body .tw-header__account-copy {
        display: none;
    }

    body .tw-header a.tw-header__account {
        min-width: 44px;
        padding: 4px;
    }
}

@media (max-width: 991px) {
    body .tw-header__inner {
        min-height: 132px;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: 60px 52px;
        gap: 8px 12px;
    }

    body .tw-header__brand {
        grid-column: 1;
        grid-row: 1;
    }

    body .tw-header__actions {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    body .tw-header__search {
        grid-column: 1 / 3;
        grid-row: 2;
    }

    body .tw-header__location-wrap {
        grid-column: 3;
        grid-row: 2;
        min-width: 190px;
    }

    body .tw-header__nav {
        top: 58px;
        left: auto;
        right: 0;
        min-width: min(430px, calc(100vw - 28px));
    }
}

@media (max-width: 767px) {
    body .tw-header__inner {
        width: calc(100% - 20px);
        min-height: 178px;
        grid-template-columns: 1fr auto;
        grid-template-rows: 56px 48px 48px;
        gap: 7px 10px;
    }

    body .tw-header__brand {
        grid-column: 1;
        grid-row: 1;
    }

    body .tw-header__brand img {
        max-width: 120px;
        height: 36px;
    }

    body .tw-header__actions {
        grid-column: 2;
        grid-row: 1;
        gap: 10px;
    }

    body .tw-header__search {
        grid-column: 1 / -1;
        grid-row: 2;
        height: 46px;
    }

    body .tw-header__search input[type="search"],
    body .tw-header__search button {
        height: 46px;
    }

    body .tw-header__location-wrap {
        grid-column: 1 / -1;
        grid-row: 3;
        min-width: 0;
    }

    body .tw-header__location {
        height: 44px;
    }

    body .tw-location-panel {
        top: 50px;
        left: 0;
        right: auto;
    }

    body .tw-header__search button {
        min-width: 50px;
        width: 50px;
        padding: 0;
    }

    body .tw-header__search button span {
        display: none;
    }

    body .tw-header__nav {
        top: 52px;
    }
}

@media (max-width: 420px) {
    body .tw-header__brand img {
        max-width: 105px;
    }

    body .tw-header__favorites {
        display: none;
    }

    body .tw-location-panel__actions {
        grid-template-columns: 1fr;
    }
}

/* Townway header logo visibility fix */
body .tw-header__brand img {
    filter: none !important;
}

/* Townway customer account dropdown visibility fix */
body .tw-header__account-dropdown .tw-header__account,
body .tw-header__account-dropdown .tw-header__account:hover,
body .tw-header__account-dropdown.show .tw-header__account {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

body .tw-header__account-dropdown .tw-header__account small,
body .tw-header__account-dropdown .tw-header__account strong,
body .tw-header__account-dropdown .tw-header__account i {
    color: #ffffff !important;
}

body .tw-header__account-dropdown .dropdown-menu {
    right: 0 !important;
    left: auto !important;
    min-width: 220px !important;
    width: auto !important;
    padding: 8px !important;
    background: #ffffff !important;
    border: 1px solid #dfe5f1 !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 30px rgba(16, 35, 80, 0.18) !important;
}

body .tw-header__account-dropdown .dropdown-item {
    display: flex !important;
    align-items: center !important;
    height: auto !important;
    padding: 10px 14px !important;
    color: #17213b !important;
    background: transparent !important;
    line-height: 1.4 !important;
    border-radius: 7px !important;
}

body .tw-header__account-dropdown .dropdown-item i {
    color: #3157d5 !important;
}

body .tw-header__account-dropdown .dropdown-item:hover,
body .tw-header__account-dropdown .dropdown-item:focus {
    color: #2449c5 !important;
    background: #edf2ff !important;
}

body .tw-header__account-dropdown .dropdown-divider {
    border-top-color: #e2e7f0 !important;
    margin: 5px 0 !important;
}

/* Search dropdown: white background with blue text */
body .tw-header__search-results,
body .tw-header__search-results .search-result-box,
body .tw-header__search-results .list-group,
body .tw-header__search-results .list-group-item {
    background: #ffffff !important;
}

body .tw-header__search-results .list-group-item {
    border-color: #e3e8f2 !important;
}

body .tw-header__search-results .list-group-item a {
    display: block !important;
    color: #2449c5 !important;
    background: #ffffff !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

body .tw-header__search-results .list-group-item:hover,
body .tw-header__search-results .list-group-item:hover a {
    color: #1236a8 !important;
    background: #eef3ff !important;
}
