/* Scoped styles: только страница My Stores (контейнер шорткода) */
.ambersea-my-stores {
    width: 100%;
}

.ambersea-my-stores__notice {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin: 0 0 1rem;
    border: 1px solid transparent;
}

.ambersea-my-stores__notice--success {
    background: #ecf7ed;
    border-color: #b7e0bf;
    color: #1f5b2a;
}

.ambersea-my-stores__notice--error {
    background: #fdecec;
    border-color: #f3b9b9;
    color: #7a1f1f;
}

.ambersea-my-stores__empty {
    margin: 0 0 1.25rem;
}

/* Cards list */
.ambersea-my-stores__cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 0 0 2rem;
    padding: 0;
}

.ambersea-store-card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ambersea-store-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
}

.ambersea-store-card__title {
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ambersea-store-card__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ambersea-store-card__delete-form {
    display: inline;
    margin: 0;
}

.ambersea-store-card__link {
    text-decoration: underline;
    white-space: nowrap;
}

.ambersea-store-card__button {
    background-color: #0073aa;
    color: #fff;
    padding: 0.45em 0.9em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.ambersea-store-card__button:hover {
    background-color: #006799;
}

.ambersea-store-card__body {
    display: grid;
    gap: 0.5rem;
}

.ambersea-store-card__row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.75rem;
    align-items: start;
}

.ambersea-store-card__label {
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

.ambersea-store-card__value {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 520px) {
    .ambersea-store-card__row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .ambersea-store-card__label {
        white-space: normal;
    }
}

/* Form styling (scoped), чтобы не влиять на тему */
.ambersea-my-stores form button,
.ambersea-my-stores form input[type="submit"] {
    background-color: #0073aa;
    color: white;
    padding: 0.5em 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.ambersea-my-stores form button:hover,
.ambersea-my-stores form input[type="submit"]:hover {
    background-color: #006799;
}

.ambersea-my-stores form a,
.ambersea-my-stores .manage-stores-link {
    margin-left: 1em;
    text-decoration: underline;
}

.ambersea-my-stores form div {
    margin-bottom: 1em;
}

.ambersea-my-stores form label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.3em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   [ambersea_my_clients] — Frontend agent panel
   ───────────────────────────────────────────────────────────────────────────── */

.ambersea-my-clients {
    width: 100%;
}

.ambersea-my-clients__notice {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin: 0 0 1.25rem;
    border: 1px solid transparent;
}

.ambersea-my-clients__notice--success {
    background: #ecf7ed;
    border-color: #b7e0bf;
    color: #1f5b2a;
}

.ambersea-my-clients__notice--error {
    background: #fdecec;
    border-color: #f3b9b9;
    color: #7a1f1f;
}

/* Sections */
.ambersea-my-clients__section {
    margin-bottom: 2.5rem;
}

.ambersea-my-clients__section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.ambersea-my-clients__count {
    font-size: 0.8em;
    color: #777;
    font-weight: 400;
}

/* Add client form */
.ambersea-my-clients__form {
    max-width: 480px;
}

.ambersea-my-clients__fields {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 0.75rem;
}

.ambersea-my-clients__field {
    display: grid;
    gap: 0.25rem;
}

.ambersea-my-clients__label {
    font-weight: 600;
    font-size: 0.9rem;
}

.ambersea-my-clients__required {
    color: #c0392b;
}

.ambersea-my-clients__input {
    width: 100%;
    padding: 0.5em 0.7em;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.ambersea-my-clients__input:focus {
    outline: 2px solid #0073aa;
    border-color: #0073aa;
}

.ambersea-my-clients__hint {
    font-size: 0.8rem;
    color: #666;
    margin: 0.1rem 0 0;
}

.ambersea-my-clients__button {
    margin-top: 0.5rem;
    background-color: #0073aa;
    color: #fff;
    padding: 0.55em 1.2em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
}

.ambersea-my-clients__button:hover {
    background-color: #006799;
}

/* Clients table */
.ambersea-my-clients__empty {
    color: #555;
    margin: 0;
}

.ambersea-my-clients__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ambersea-my-clients__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 400px;
}

.ambersea-my-clients__table thead th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #ddd;
    font-weight: 700;
    background: #f8f8f8;
    white-space: nowrap;
}

.ambersea-my-clients__table tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.ambersea-my-clients__table tbody tr:last-child td {
    border-bottom: none;
}

.ambersea-my-clients__table tbody tr:hover {
    background: #fafafa;
}

/* Agent cell: inline label + reassign form */
.ambersea-my-clients__agent-cell {
    white-space: nowrap;
}

.ambersea-my-clients__agent-label {
    display: block;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.3rem;
}

.ambersea-my-clients__reassign-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.ambersea-my-clients__reassign-select {
    font-size: 0.8rem;
    padding: 0.25em 0.4em;
    border: 1px solid #ccc;
    border-radius: 4px;
    max-width: 160px;
}

.ambersea-my-clients__reassign-btn {
    font-size: 0.8rem;
    padding: 0.25em 0.65em;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.ambersea-my-clients__reassign-btn:hover {
    background: #006799;
}

.ambersea-my-clients__orders-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
}

.ambersea-my-clients__orders-link:hover {
    text-decoration: underline;
}

@media (max-width: 520px) {
    .ambersea-my-clients__form {
        max-width: 100%;
    }

    .ambersea-my-clients__agent-cell {
        white-space: normal;
    }

    .ambersea-my-clients__reassign-form {
        flex-wrap: wrap;
    }
}

/* ─── Mobile: My Clients table ──────────────────────────────────────────── */

/* ≤768px: скрываем Registered */
@media (max-width: 768px) {
    .ambersea-my-clients__table thead th:nth-child(5),
    .ambersea-my-clients__table tbody td:nth-child(5) { display: none; } /* Registered */
}

/* ≤600px: скрываем Email и Stores */
@media (max-width: 600px) {
    .ambersea-my-clients__table thead th:nth-child(2),
    .ambersea-my-clients__table tbody td:nth-child(2) { display: none; } /* Email */

    .ambersea-my-clients__table thead th:nth-child(4),
    .ambersea-my-clients__table tbody td:nth-child(4) { display: none; } /* Stores */

    .ambersea-my-clients__input {
        font-size: 16px; /* предотвращает auto-zoom в iOS */
    }

    .ambersea-my-clients__button {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }
}

/* ≤480px: card view */
@media (max-width: 480px) {
    .ambersea-my-clients__table-wrap {
        overflow-x: visible;
    }

    /* Сброс min-width — причина overflow */
    .ambersea-my-clients__table {
        min-width: 0 !important;
        width: 100% !important;
    }

    .ambersea-my-clients__table,
    .ambersea-my-clients__table tbody {
        display: block;
    }

    .ambersea-my-clients__table thead {
        display: none;
    }

    .ambersea-my-clients__table tbody tr {
        display: block;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 10px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    .ambersea-my-clients__table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        border: none;
        padding: 5px 0;
        font-size: 0.9rem;
    }

    /* Name: заголовок карточки */
    .ambersea-my-clients__table tbody td:nth-child(1) {
        font-size: 1rem;
        font-weight: 700;
        padding-bottom: 8px;
        border-bottom: 1px solid #f0f0f0;
        margin-bottom: 4px;
    }

    /* Agent cell: блочная раскладка */
    .ambersea-my-clients__agent-cell {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .ambersea-my-clients__reassign-form {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .ambersea-my-clients__reassign-select {
        max-width: 100%;
        font-size: 1rem;
        padding: 10px 8px;
        border-radius: 6px;
    }

    .ambersea-my-clients__reassign-btn {
        font-size: 1rem;
        padding: 10px 14px;
        border-radius: 6px;
        text-align: center;
    }

    /* Orders ссылка: кнопка */
    .ambersea-my-clients__orders-link {
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px;
        background: #f0f0f0;
        border-radius: 6px;
        font-size: 0.9rem;
        font-weight: 600;
        margin-top: 6px;
    }
}

/* =============================================================
 * CUSTOMER APPLICATION FORM — [ambersea_register_form]
 * ============================================================= */

.ambersea-register-form {
    max-width: 640px;
    margin: 0 auto 3rem;
    font-size: 15px;
}

/* Intro */
.ambersea-register-form__intro {
    margin: 0 0 2rem;
}

.ambersea-register-form__intro-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.ambersea-register-form__intro-text {
    color: #555;
    line-height: 1.55;
    margin: 0;
}

/* Notices */
.ambersea-register-form__notice {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 0 0 1.5rem;
    border: 1px solid transparent;
    font-size: 14px;
}

.ambersea-register-form__notice--error {
    background: #fdecec;
    border-color: #f3b9b9;
    color: #7a1f1f;
}

.ambersea-register-form__notice--info {
    background: #f0f7ff;
    border-color: #b8d9f8;
    color: #1a4a7a;
}

/* Fieldsets */
.ambersea-register-form__fieldset {
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 0 0 1.5rem;
}

.ambersea-register-form__legend {
    padding: 0 0.5rem;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #444;
}

/* Form groups */
.ambersea-register-form__group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0 0 1rem;
}

.ambersea-register-form__group:last-child {
    margin-bottom: 0;
}

.ambersea-register-form__row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.ambersea-register-form__label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.ambersea-register-form__req {
    color: #c0392b;
}

.ambersea-register-form__opt {
    font-weight: 400;
    color: #888;
    font-size: 12px;
}

.ambersea-register-form__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
    -webkit-appearance: none;
}

.ambersea-register-form__input:focus {
    outline: none;
    border-color: #222;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.06);
}

.ambersea-register-form__input::placeholder {
    color: #aaa;
}

.ambersea-register-form__textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Consent checkboxes */
.ambersea-register-form__consent {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0 0 1.75rem;
}

.ambersea-register-form__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    line-height: 1.45;
}

.ambersea-register-form__checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    accent-color: #222;
    cursor: pointer;
}

.ambersea-register-form__checkbox-label a {
    color: #222;
    font-weight: 600;
}

/* Submit */
.ambersea-register-form__actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.ambersea-register-form__btn {
    display: inline-block;
    background: #111;
    color: #fff;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    -webkit-appearance: none;
}

.ambersea-register-form__btn:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}

.ambersea-register-form__login-hint {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.ambersea-register-form__login-hint a {
    color: #222;
    font-weight: 600;
}

/* Success state */
.ambersea-register-form__success {
    max-width: 480px;
    margin: 2rem auto;
    text-align: center;
    padding: 2.5rem 2rem;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
}

.ambersea-register-form__success-icon {
    width: 56px;
    height: 56px;
    background: #111;
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.ambersea-register-form__success-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.ambersea-register-form__success p {
    color: #555;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

/* Mobile */
@media (max-width: 540px) {
    .ambersea-register-form__row--2col {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .ambersea-register-form__group {
        margin-bottom: 1rem;
    }

    .ambersea-register-form__fieldset {
        padding: 1rem;
    }

    .ambersea-register-form__actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
