/* ---------- PROFILE HERO ---------- */
.profile-hero{
    background:var(--header-red);
    padding:44px 40px 90px;
    position:relative;
}
.profile-hero-inner{
    max-width:920px;
    margin:0 auto;
    display:flex;
    align-items:center;
    gap:26px;
    flex-wrap:wrap;
}

.avatar{
    width:92px;height:92px;
    border-radius:50%;
    background:var(--secondary);
    color:#3a2500;
    font-weight:900;
    font-size:32px;
    display:flex;align-items:center;justify-content:center;
    flex-shrink:0;
    border:4px solid rgba(255,255,255,.35);
    position:relative;
}
.avatar .cam-btn{
    position:absolute;
    bottom:-2px;right:-2px;
    width:30px;height:30px;
    border-radius:50%;
    background:#fff;
    display:flex;align-items:center;justify-content:center;
    border:none;
    cursor:pointer;
    box-shadow:0 4px 10px rgba(0,0,0,.2);
}
.avatar .cam-btn svg{width:14px;height:14px;stroke:var(--primary);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}

.profile-hero-info{flex:1;min-width:200px;}
.profile-hero-info h1{
    color:#fff;
    font-weight:900;
    font-size:26px;
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}
.verified-badge{
    display:inline-flex;align-items:center;gap:4px;
    background:rgba(255,255,255,.16);
    color:#fff;
    font-size:11px;font-weight:800;
    padding:4px 10px;border-radius:50px;
}
.verified-badge svg{width:11px;height:11px;stroke:#fff;fill:none;stroke-width:3;}

.profile-hero-meta{
    display:flex;
    gap:18px;
    flex-wrap:wrap;
    margin-top:8px;
    color:rgba(255,255,255,.8);
    font-size:13.5px;
    font-weight:600;
}
.profile-hero-meta span{display:flex;align-items:center;gap:6px;}
.profile-hero-meta svg{width:14px;height:14px;stroke:rgba(255,255,255,.8);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}

.edit-profile-btn{
    background:#fff;
    color:var(--primary);
    border:none;
    padding:11px 22px;
    border-radius:50px;
    font-weight:800;
    font-size:13px;
    cursor:pointer;
    transition:background .2s ease, transform .2s ease;
    flex-shrink:0;
}
.edit-profile-btn:hover{background:#fff2e4;transform:translateY(-2px);}

/* ---------- STATS STRIP ---------- */
.stats-strip{
    max-width:220px;
    margin:-56px auto 0;
    padding:0 40px;
    position:relative;
    z-index:5;
}
.stat-card{
    background:#fff;
    border-radius:18px;
    padding:22px 20px;
    text-align:center;
    box-shadow:0 10px 28px rgba(0,0,0,.1);
}
.stat-card .val{font-weight:900;font-size:24px;color:var(--primary);}
.stat-card .lbl{font-size:12px;font-weight:700;color:#8a8a8a;text-transform:uppercase;letter-spacing:.5px;margin-top:4px;}

/* ---------- BODY WRAP ---------- */
.account-wrap{
    max-width:920px;
    margin:0 auto;
    padding:44px 40px 80px;
}

/* ---------- TABS ---------- */
.tabs{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-bottom:28px;
    border-bottom:1px solid #ecdfd2;
    padding-bottom:14px;
}
.tab-btn{
    padding:10px 20px;
    border-radius:50px;
    border:1px solid #ecdfd2;
    background:#fff;
    font-weight:800;
    font-size:13px;
    color:#6b6b6b;
    cursor:pointer;
    transition:background .2s ease, color .2s ease, border-color .2s ease;
}
.tab-btn:hover{border-color:var(--secondary);}
.tab-btn.active{background:var(--primary);border-color:var(--primary);color:#fff;}

.tab-panel{display:none;}
.tab-panel.active{display:block;animation:profileFadeIn .3s ease;}
@keyframes profileFadeIn{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}

.card{
    background:#fff;
    border-radius:20px;
    box-shadow:0 6px 20px rgba(0,0,0,.06);
    padding:28px;
    margin-bottom:20px;
}
.card h3{font-size:16px;font-weight:900;margin-bottom:18px;}
.card h3 .muted{font-weight:600;font-size:12.5px;color:#a3a3a3;display:block;margin-top:2px;}

/* ---------- FORM ---------- */
.form-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
}
.form-grid.full{grid-template-columns:1fr;}
.field{display:flex;flex-direction:column;gap:6px;}
.field.span-2{grid-column:span 2;}
.field label{font-size:12px;font-weight:800;color:#8a8a8a;text-transform:uppercase;letter-spacing:.4px;}
.field input,.field select,.field textarea{
    padding:12px 14px;
    border-radius:12px;
    border:1px solid #ecdfd2;
    font-family:'Nunito',sans-serif;
    font-size:14px;
    font-weight:600;
    color:var(--text);
    background:#fffdfb;
}
.field input:disabled,.field select:disabled,.field textarea:disabled{
    background:#f7f2ec;
    color:#767676;
    cursor:not-allowed;
}
.field input:focus,.field select:focus,.field textarea:focus{
    outline:2px solid var(--secondary);border-color:transparent;background:#fff;
}
.field textarea{resize:vertical;min-height:70px;}

.form-actions{
    display:flex;
    gap:12px;
    margin-top:22px;
}
.btn-save{
    background:var(--primary);color:#fff;border:none;
    padding:12px 26px;border-radius:50px;font-weight:800;font-size:13.5px;cursor:pointer;
    transition:background .2s ease;
}
.btn-save:hover{background:var(--primary-dark);}
.btn-cancel{
    background:#f2f2f2;color:#555;border:none;
    padding:12px 26px;border-radius:50px;font-weight:800;font-size:13.5px;cursor:pointer;
    transition:background .2s ease;
}
.btn-cancel:hover{background:#e8e8e8;}
.save-toast{
    display:inline-flex;align-items:center;gap:6px;
    font-size:12.5px;font-weight:700;color:var(--accent);
    margin-left:4px;opacity:0;transition:opacity .3s ease;
}
.save-toast.show{opacity:1;}

/* ---------- ADDRESSES ---------- */
.address-card{
    border:1px solid #f0e6da;
    border-radius:16px;
    padding:18px 20px;
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:14px;
    margin-bottom:14px;
}
.address-card:last-of-type{margin-bottom:0;}
.address-tag{
    display:inline-flex;align-items:center;gap:6px;
    background:#fff2e4;color:var(--primary);
    font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;
    padding:4px 10px;border-radius:50px;margin-bottom:8px;
}
.address-tag.default{background:#e6f7e6;color:#158818;}
.address-text{font-size:13.5px;color:#555;line-height:1.6;max-width:480px;}
.address-text strong{display:block;color:var(--text);font-size:14px;margin-bottom:2px;}
.address-actions{display:flex;flex-direction:column;gap:8px;flex-shrink:0;}
.icon-btn{
    background:#f5efe8;border:none;width:34px;height:34px;border-radius:10px;
    display:flex;align-items:center;justify-content:center;cursor:pointer;
    transition:background .2s ease;
}
.icon-btn:hover{background:#ecdfd2;}
.icon-btn svg{width:15px;height:15px;stroke:#767676;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.icon-btn.danger:hover{background:#fdeaea;}
.icon-btn.danger:hover svg{stroke:var(--primary);}

.add-new-btn{
    width:100%;
    border:2px dashed #ecdfd2;
    background:transparent;
    color:var(--primary);
    font-weight:800;
    font-size:13.5px;
    padding:14px;
    border-radius:16px;
    cursor:pointer;
    transition:background .2s ease, border-color .2s ease;
}
.add-new-btn:hover{background:#fff6ec;border-color:var(--secondary);}

/* ---------- PAYMENT METHOD ---------- */
.payment-option{
    display:flex;
    align-items:center;
    gap:16px;
    padding:16px;
    border:1.5px solid #f0e6da;
    border-radius:14px;
    cursor:pointer;
    margin-bottom:12px;
    transition:border-color .2s ease, background .2s ease;
}
.payment-option:last-of-type{margin-bottom:0;}
.payment-option:hover{border-color:var(--secondary);}
.payment-option input[type="radio"]{
    width:18px;height:18px;accent-color:var(--primary);flex-shrink:0;
}
.payment-option:has(input:checked){
    border-color:var(--primary);
    background:#fff6ec;
}
.payment-option-icon{
    width:42px;height:42px;border-radius:12px;
    background:#fff2e4;
    display:flex;align-items:center;justify-content:center;
    font-size:19px;flex-shrink:0;
}
.payment-option-text{display:flex;flex-direction:column;}
.payment-option-text strong{font-size:14px;font-weight:800;}
.payment-option-text span{font-size:12.5px;color:#a3a3a3;font-weight:600;}

@media (max-width:780px){
    .profile-hero{padding:36px 22px 90px;}
    .profile-hero-inner{gap:18px;}
    .avatar{width:76px;height:76px;font-size:26px;}
    .profile-hero-info h1{font-size:21px;}
    .stats-strip{padding:0 20px;max-width:180px;}
    .stat-card{padding:16px 10px;}
    .stat-card .val{font-size:19px;}
    .account-wrap{padding:34px 20px 80px;}
    .form-grid{grid-template-columns:1fr;}
    .field.span-2{grid-column:span 1;}
}

@media (max-width:520px){
    .edit-profile-btn{width:100%;}
    .profile-hero-inner{flex-direction:column;align-items:flex-start;}
    .address-card{flex-direction:column;}
    .address-actions{flex-direction:row;}
}

/* Customer account repair: isolate this screen from global card and stat styles. */
.customer-profile-page { background: #fffaf7; min-height: 70vh; padding-bottom: 42px; }
.customer-profile-page .profile-hero { background: linear-gradient(118deg, #8f0000, #c80808); padding: 42px 40px 105px; }
.customer-profile-page .profile-hero-inner { width: min(980px, 100%); margin: 0 auto; display: flex; align-items: center; gap: 22px; }
.customer-profile-page .avatar { width: 82px; height: 82px; flex: 0 0 82px; display: grid; place-items: center; border: 3px solid rgba(255,255,255,.45); border-radius: 50%; background: #f5a000; color: #651000; font-size: 28px; font-weight: 900; }
.customer-profile-page .profile-kicker { margin: 0 0 5px; color: #ffd57a; font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.customer-profile-page .profile-hero-info h1 { margin: 0; color: #fff; font-size: clamp(26px, 3vw, 34px); font-weight: 900; }
.customer-profile-page .verified-badge { display: inline-flex; align-items: center; margin-left: 10px; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: 11px; vertical-align: middle; }
.customer-profile-page .profile-hero-meta { margin: 8px 0 0; color: rgba(255,255,255,.85); font-size: 14px; font-weight: 700; }
.customer-profile-page .stats-strip { width: min(980px, calc(100% - 40px)); max-width: none; margin: -58px auto 0; padding: 0; position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.customer-profile-page .stat-card { min-height: 112px; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 18px; border-radius: 16px; background: #fff; box-shadow: 0 10px 26px rgba(73, 18, 18, .12); text-align: center; }
.customer-profile-page .stat-card strong { color: #bc0808; font-size: 24px; font-weight: 900; }
.customer-profile-page .stat-card span { color: #737373; font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.customer-profile-page .account-wrap { width: min(980px, calc(100% - 40px)); max-width: none; margin: 0 auto; padding: 38px 0 44px; }
.customer-profile-page .card { margin: 0 0 18px; padding: 28px; border: 1px solid #f0e1d9; border-radius: 18px; background: #fff; box-shadow: 0 8px 22px rgba(73, 18, 18, .05); }
.customer-profile-page .card h2 { margin: 0 0 5px; color: #251814; font-size: 19px; font-weight: 900; }
.customer-profile-page .card > p { margin: 0 0 22px; color: #6e625d; font-size: 14px; }
.customer-profile-page .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.customer-profile-page .form-grid.full { grid-template-columns: 1fr; }
.customer-profile-page .field { display: flex; flex-direction: column; gap: 7px; }
.customer-profile-page .field label { color: #5d4b44; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.customer-profile-page .field input { min-width: 0; box-sizing: border-box; width: 100%; padding: 12px 13px; border: 1px solid #e5d7d0; border-radius: 10px; background: #fffdfb; color: #221815; font: inherit; }
.customer-profile-page .field input:focus { outline: 3px solid rgba(240,153,12,.28); border-color: #db8b00; }
.customer-profile-page .form-actions { margin-top: 20px; }
.customer-profile-page .btn-save { border: 0; border-radius: 10px; padding: 12px 20px; background: #bd0707; color: #fff; cursor: pointer; font: inherit; font-size: 14px; font-weight: 900; }
.customer-profile-page .btn-save:hover { background: #930000; }

@media (max-width: 760px) {
  .customer-profile-page .profile-hero { padding: 32px 20px 88px; }
  .customer-profile-page .profile-hero-inner { align-items: flex-start; }
  .customer-profile-page .stats-strip { width: min(560px, calc(100% - 28px)); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: -46px; }
  .customer-profile-page .stat-card { min-height: 94px; padding: 13px 8px; }
  .customer-profile-page .stat-card strong { font-size: 20px; }
  .customer-profile-page .account-wrap { width: min(560px, calc(100% - 28px)); padding-top: 28px; }
  .customer-profile-page .card { padding: 21px; }
  .customer-profile-page .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .customer-profile-page .profile-hero-inner { flex-direction: column; gap: 13px; }
  .customer-profile-page .verified-badge { display: inline-flex; margin: 8px 0 0; }
}
