/* My Account Page - modern layout */
.page-my-account { padding: 16px 0 24px; }
.cpc-account-page { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }

@media (max-width: 960px) {
  .cpc-account-page { grid-template-columns: 1fr; }
}

.cpc-account-sidebar { border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
.cpc-account-sidebar__head { padding: 16px; border-bottom: 1px solid #e5e7eb; display:flex; align-items:center; gap:10px; }
.cpc-account-sidebar__name { font-weight: 800; }
.cpc-account-sidebar__menu { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; }
.cpc-account-sidebar__menu a { display:block; padding:10px 12px; color:#111827; border-radius: 8px; text-decoration: none; }
.cpc-account-sidebar__menu a:hover, .cpc-account-sidebar__menu a.is-active { background:#f3f4f6; }
.cpc-account-sidebar__menu a.is-active{color:#0f5132;font-weight:800}

.cpc-account-content { display: grid; gap: 16px; }
.cpc-card { border: 1px solid #e5e7eb; border-radius: 10px; background:#fff; padding:16px; }
.cpc-card__title { margin:0 0 10px; font-size: 18px; font-weight: 800; }
.cpc-card__body { color:#374151; }

.cpc-quick-stats { display:grid; grid-template-columns: repeat(3, 1fr); gap:12px; }
@media (max-width: 720px) { .cpc-quick-stats { grid-template-columns: 1fr; } }
.cpc-stat { border:1px solid #e5e7eb; border-radius:10px; padding:14px; background:#fafafa; }
.cpc-stat__val { font-size:22px; font-weight:800; color:#111827; }
.cpc-stat__label { font-size:13px; color:#6b7280; }

.cpc-account-actions { display:flex; gap:8px; flex-wrap: wrap; }
.cpc-btn { appearance:none; border:1px solid #d1d5db; background:#fff; color:#111827; border-radius:8px; padding:10px 12px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:8px; }
.cpc-btn--primary { background:#0ea5e9; border-color:#0ea5e9; color:#fff; }
.cpc-btn--primary:hover { background:#0284c7; border-color:#0284c7; }
.cpc-btn:hover { background:#f8fafc; }

.material-symbols-outlined { font-variation-settings:'FILL' 0,'wght' 400,'GRAD' 0,'opsz' 20; }

/* Tabs header like screenshot */
.cpc-tabs { display:flex; align-items:flex-start; gap:24px; border-bottom:1px solid #e5e7eb; }
.cpc-tab { padding:14px 0; color:#111827; text-decoration:none; position:relative; font-weight:600; font-size:13px;}
.cpc-tab.is-active { color:#0f5132; }
.cpc-tab.is-active::after { content:""; position:absolute; left:0; right:0; bottom:-1px; height:3px; background:#0f5132; border-radius:3px; }

/* Profile form */
.cpc-profile { padding:20px 0; }
.cpc-profile__avatar { width:160px; height:160px; border-radius:999px; background:#065f46; margin:16px auto; display:flex; align-items:center; justify-content:center; }
.cpc-profile__avatar .material-symbols-outlined { color:#e5e7eb; font-size:84px; }
.cpc-form { display:grid; gap:12px; max-width:760px; margin:0 auto; }
.cpc-form .form-row { display:grid; gap:6px; }
.cpc-form label { font-weight:600; color:#374151; }
.cpc-input { width:100%; box-sizing:border-box; padding:12px; border:1px solid #d1d5db; border-radius:10px; background:#fff; outline:none; }
.cpc-input:focus { border-color:#9ec5fe; box-shadow:0 0 0 3px rgba(13,110,253,.15); }
.cpc-input-group{position:relative;display:flex;align-items:center}
.cpc-input-group .cpc-input{padding-right:46px}
.cpc-input-append{position:absolute;right:8px;top:50%;transform:translateY(-50%);border:0;background:transparent;cursor:pointer;padding:6px;border-radius:6px}
.cpc-input-append:hover{background:#f3f4f6}
.cpc-select { width:100%; box-sizing:border-box; padding:12px; border:1px solid #d1d5db; border-radius:10px; background:#fff; outline:none; }
.cpc-select:focus { border-color:#9ec5fe; box-shadow:0 0 0 3px rgba(13,110,253,.15); }
.cpc-note { display:flex; align-items:center; gap:8px; padding:12px; border-radius:10px; background:#fff8e6; color:#775c0a; border:1px solid #f6e6b8; }
.cpc-btn-submit { margin:20px auto 0; display:inline-flex; align-items:center; gap:8px; padding:12px 24px; border-radius:999px; border:0; cursor:pointer; background:#0f5132; color:#fff; font-weight:800; }
.cpc-btn-submit:hover { background:#0b3b25; }
.cpc-required{color:#dc2626;font-weight:700}
.cpc-note--spaced{margin-bottom:12px}

/* Shipping addresses */
.cpc-shipping{display:block}
.cpc-shipping__title{margin-bottom:16px}
.cpc-shipping__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px;margin-bottom:16px}
.cpc-shipping__loading,
.cpc-shipping__empty{text-align:center;padding:24px;opacity:.7}
.cpc-addr-card{border:1px dashed #d1fae5;background:#fff;border-radius:12px;padding:14px}
.cpc-addr-card.is-default{border-style:solid}
.cpc-addr-card__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.cpc-addr-card__tools{display:flex;gap:6px}
.cpc-icon-btn{border:0;background:#fff;padding:6px;border-radius:6px;cursor:pointer}
.cpc-icon-btn:hover{background:#f3f4f6}
.cpc-addr{margin:0}
.cpc-addr div{display:grid;grid-template-columns:120px 1fr;gap:8px;margin:6px 0}
.cpc-addr dt{color:#6b7280}
.cpc-addr dd{margin:0}
.cpc-addr-card__badge{color:#18794e;font-size:12px}
.cpc-addr-card__set-default{margin-top:8px}
.cpc-addr-add{min-height:200px;border:2px dashed #10b981;border-radius:12px;background:#e6fffb;display:flex;align-items:center;justify-content:center;color:#065f46;cursor:pointer}
.cpc-addr-add:hover{background:#d1fae5}

/* Address Modal Styles */
#address-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    box-sizing: border-box;
}

.cpc-address-modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.5);backdrop-filter:blur(4px);transition:opacity .3s ease}
.cpc-address-modal__container{position:relative;background:#fff;max-width:600px;width:90%;margin:6vh auto;padding:0;border-radius:16px;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.3);max-height:90vh;display:flex;flex-direction:column;box-sizing:border-box;animation:modalSlideIn .3s ease-out}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cpc-address-modal__header{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid #e5e7eb;background:#f8fafc;box-sizing:border-box}
.cpc-address-modal__title{margin:0;font-size:20px;font-weight:700;color:#111827;display:flex;align-items:center;gap:8px}
.cpc-address-modal__title::before{content:'';display:inline-block;width:4px;height:20px;background:#0ea5e9;border-radius:2px}

#address-modal-close {
    margin: 0;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

#address-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.cpc-address-modal__body{padding:24px;overflow-y:auto;flex:1;box-sizing:border-box}

#address-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#address-form .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#address-form label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    display: block;
}

#address-form label .required {
    color: #dc2626;
    font-weight: 700;
}

#address-form .regular-text,
#address-form select.regular-text,
#address-form textarea.regular-text {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    color: #111827;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

#address-form .regular-text:focus,
#address-form select.regular-text:focus,
#address-form textarea.regular-text:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

#address-form textarea.regular-text {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

#address-form select.regular-text {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

#address-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0ea5e9;
    margin-right: 8px;
}

/* Style for label containing checkbox */
#address-form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    flex-direction: row;
    cursor: pointer;
    font-weight: 500;
}

/* Fallback for browsers without :has() support */
#address-form label input[type="checkbox"] {
    margin-right: 8px;
    flex-shrink: 0;
}

/* Additional fallback - target the specific checkbox label */
#address-form .form-group:last-of-type label {
    display: flex;
    align-items: center;
    flex-direction: row;
    cursor: pointer;
    font-weight: 500;
}

.cpc-address-modal__actions{display:flex;justify-content:flex-end;gap:12px;margin-top:8px;padding-top:16px;border-top:1px solid #e5e7eb}

#address-modal-cancel,
#address-form button[type="submit"] {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
}

#address-modal-cancel {
    background: #fff;
    color: #374151;
}

#address-modal-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

#address-form button[type="submit"] {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #fff;
}

#address-form button[type="submit"]:hover {
    background: #0284c7;
    border-color: #0284c7;
}

#address-form button[type="submit"]:active {
    transform: scale(0.98);
}
.cpc-address-ward-converted{margin:6px 0 0;color:#6b7280;font-size:12px;display:none}
.cpc-address-ward-converted.is-visible{display:block}
.cpc-address-full-note{margin-top:4px;font-size:12px;color:#6b7280}

/* Responsive */
@media (max-width: 640px) {
    .cpc-address-modal__container {
        width: 95%;
        margin: 4vh auto;
        max-height: 85vh;
        border-radius: 12px;
    }
    
    .cpc-address-modal__header {
        padding: 16px 20px;
    }
    
    .cpc-address-modal__title {
        font-size: 18px;
    }
    
    .cpc-address-modal__body {
        padding: 20px;
    }
    
    .cpc-address-modal__actions {
        flex-direction: column-reverse;
    }
    
    #address-modal-cancel,
    #address-form button[type="submit"] {
        width: 100%;
    }
}


