.napoli-branch-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 28px;
    box-sizing: border-box;
    font-family: "Varela Round", Helvetica, Arial, sans-serif;
    color: #2f2b28;
}

.napoli-branch-modal.is-open {
    display: flex;
}

.napoli-branch-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(47, 43, 40, 0.74);
}

.napoli-branch-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 820px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    background: #fdfbf7;
    border: 1px solid rgba(230, 222, 211, 0.9);
    border-radius: 20px;
    padding: 38px;
    box-sizing: border-box;
    box-shadow: 0 24px 70px rgba(47, 43, 40, 0.24);
    scrollbar-color: #cfc5b8 transparent;
    scrollbar-width: thin;
}

.napoli-branch-modal__dialog::-webkit-scrollbar {
    width: 10px;
}

.napoli-branch-modal__dialog::-webkit-scrollbar-track {
    background: transparent;
}

.napoli-branch-modal__dialog::-webkit-scrollbar-thumb {
    background: #cfc5b8;
    border: 3px solid #fdfbf7;
    border-radius: 999px;
}

.napoli-branch-modal__dialog h2 {
    margin: 0 48px 26px 0;
    color: #2f2b28;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.napoli-branch-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: #6f6a65;
    font-family: Arial, sans-serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease;
}

.napoli-branch-modal__close:hover {
    background: rgba(230, 222, 211, 0.5);
    color: #2f2b28;
}

.napoli-branch-modal__close:focus-visible {
    border-color: #0d7a3a;
    outline: 3px solid rgba(13, 122, 58, 0.22);
    outline-offset: 2px;
}

.napoli-branch-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.napoli-branch-modal .napoli-branch-card {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    gap: 13px;
    width: 100%;
    min-height: 116px;
    margin: 0;
    padding: 22px;
    text-align: left;
    appearance: none;
    border: 1px solid #e6ded3;
    border-radius: 14px;
    background: #ffffff;
    color: #2f2b28;
    font-family: "Varela Round", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    cursor: pointer;
    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease;
}

.napoli-branch-modal .napoli-branch-card:hover {
    border-color: #0d7a3a;
    box-shadow: 0 8px 22px rgba(47, 43, 40, 0.08);
}

.napoli-branch-modal .napoli-branch-card:focus-visible {
    border-color: #0d7a3a;
    box-shadow:
        0 8px 22px rgba(47, 43, 40, 0.08),
        0 0 0 3px rgba(13, 122, 58, 0.2);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.napoli-branch-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-top: 1px;
    color: #0d7a3a;
}

.napoli-branch-card__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.napoli-branch-card__content,
.napoli-branch-card__content strong,
.napoli-branch-card__address {
    display: block;
}

.napoli-branch-card__content strong {
    color: #2f2b28;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.napoli-branch-card__address {
    margin-top: 8px;
    color: #6f6a65;
    font-size: 14px;
    line-height: 1.55;
}

.napoli-branch-modal .napoli-branch-card:disabled {
    opacity: 0.55;
    cursor: wait;
}

.napoli-branch-modal__error {
    margin: 20px 0 0;
    color: #d62828;
    font-size: 14px;
    line-height: 1.5;
}

.napoli-branch-modal__scroll-hint {
    display: none;
}

.napoli-branch-modal-open {
    overflow: hidden;
}

.napoli-current-branch {
    display: flex;
    align-items: center;
    gap: 12px;
}

.napoli-change-branch {
    border: 0;
    background: transparent;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 720px) {
    .napoli-branch-modal {
        align-items: flex-start;
        padding: 16px;
    }

    .napoli-branch-modal__dialog {
        max-height: calc(100vh - 32px);
        padding: 30px 22px;
        border-radius: 16px;
    }

    .napoli-branch-modal__dialog h2 {
        margin-right: 44px;
        margin-bottom: 22px;
        font-size: clamp(27px, 8vw, 34px);
    }

    .napoli-branch-modal__close {
        top: 14px;
        right: 14px;
    }

    .napoli-branch-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .napoli-branch-modal .napoli-branch-card {
        min-height: 0;
        padding: 19px;
    }

    .napoli-current-branch {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 767px) {
    .napoli-branch-modal__scroll-hint:not([hidden]) {
        position: absolute;
        z-index: 2;
        bottom: 16px;
        left: 50%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 2px;
        width: calc(100% - 32px);
        max-width: 820px;
        min-height: 74px;
        padding: 34px 18px 12px;
        box-sizing: border-box;
        transform: translateX(-50%);
        background: linear-gradient(
            to bottom,
            rgba(253, 251, 247, 0),
            rgba(253, 251, 247, 0.94) 48%,
            #fdfbf7 76%
        );
        color: #6f6a65;
        font-family: "Varela Round", Helvetica, Arial, sans-serif;
        font-size: 14px;
        line-height: 1.3;
        text-align: center;
        pointer-events: none;
    }

    .napoli-branch-modal__scroll-hint svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: #0d7a3a;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2;
        animation: napoli-branch-scroll-hint 1.8s ease-in-out infinite;
    }
}

@keyframes napoli-branch-scroll-hint {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .napoli-branch-modal__scroll-hint svg {
        animation: none;
    }
}

@media (max-width: 380px) {
    .napoli-branch-modal {
        padding: 10px;
    }

    .napoli-branch-modal__dialog {
        max-height: calc(100vh - 20px);
        padding: 26px 18px;
    }

    .napoli-branch-modal__dialog h2 {
        font-size: 27px;
    }

    .napoli-branch-modal__scroll-hint:not([hidden]) {
        bottom: 10px;
        width: calc(100% - 20px);
    }
}
