/**
 * Web menü: üst alandaki üyelik seviyesi + puan yongaları ve Profilim sayfası görünümü.
 * Yerel dosyadır (CDN değil), footer.php yükler.
 *
 * Marka kendi ek CSS dosyasıyla (custom.css / theme_css) renkleri değiştirebildiği için:
 * - Marka rengi varsayımı yapılmaz, yüzeyler nötr tutulur (seviye rengi yalnız .cl-badge üzerinden gelir).
 * - Seçiciler wmp- ve wm- önekiyle sınırlıdır, !important kullanılmaz; marka CSS i istediğinde üzerine yazabilir.
 */

/* ---------------------------------------------------------------- üst alan: seviye + puan yan yana */
.wm-user-chips {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

/* Yerleşim: ikisi de aynı satırda, aynı köşe yarıçapında ve aynı yazı boyutunda. Renklere karışılmaz. */
.wm-user-chips .cl-badge,
.wm-user-chips .wm-chip {
    margin: 0;
    max-width: none;
    white-space: nowrap;
    line-height: 1.5;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold !important;
    gap: 0;
}

/* Boşluk yalnız ikonun sağında */
.wm-user-chips .cl-badge i.fa,
.wm-user-chips .wm-chip i.fa {
    margin-right: 4px;
}

/* Para puan yongası */
.wm-user-chips .wm-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    text-decoration: none;
    background: #c9a977;
    color: #fff;
    font-weight: 500;
}

.wm-user-chips .wm-chip:hover,
.wm-user-chips .wm-chip:focus {
    color: #fff;
    text-decoration: none;
}

@media (max-width: 480px) {
    .wm-user-chips {
        flex-wrap: wrap;
    }
}

/* ---------------------------------------------------------------- Profilim sayfası */
.wmp {
    --wmp-ink: #1d1d1f;
    --wmp-muted: #6b6f76;
    --wmp-line: #e4e6ea;
    --wmp-surface: #fff;
    --wmp-soft: #f6f7f9;
    --wmp-radius: 10px;
    color: var(--wmp-ink);
    font-size: 14px;
    margin-bottom: 40px;
}

.wmp *,
.wmp *::before,
.wmp *::after {
    box-sizing: border-box;
}

/* Kart */
.wmp-card {
    background: var(--wmp-surface);
    border: 1px solid var(--wmp-line);
    border-radius: var(--wmp-radius);
    overflow: hidden;
}

/* Alt alta gelen kartlar arası boşluk (yan yana ızgarada geçerli değil) */
.wmp > .wmp-card + .wmp-card {
    margin-top: 18px;
}

.wmp-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px 0;
}

.wmp-card-head h2 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--wmp-ink);
}

.wmp-card-head small {
    font-size: 12.5px;
    color: var(--wmp-muted);
}

.wmp-card-body {
    padding: 15px 18px 18px;
}

/* Üst kimlik kartı */
.wmp-hero {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
}

.wmp-ava {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wmp-soft);
    border: 1px solid var(--wmp-line);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .04em;
    color: var(--wmp-ink);
    text-transform: uppercase;
}

.wmp-hero-main {
    flex: 1 1 auto;
    min-width: 0;
}

.wmp-name {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.25;
    word-break: break-word;
}

.wmp-sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--wmp-muted);
}

.wmp-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.wmp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 5px;
    background: var(--wmp-soft);
    border: 1px solid var(--wmp-line);
    font-size: 12px;
    font-weight: 700;
    color: var(--wmp-ink);
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
}

.wmp-chip i.fa {
    opacity: .7;
}

a.wmp-chip:hover,
a.wmp-chip:focus {
    background: #eef0f3;
    color: var(--wmp-ink);
    text-decoration: none;
}

.wmp-chips .cl-badge {
    margin: 0;
    padding: 4px 11px;
    font-size: 12px;
    border-radius: 5px;
}

/* Yerleşim */
.wmp-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 18px;
    align-items: flex-start;
}

.wmp-col-main {
    flex: 1 1 420px;
    min-width: 0;
    margin: 0;
}

.wmp-col-side {
    flex: 0 1 340px;
    min-width: 0;
    margin: 0;
}

/* Alan ızgarası */
.wmp-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

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

.wmp-field > label {
    display: block;
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--wmp-muted);
    letter-spacing: .02em;
}

.wmp-input {
    position: relative;
    display: block;
}

.wmp-input > i.fa {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    font-size: 14px;
    color: #9aa0a8;
    pointer-events: none;
    z-index: 2;
}

.wmp-input .form-control,
.wmp-input input.form-control,
.wmp-input select.form-control {
    width: 100%;
    height: 44px;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--wmp-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    font-size: 14px;
    color: var(--wmp-ink);
    transition: border-color .15s ease, background-color .15s ease;
}

.wmp-input select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #9aa0a8 50%), linear-gradient(135deg, #9aa0a8 50%, transparent 50%);
    background-position: calc(100% - 19px) 19px, calc(100% - 14px) 19px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.wmp-input .form-control:focus {
    border-color: #9aa0a8;
    box-shadow: none;
    outline: none;
}

.wmp-input .form-control[disabled],
.wmp-input .form-control[readonly] {
    background: var(--wmp-soft);
    color: #85898f;
    cursor: not-allowed;
}

/* Telefon alanı: intl-tel-input kendi kabını koyar */
.wmp-input.is-tel > i.fa {
    display: none;
}

.wmp-input.is-tel .iti {
    width: 100%;
    display: block;
}

.wmp-input.is-tel .form-control {
    padding-left: 14px;
}

.wmp-input.is-tel .iti--separate-dial-code .form-control {
    padding-left: 88px;
}

.wmp-hint {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--wmp-soft);
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--wmp-muted);
}

.wmp-hint i.fa {
    margin-top: 2px;
}

/* Bölüm başlığı (kart içi) */
.wmp-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--wmp-line);
}

.wmp-section-title {
    margin: 0 0 12px;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: .02em;
}

/* İzin anahtarları */
.wmp-perms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.wmp-perm {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid var(--wmp-line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--wmp-ink);
    cursor: pointer;
}

.wmp-perm input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wmp-switch {
    flex: 0 0 auto;
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #d8dbe0;
    transition: background-color .18s ease;
}

.wmp-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .18s ease;
}

.wmp-perm input:checked + .wmp-switch {
    background: #6b7078;
}

.wmp-perm input:checked + .wmp-switch::after {
    transform: translateX(16px);
}

.wmp-perm input:focus + .wmp-switch {
    outline: 2px solid #b9bfc8;
    outline-offset: 2px;
}

/* Kart altı işlem satırı */
.wmp-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid var(--wmp-line);
}

.wmp-actions .btn.theme-btn {
    min-width: 150px;
    height: 44px;
    padding: 0 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
    box-shadow: none;
}

/* Adres listesi */
.wmp-address-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wmp-address {
    position: relative;
    padding: 13px 14px;
    border: 1px solid var(--wmp-line);
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s ease;
}

.wmp-address:hover {
    border-color: #c9ced6;
}

.wmp-address-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 66px;
}

.wmp-address-title {
    font-size: 14px;
    font-weight: 800;
    word-break: break-word;
}

.wmp-address-phone {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--wmp-muted);
    font-variant-numeric: tabular-nums;
}

.wmp-address-text {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #45484d;
    word-break: break-word;
}

.wmp-address-tools {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
}

.wmp-icon-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: 1px solid var(--wmp-line);
    background: #fff;
    color: var(--wmp-muted);
    font-size: 13px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.wmp-icon-btn:hover,
.wmp-icon-btn:focus {
    background: var(--wmp-soft);
    color: var(--wmp-ink);
    text-decoration: none;
}

.wmp-icon-btn.is-danger:hover {
    background: rgba(244, 67, 54, .09);
    border-color: rgba(244, 67, 54, .28);
    color: #c62828;
}

.wmp-add-address {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    width: 100%;
    border: 1px dashed #ccd1d9;
    border-radius: 8px;
    background: #fff;
    color: var(--wmp-ink);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}

.wmp-add-address:hover,
.wmp-add-address:focus {
    background: var(--wmp-soft);
    border-color: #b9bfc8;
    color: var(--wmp-ink);
    text-decoration: none;
}

.wmp-empty {
    padding: 24px 16px;
    text-align: center;
    border: 1px dashed #dde0e5;
    border-radius: 8px;
    color: var(--wmp-muted);
    font-size: 13.5px;
}

.wmp-empty i.fa {
    display: block;
    margin-bottom: 8px;
    font-size: 22px;
    color: #c3c7ce;
}

/* Telefon boyutu */
@media (max-width: 767px) {
    .wmp {
        margin-bottom: 28px;
    }

    .wmp-hero {
        flex-wrap: wrap;
        gap: 12px;
        padding: 15px;
    }

    .wmp-ava {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .wmp-name {
        font-size: 18px;
    }

    .wmp-fields,
    .wmp-perms {
        grid-template-columns: minmax(0, 1fr);
    }

    .wmp-card-body {
        padding: 14px 14px 16px;
    }

    .wmp-card-head {
        padding: 15px 14px 0;
    }

    .wmp-actions .btn.theme-btn {
        width: 100%;
    }
}
