:root {
    color-scheme: light;
    --azul: rgb(0, 124, 190);
    --azul-escuro: #075f96;
    --cinza: #999999;
    --linha: #e5e5e5;
    --fundo: #f9f9f9;
    --erro: #a22718;
    --sucesso: #0d7a4e;
}

* {
    box-sizing: border-box;
}

html,
body,
input,
select,
textarea,
button {
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--fundo);
    color: var(--azul);
}

.address-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 16px;
}

.address-page > section:not([hidden]) {
    animation: screenFadeSlideIn 0.48s ease both;
}

@keyframes screenFadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .address-page > section:not([hidden]) {
        animation: none;
    }
}

.address-box {
    width: min(520px, 100%);
    min-height: 100vh;
    background: #ffffff;
    border: 1px solid var(--linha);
    padding: clamp(18px, 5vh, 36px) 22px calc(84px + env(safe-area-inset-bottom));
}

.logo {
    display: block;
    width: min(260px, 70%);
    margin: 0 auto clamp(20px, 5vh, 34px);
}

.loyalty-order-heading {
    display: grid;
    justify-items: center;
    gap: 7px;
    margin: 0 auto 22px;
    color: var(--azul);
    text-align: center;
}

.loyalty-order-heading[hidden] {
    display: none;
}

.loyalty-order-heading img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.loyalty-order-heading strong {
    font-family: var(--fonte-media);
    font-size: 20px;
}

.cancel-loyalty-flow-button {
    display: block;
    margin: 12px auto 0;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: var(--azul);
    font-family: var(--fonte-media);
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.cancel-loyalty-flow-button[hidden] {
    display: none;
}

.cancel-loyalty-flow-button:hover,
.cancel-loyalty-flow-button:active,
.cancel-loyalty-flow-button:focus,
.cancel-loyalty-flow-button:focus-visible {
    border: 0;
    outline: none;
    background: #ffffff;
    color: var(--azul);
    box-shadow: none;
}

.address-box.address-flow-transition > * {
    animation: address-flow-fade-in .46s ease both;
}

.address-box.address-flow-leaving > * {
    opacity: 0;
    transform: translateY(5px);
    transition: opacity .28s ease, transform .28s ease;
}

@keyframes address-flow-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .address-box.address-flow-transition > * {
        animation: none;
    }

    .address-box.address-flow-leaving > * {
        transition: none;
    }
}

h1 {
    margin: 0 0 12px;
    font-family: var(--fonte-light);
    font-size: clamp(30px, 8vw, 54px);
    line-height: 1.05;
    font-weight: 300;
}

p {
    margin: 0 0 28px;
    color: var(--cinza);
    font-size: clamp(16px, 4vw, 20px);
    line-height: 1.35;
}

.last-order-card {
    display: grid;
    gap: 8px;
    margin: 0 0 34px;
}

.products-last-order-card {
    margin-bottom: 20px;
}

.last-order-card[hidden] {
    display: none;
}

.recent-address-option {
    display: grid;
    gap: 3px;
    margin: 0 0 22px;
}

.recent-address-option[hidden] { display: none; }

.recent-address-option > span {
    color: #52656e;
    font-family: var(--fonte-media);
    font-size: 14px;
}

.recent-address-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;
}

.recent-address-actions:has(.recent-address-more[hidden]) {
    grid-template-columns: minmax(0, 1fr);
}

.recent-address-option button {
    width: 100%;
    margin: 0;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid rgba(0, 124, 190, .28);
    border-radius: 8px;
    background: #eef8fc;
    color: var(--azul);
    font-family: var(--fonte-media);
    font-size: 15px;
    line-height: 1.3;
    text-align: left;
    white-space: pre-line;
    box-shadow: none;
}

.recent-address-option button.recent-address-more {
    display: grid;
    place-items: center;
    padding: 0;
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
    text-align: center;
}

.recent-address-option button.recent-address-more[hidden] {
    display: none;
}

.recent-address-option button:hover,
.recent-address-option button:active {
    background: #e3f3fa;
    color: var(--azul);
}

.last-order-toggle {
    display: block;
    min-height: 28px;
    max-height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--azul);
    font-family: var(--fonte-media);
    font-size: clamp(15px, 4vw, 18px);
    line-height: 1.35;
    text-align: left;
    box-shadow: none;
    opacity: 1;
    overflow: hidden;
    pointer-events: auto;
    transition: max-height 0.18s ease, opacity 0.18s ease;
}

.last-order-toggle:hover,
.last-order-toggle:focus-visible {
    background: transparent;
    color: var(--azul-escuro);
    outline: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.last-order-card .last-order-summary {
    display: grid;
    gap: 12px;
    width: 100%;
    max-height: 900px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(13, 122, 78, 0.24);
    border-radius: 8px;
    background: #edf8f3;
    color: var(--sucesso);
    font-family: var(--fonte-media);
    font-size: clamp(15px, 4vw, 18px);
    line-height: 1.35;
    text-align: left;
    white-space: pre-line;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.32s ease, opacity 0.24s ease, padding 0.32s ease, border-width 0.32s ease;
}

#ultimo-pedido-resumo a {
    color: inherit;
    text-decoration: none;
    pointer-events: none;
}

.last-order-summary-lines {
    display: grid;
    gap: 5px;
}

.last-order-card.is-collapsed {
    gap: 0;
    margin-bottom: 18px;
}

.last-order-card.is-collapsed .last-order-toggle {
    max-height: 32px;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0.22s;
}

.last-order-card.is-collapsed .last-order-summary {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    opacity: 0;
    pointer-events: none;
}

.last-order-card .last-order-repeat {
    width: 100%;
    min-height: 48px;
    margin: 4px 0 0;
    border: 1px dashed rgba(13, 122, 78, 0.48);
    border-radius: 8px;
    background: #f7fcfa;
    color: var(--sucesso);
    box-shadow: none;
}

.last-order-card .last-order-repeat:not(:disabled):hover,
.last-order-card .last-order-repeat:focus-visible {
    background: #e4f5ed;
    color: var(--sucesso);
    outline: 0;
}

label {
    display: block;
    margin-bottom: 10px;
    font-family: var(--fonte-destaque);
    font-size: clamp(28px, 8vw, 46px);
    color: var(--azul);
}

.autocomplete-wrap {
    position: relative;
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--linha);
    padding: 4px 12px;
}

#pac-input {
    width: 100%;
    min-height: 48px;
    border: 0;
    outline: 0;
    background: #ffffff;
    color: #111111;
    font-size: clamp(16px, 4vw, 20px);
    text-overflow: ellipsis;
}

#pac-input::placeholder {
    color: #777777;
}

gmp-place-autocomplete {
    width: 100%;
    color-scheme: light;
    background: #ffffff;
    color: #111111;
    --md-sys-color-surface: #ffffff;
    --md-sys-color-on-surface: #111111;
    --md-sys-color-on-surface-variant: #555555;
    --md-sys-color-primary: rgb(0, 124, 190);
    --md-sys-color-outline: #e5e5e5;
    --gmp-mat-color-surface: #ffffff;
    --gmp-mat-color-on-surface: #111111;
    --gmp-mat-color-primary: rgb(0, 124, 190);
}

gmp-place-autocomplete::part(input),
gmp-place-autocomplete::part(text-field),
gmp-place-autocomplete::part(input-container) {
    background: #ffffff;
    color: #111111;
    font-family: var(--fonte-media);
    font-size: clamp(16px, 4vw, 20px);
}

gmp-place-autocomplete::part(prediction-list),
gmp-place-autocomplete::part(predictions),
gmp-place-autocomplete::part(listbox) {
    max-height: 240px;
    overflow-y: auto;
    background: #ffffff;
    color: #111111;
    border: 1px solid var(--linha);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
}

.pac-container {
    max-height: 240px !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    color: #111111 !important;
    border: 1px solid var(--linha) !important;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14) !important;
    z-index: 2000 !important;
}

.pac-item {
    color: #333333 !important;
    font-family: var(--fonte-media) !important;
    min-height: 54px !important;
    padding: 8px 12px !important;
}

.pac-item-query {
    color: #111111 !important;
    font-family: var(--fonte-destaque) !important;
}

.selected-address {
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    gap: 10px;
    align-items: center;
    margin: 24px auto 0;
    color: #333333;
    font-size: clamp(15px, 4vw, 19px);
}

.selected-address[hidden] {
    display: none;
}

.pin,
.check {
    color: var(--azul);
    font-family: var(--fonte-destaque);
    font-size: 24px;
    text-align: center;
}

#texto-local {
    overflow: hidden;
    text-overflow: ellipsis;
}

button {
    width: 100%;
    min-height: 52px;
    margin-top: 34px;
    border: 0;
    background: var(--azul);
    color: #ffffff;
    font-family: var(--fonte-destaque);
    font-size: clamp(17px, 4vw, 21px);
    cursor: pointer;
}

button:disabled {
    background: #cfcfcf;
    cursor: not-allowed;
}

button:not(:disabled):hover {
    background: var(--azul-escuro);
}

button.cancel-loyalty-flow-button:hover,
button.cancel-loyalty-flow-button:active,
button.cancel-loyalty-flow-button:focus,
button.cancel-loyalty-flow-button:focus-visible {
    border: 0;
    outline: none;
    background: #ffffff;
    color: var(--azul);
    box-shadow: none;
}

.recent-address-option button:hover,
.recent-address-option button:active,
.recent-address-option button:focus,
.recent-address-option button:focus-visible {
    outline: none;
    background: #eef8fc;
    color: var(--azul);
    box-shadow: none;
}

.available-loyalty-reminder {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 0;
    margin: 0 0 22px;
    padding: 15px 17px;
    border: 1px solid #07547b;
    border-radius: 10px;
    background: #08638f;
    color: #ffffff;
    font-family: var(--fonte-media);
    font-size: 16px;
    line-height: 1.3;
    text-align: left;
    box-shadow: 0 7px 18px rgba(4, 72, 105, .22);
}

.available-loyalty-reminder[hidden] {
    display: none;
}

.available-loyalty-reminder img {
    flex: 0 0 auto;
    width: 45px;
    height: 45px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.available-loyalty-reminder strong {
    color: #ffffff;
}

button.available-loyalty-reminder:hover,
button.available-loyalty-reminder:active,
button.available-loyalty-reminder:focus,
button.available-loyalty-reminder:focus-visible {
    outline: none;
    background: #07577f;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(4, 72, 105, .27);
}

.customer-addresses-modal .modal-panel {
    max-width: 430px;
}

.customer-addresses-modal h2 {
    margin-bottom: 16px;
    color: var(--azul);
}

.customer-addresses-list {
    display: grid;
    gap: 9px;
    max-height: min(55vh, 430px);
    overflow-y: auto;
}

.customer-addresses-list button {
    min-height: 0;
    margin: 0;
    padding: 12px 13px;
    border: 1px solid #d5e8f0;
    border-radius: 8px;
    background: #f5fafc;
    color: #315564;
    font-family: var(--fonte-media);
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
}

.customer-addresses-list button strong,
.customer-addresses-list button span {
    display: block;
}

.customer-addresses-list button span {
    margin-top: 3px;
    color: #647983;
    font-size: 12px;
}

.customer-addresses-list button:hover,
.customer-addresses-list button:active,
.customer-addresses-list button:focus,
.customer-addresses-list button:focus-visible {
    outline: none;
    border-color: #aad5e5;
    background: #eaf6fa;
    color: #315564;
}

button.customer-addresses-cancel,
button.customer-addresses-cancel:hover,
button.customer-addresses-cancel:active,
button.customer-addresses-cancel:focus,
button.customer-addresses-cancel:focus-visible {
    min-height: 44px;
    margin-top: 15px;
    outline: none;
    background: #eef3f5;
    color: #52656e;
    box-shadow: none;
}

.last-order-card button.last-order-toggle,
.last-order-card button.last-order-toggle:hover,
.last-order-card button.last-order-toggle:active,
.last-order-card button.last-order-toggle:focus,
.last-order-card button.last-order-toggle:focus-visible {
    width: auto;
    min-height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--azul);
    box-shadow: none;
    outline: 0;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

#btn-continuar[hidden] {
    display: none;
}

#btn-continuar.address-ready-button {
    position: fixed;
    z-index: 1200;
    left: 50%;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: min(476px, calc(100% - 32px));
    margin: 0;
    transform: translateX(-50%);
    box-shadow: 0 12px 26px rgba(0, 72, 110, 0.18);
}

body.address-action-visible .address-box {
    padding-bottom: calc(94px + env(safe-area-inset-bottom));
}

.message {
    min-height: 24px;
    margin-top: 20px;
    color: var(--cinza);
    font-size: clamp(14px, 3.5vw, 17px);
    line-height: 1.35;
}

.message:empty {
    display: none;
}

.message.error {
    color: var(--erro);
}

.message.success {
    min-height: 0;
    margin: 22px 0 -14px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--sucesso);
    font-family: var(--fonte-destaque);
    font-size: clamp(16px, 4vw, 20px);
    text-align: center;
}

@media (max-width: 560px) {
    .address-page {
        align-items: flex-start;
        min-height: 100svh;
        padding: 0;
    }

    .address-box {
        min-height: 100svh;
        border: 0;
        padding: 18px 5% calc(84px + env(safe-area-inset-bottom));
    }

    #btn-continuar.address-ready-button {
        bottom: calc(6px + env(safe-area-inset-bottom));
        width: calc(100% - 20px);
    }

    .logo {
        width: min(210px, 58%);
        margin-bottom: 18px;
    }

    h1 {
        font-size: clamp(28px, 8vw, 38px);
    }

    label {
        font-size: clamp(24px, 7vw, 34px);
    }
}

@supports (height: 100dvh) {
    body {
        min-height: 100dvh;
    }

    .address-page {
        min-height: 100dvh;
    }

    .address-box {
        min-height: 100dvh;
    }
}
