/* ==========================================================================
   Address Form Modal
   ========================================================================== */

#tsc-address-form-modal { z-index: 100002; }

.tsc-form-group { margin-bottom: 16px; }
.tsc-form-group__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #161823;
    margin-bottom: 6px;
}
.tsc-form-group__required {
    color: #161823;
    margin-left: 2px;
}
.tsc-form-group__input,
.tsc-form-group__select {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ececef;
    border-radius: 8px;
    font-size: 14px;
    color: #161823;
    background: #f5f5f7;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s, background 0.15s;
}
.tsc-form-group__input:focus,
.tsc-form-group__select:focus {
    outline: none;
    border-color: #161823;
    background: #fff;
}
.tsc-form-group__select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8b91' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
.tsc-form-group__error {
    font-size: 12px;
    color: #161823;
    margin-top: 4px;
    display: none;
}
.tsc-form-group.has-error .tsc-form-group__input,
.tsc-form-group.has-error .tsc-form-group__select {
    border-color: #161823;
}
.tsc-form-group.has-error .tsc-form-group__error { display: block; }

.tsc-form-row {
    display: flex;
    gap: 10px;
}
.tsc-form-row > .tsc-form-group {
    flex: 1;
    min-width: 0;
}

.tsc-form-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-top: 8px;
    border-top: 1px solid #ececef;
}
.tsc-form-toggle__label {
    font-size: 14px;
    font-weight: 500;
    color: #161823;
}
.tsc-form-toggle__switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.tsc-form-toggle__switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.tsc-form-toggle__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d4d5d9;
    border-radius: 24px;
    transition: background 0.2s;
}
.tsc-form-toggle__slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.tsc-form-toggle__switch input:checked + .tsc-form-toggle__slider {
    background: #161823;
}
.tsc-form-toggle__switch input:checked + .tsc-form-toggle__slider::before {
    transform: translateX(20px);
}

.tsc-form-save {
    width: 100%;
    padding: 14px;
    background: var(--global-palette-btn-bg, #161823) !important;
    color: var(--global-palette-btn, #fff) !important;
    border: 0;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.tsc-form-save:disabled {
    background: #f5f5f7 !important;
    color: #b0b1b7 !important;
    cursor: not-allowed;
}

.tsc-form-delete {
    display: block;
    width: 100%;
    padding: 12px;
    background: #000000 !important;
    color: #ffffff !important;
    border: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    font-family: inherit;
    transition: background 0.15s;
}
.tsc-form-delete:disabled {
    color: #b0b1b7 !important;
    cursor: not-allowed;
}

.tsc-form-loading {
    text-align: center;
    padding: 30px;
    color: #8a8b91;
    font-size: 14px;
}

/* Custom Confirmation Dialog */
.tsc-confirm {
    position: fixed;
    inset: 0;
    /* One step above .tsc-modal (99999999999) so the confirm dialog stacks
       on top of any open modal. Also clears .tsc-cart__bottombar. */
    z-index: 100000000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tsc-confirm__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: tscConfirmBackdropIn 0.2s ease-out;
}
.tsc-confirm__box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 320px;
    padding: 24px 20px 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    text-align: center;
    animation: tscConfirmBoxIn 0.2s ease-out;
}
.tsc-confirm__title {
    font-size: 16px;
    font-weight: 600;
    color: #161823;
    margin-bottom: 8px;
}
.tsc-confirm__msg {
    font-size: 14px;
    color: #8a8b91;
    line-height: 1.5;
    margin-bottom: 20px;
}
.tsc-confirm__actions {
    display: flex;
    gap: 8px;
}
.tsc-confirm__btn {
    flex: 1;
    padding: 11px;
    border: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.tsc-confirm__btn--cancel {
    background: #f5f5f7;
    color: #161823;
}
.tsc-confirm__btn--confirm {
    background: var(--global-palette-btn-bg, #161823) !important;
    color: var(--global-palette-btn, #fff) !important;
}

@keyframes tscConfirmBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes tscConfirmBoxIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
/* Save + Delete buttons share one row on tablet and desktop. */
@media (min-width: 768px) {
    .tsc-modal__footer:has(.tsc-form-save) {
        display: flex;
        gap: 12px;
    }
    .tsc-modal__footer:has(.tsc-form-save) .tsc-form-save,
    .tsc-modal__footer:has(.tsc-form-save) .tsc-form-delete {
        flex: 1;
        width: auto;
        margin-top: 0;
    }
}
