/*
 * Floreko – Wiele Adresów
 * Stylowanie panelu konta i kasy
 */

/* ── Baner "Dodatkowe adresy" na stronie Adresy WC ──────────────────────────── */
.fma-addresses-page-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #f0f7e8;
    border: 1px solid #b8dba0;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.fma-addresses-page-info {
    margin: 0;
    font-size: 0.9rem;
    color: #3a5c25;
}

.fma-addresses-page-btn {
    white-space: nowrap;
    font-weight: 600;
    background: #4a7c28 !important;
    color: #fff !important;
    border-color: #3a6020 !important;
    text-decoration: none;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.fma-addresses-page-btn:hover {
    background: #3a6020 !important;
    color: #fff !important;
}

@media (max-width: 480px) {
    .fma-addresses-page-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Ogólne ──────────────────────────────────────────────────────────────────── */
.fma-wrapper {
    max-width: 1000px;
}

/* ── Nagłówek sekcji ─────────────────────────────────────────────────────────── */
.fma-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.fma-header h2 {
    margin: 0;
}

.fma-add-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Sekcja ──────────────────────────────────────────────────────────────────── */
.fma-section {
    margin-bottom: 40px;
}

.fma-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fma-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: #888;
    margin-left: auto;
}

.fma-empty {
    color: #888;
    font-style: italic;
}

/* ── Karty adresów ───────────────────────────────────────────────────────────── */
.fma-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.fma-card {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 18px 16px 14px;
    position: relative;
    transition: box-shadow 0.2s;
}

.fma-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.fma-card--default {
    border-color: #a0c878;
    background: #f6fbf0;
}

.fma-badge-default {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    background: #5a8f30;
    color: #fff;
    border-radius: 12px;
    padding: 2px 9px;
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

.fma-card-label {
    display: block;
    font-size: 1rem;
    margin-bottom: 6px;
}

.fma-card-address {
    font-style: normal;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 14px;
}

/* ── Akcje na kartach ────────────────────────────────────────────────────────── */
.fma-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fma-card-actions .button {
    font-size: 0.78rem;
    padding: 4px 10px;
}

.fma-btn-delete {
    color: #c0392b !important;
    border-color: #e8c4c0 !important;
}

.fma-btn-delete:hover {
    background: #fdf0ee !important;
}

/* ── Komunikaty ──────────────────────────────────────────────────────────────── */
.fma-notice {
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.fma-notice.fma-notice--success {
    background: #edfae1;
    border: 1px solid #82c96a;
    color: #2e6e14;
}

.fma-notice.fma-notice--error {
    background: #fdecea;
    border: 1px solid #e48a85;
    color: #922820;
}

/* ── Modal ───────────────────────────────────────────────────────────────────── */
.fma-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fma-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

.fma-modal-box {
    position: relative;
    background: #fff;
    border-radius: 10px;
    padding: 32px 28px 24px;
    width: min(600px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
}

.fma-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 4px 8px;
}

.fma-modal-close:hover {
    color: #000;
}

#fma-modal-title {
    margin: 0 0 20px;
    font-size: 1.25rem;
}

/* ── Formularz ───────────────────────────────────────────────────────────────── */
.fma-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

.fma-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fma-field--full {
    grid-column: 1 / -1;
}

.fma-field--half {
    grid-column: span 1;
}

.fma-field--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.fma-field--checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.fma-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.fma-field input,
.fma-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.fma-field input:focus,
.fma-field select:focus {
    border-color: #5a8f30;
    outline: none;
    box-shadow: 0 0 0 2px rgba(90,143,48,0.15);
}

.required {
    color: #e74c3c;
}

.fma-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* ── Selector na stronie kasy ────────────────────────────────────────────────── */
.fma-checkout-selector {
    background: #f0f7e8;
    border: 1px solid #b8dba0;
    border-radius: 7px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.fma-selector-label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.fma-address-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #b8dba0;
    border-radius: 5px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
}

.fma-selector-hint {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.78rem;
}

/* ── Responsywność ───────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
    .fma-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .fma-form-grid {
        grid-template-columns: 1fr;
    }

    .fma-field--full,
    .fma-field--half {
        grid-column: 1;
    }

    .fma-modal-box {
        padding: 24px 16px 18px;
    }

    .fma-modal-actions {
        flex-direction: column;
    }
}
