/* AddressBook skin object "Arjang": the address sheet of the checkout in the look of Figma "Address Edit" (30402:2892) —
   a paper coloured sheet (#EBDBBE) with a torn paper top edge that slides up from the bottom over a dark veil; the site
   column wide. Texts #53565A, accent gold #C49E31. The header «ارسال به» button of the default template is not used
   (checkout.js opens the sheet through the hidden trigger). */
.eab-holder { display: none !important; }

.eab-modal {
    --eab-paper: #ebdbbe; --eab-text: #53565a; --eab-gold: #c49e31; --eab-line: #f5f5f5; --eab-field: #f6eedd;
    position: fixed; inset: 0; z-index: 10050; display: none; align-items: flex-end; justify-content: center;
    background: rgba(18, 4, 4, 0); transition: background-color .3s ease; font-family: inherit; direction: rtl;
}
.eab-modal.eab-open { display: flex; }
.eab-modal.eab-in { background: rgba(18, 4, 4, .72); }
.eab-dialog {
    position: relative; width: 100%; max-width: 524px; height: min(82vh, 690px); margin-top: 65px;
    background: var(--eab-paper); color: var(--eab-text); display: flex; flex-direction: column;
    transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -8px 30px rgba(0, 0, 0, .25);
}
.eab-modal.eab-in .eab-dialog { transform: none; }
/* the torn paper edge above the sheet */
.eab-dialog::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 65px; margin-bottom: -1px; pointer-events: none;
    background: url(../images/paper.png) center bottom / 100% 100% no-repeat;
}
.eab-step { display: none; flex-direction: column; min-height: 0; flex: 1; }
.eab-step.eab-active { display: flex; }

/* heads */
.eab-head { display: flex; align-items: center; gap: 8px; padding: 18px 20px 14px; }
.eab-head strong { flex: 1; font-size: 14px; font-weight: 700; line-height: 28px; color: var(--eab-text); }
.eab-head-list { padding: 20px 20px 16px; }
.eab-close, .eab-back { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--eab-text); font-size: 18px; }
.eab-close:hover, .eab-back:hover { background: rgba(83, 86, 90, .08); }
.eab-add { display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700; line-height: 28px; color: var(--eab-gold); }
.eab-add img { width: 24px; height: 24px; max-height: none; }

.eab-body { flex: 1; min-height: 0; overflow: auto; padding: 0 15px 20px; }
.eab-foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(83, 86, 90, .12); }
.eab-foot small { font-size: 12px; line-height: 22px; color: var(--eab-text); opacity: .8; }
.eab-foot-link { display: none; }
.eab-btn { height: 48px; width: 100%; border: 0; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700; color: #4a0505; background: linear-gradient(180deg, #e5c35c 0%, #c49e31 100%); box-shadow: 0 4px 12px rgba(196, 158, 49, .35); }
.eab-btn:hover { filter: brightness(1.05); }
.eab-link { padding: 0; border: 0; background: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--eab-gold) !important; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.eab-busy { pointer-events: none; opacity: .6; }

/* the addresses */
.eab-list { list-style: none; margin: 0; padding: 0; }
.eab-item { display: flex; flex-direction: column; gap: 16px; padding: 20px 4px 16px; border-bottom: 1px solid var(--eab-line); cursor: pointer; outline: none; }
.eab-item:focus-visible { box-shadow: 0 0 0 2px var(--eab-gold); border-radius: 12px; }
.eab-item-top { display: flex; align-items: center; gap: 16px; height: 28px; }
.eab-radio { flex: 0 0 auto; width: 18px; height: 18px; background: url(../images/radio-off.svg) center / 18px no-repeat; }
.eab-item.eab-selected .eab-radio { background-image: url(../images/radio-on.svg); }
.eab-name { font-size: 14px; line-height: 28px; color: var(--eab-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eab-edit { margin-inline-start: auto; padding: 0; border: 0; background: none; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700; line-height: 28px; color: var(--eab-gold); }
.eab-details { display: flex; flex-direction: column; gap: 6px; }
.eab-line { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 28px; color: var(--eab-text); }
.eab-line img { flex: 0 0 24px; width: 24px; height: 24px; max-height: none; }
.eab-line > span { min-width: 0; }
.eab-empty { padding: 48px 0; text-align: center; font-size: 14px; line-height: 28px; color: var(--eab-text); }
.eab-guest { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 8px; text-align: center; }
.eab-guest p { margin: 0; font-size: 14px; line-height: 28px; color: var(--eab-text); }
.eab-area { font-size: 14px; font-weight: 700; color: var(--eab-text); }

/* the map */
.eab-mapbody { position: relative; padding: 0; display: flex; flex-direction: column; }
.eab-map { flex: 1; min-height: 280px; }
.eab-search { position: absolute; top: 12px; inset-inline: 12px; z-index: 1000; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; background: #fff; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.eab-search > i { color: var(--eab-text); padding-inline-start: 6px; }
.eab-search-input { flex: 1; min-width: 0; height: 44px; border: 0; outline: none; background: none; font-family: inherit; font-size: 13px; color: var(--eab-text); }
.eab-search-go { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--eab-paper); color: var(--eab-text); font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.eab-search-results { position: absolute; top: 100%; inset-inline: 0; margin: 6px 0 0; padding: 0; list-style: none; max-height: 240px; overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.eab-search-results:empty { display: none; }
.eab-search-results li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--eab-line); cursor: pointer; font-size: 13px; color: var(--eab-text); }
.eab-search-results li small { font-size: 11px; opacity: .75; }
.eab-search-results li:hover { background: var(--eab-field); }
.eab-pin { position: absolute; top: 50%; left: 50%; z-index: 999; transform: translate(-50%, -100%); pointer-events: none; color: #8b1b1b; font-size: 38px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }
.eab-locate { position: absolute; bottom: 16px; inset-inline-start: 16px; z-index: 1000; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); cursor: pointer; font-size: 18px; color: var(--eab-text); }
.eab-manual { align-self: center; }

/* the address form */
.eab-form { padding-top: 4px; }
.eab-point { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 12px; border-radius: 14px; background: var(--eab-field); font-size: 12px; color: var(--eab-text); }
.eab-point-text { flex: 1; }
.eab-point i { color: var(--eab-gold); }
.eab-field { margin-bottom: 14px; }
.eab-field label, .eab-form > label:not(.eab-self) { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--eab-text); }
.eab-field label b { color: #b3261e; font-weight: 400; }
.eab-form input[type=text], .eab-form textarea {
    width: 100%; box-sizing: border-box; padding: 10px 14px; border: 1px solid rgba(83, 86, 90, .25); border-radius: 14px; outline: none; resize: none;
    background: var(--eab-field); color: var(--eab-text); font-family: inherit; font-size: 14px; text-align: right;
}
.eab-form input[dir=ltr] { text-align: left; }
.eab-form input[type=text]:focus, .eab-form textarea:focus { border-color: var(--eab-gold); box-shadow: 0 0 0 3px rgba(196, 158, 49, .18); }
.eab-form .select2-container .select2-selection--single { height: 44px; border: 1px solid rgba(83, 86, 90, .25); border-radius: 14px; background: var(--eab-field); }
.eab-form .select2-container .select2-selection__rendered { line-height: 42px; color: var(--eab-text); }
.eab-form .select2-container .select2-selection__arrow { height: 42px; }
.eab-hint { display: block; margin-top: 4px; font-size: 11px; color: var(--eab-text); opacity: .75; }
.eab-ferr { display: block; margin-top: 4px; font-size: 11px; color: #b3261e; }
.eab-ferr:empty { display: none; }
.eab-invalid input[type=text], .eab-invalid textarea, .eab-invalid .select2-selection { border-color: #b3261e !important; }
.eab-invalid .eab-hint { display: none; }
.eab-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.eab-chips { display: flex; gap: 6px; margin-top: 8px; }
.eab-chip { padding: 3px 14px; border: 1px solid var(--eab-gold); border-radius: 999px; background: none; cursor: pointer; font-family: inherit; font-size: 12px; color: var(--eab-text); }
.eab-chip:hover { background: var(--eab-gold); color: #fff; }
.eab-self { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--eab-text); }
.eab-self input { width: 18px; height: 18px; margin: 0; accent-color: var(--eab-gold); }
.eab-self-info { margin: 0 26px 12px; font-size: 12px; color: var(--eab-text); opacity: .8; }
.eab-receiver { padding-top: 12px; border-top: 1px dashed rgba(83, 86, 90, .3); }
.eab-error { font-size: 12px; color: #b3261e; }
.eab-error:empty { display: none; }
.select2-container--open .select2-dropdown { border-color: rgba(83, 86, 90, .25); border-radius: 14px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) { .eab-modal, .eab-dialog { transition: none; } }
