/* =========================================================
   Topbar — chèn nút "Tài khoản"
   ========================================================= */
.top-user-actions .tvf-topbar-account {
    margin-right: 0;
}

/* =========================================================
   TvF My Account – Layout + Components
   ========================================================= */

.woocommerce-account .woocommerce,
.woocommerce-account .woocommerce > .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce > .woocommerce-MyAccount-content {
    display: block;
    width: 100%;
    float: none;
    margin: 0;
    padding: 0;
}
.woocommerce-account .woocommerce-MyAccount-navigation { display: none !important; }

.tvf-account-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 16px 48px;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Breadcrumb ---------- */
.tvf-breadcrumb {
    background: #eef1f6;
    border-radius: 6px;
    padding: 10px 16px;
    margin: 0 0 18px;
    font-size: 14px;
}
.tvf-breadcrumb a { color: #dc2626; text-decoration: none; font-weight: 600; }
.tvf-breadcrumb span { margin: 0 6px; color: #6b7280; }
.tvf-breadcrumb .current { color: #6b7280; font-weight: 500; }

/* ---------- Grid 2 cột ---------- */
.tvf-account-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px;
    align-items: start;
}
@media (max-width: 900px) {
    .tvf-account-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.tvf-account-sidebar {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(15,23,42,.06);
}

.tvf-acc-user-card {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 55%, #991b1b 100%);
    color: #fff;
    padding: 22px 18px 26px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.tvf-acc-user-card::before,
.tvf-acc-user-card::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.tvf-acc-user-card::before { width: 120px; height: 120px; top: -40px; right: -40px; }
.tvf-acc-user-card::after  { width: 80px;  height: 80px;  bottom: -30px; left: -20px; }

.tvf-acc-avatar-sm {
    width: 72px; height: 72px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    z-index: 1;
}
.tvf-acc-avatar-sm svg,
.tvf-acc-avatar-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tvf-acc-username {
    font-weight: 600;
    font-size: 15px;
    position: relative; z-index: 1;
    line-height: 1.3;
}
.tvf-acc-userphone {
    font-size: 13px;
    opacity: .9;
    margin-top: 2px;
    position: relative; z-index: 1;
}

/* Menu */
.tvf-acc-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.tvf-acc-menu-item { margin: 0; padding: 0; }
.tvf-acc-menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    color: #374151;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background .15s ease, color .15s ease;
}
.tvf-acc-menu-item a:hover { background: #f3f4f6; }
.tvf-acc-menu-icon {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #6b7280;
}
.tvf-acc-menu-icon svg { width: 100%; height: 100%; }
.tvf-acc-menu-label { flex: 1; }
.tvf-acc-menu-caret {
    width: 16px; height: 16px;
    color: #9ca3af;
    display: inline-flex;
}
.tvf-acc-menu-caret svg { width: 100%; height: 100%; }

.tvf-acc-menu-item.is-active a {
    color: #dc2626;
    background: #fef2f2;
    border-left-color: #dc2626;
}
.tvf-acc-menu-item.is-active .tvf-acc-menu-icon { color: #dc2626; }

/* =========================================================
   MAIN CARD
   ========================================================= */
.tvf-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(15,23,42,.06);
    overflow: hidden;
}
.tvf-card + .tvf-card { margin-top: 18px; }

.tvf-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e5e7eb;
}
.tvf-card-header-flex {
    display: flex; justify-content: space-between; align-items: center;
}
.tvf-card-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}
.tvf-card-body { padding: 28px 24px 32px; }

/* =========================================================
   PROFILE VIEW
   ========================================================= */
.tvf-avatar-wrap { display: flex; justify-content: center; margin: 8px 0 28px; }
.tvf-avatar-big {
    position: relative;
    width: 110px; height: 110px;
    border-radius: 50%;
    overflow: hidden;
    background: #fef2f2;
}
.tvf-avatar-big svg,
.tvf-avatar-big img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tvf-avatar-edit {
    position: absolute;
    bottom: 2px; right: 2px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #dc2626;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    padding: 0;
}
.tvf-avatar-edit svg { width: 16px; height: 16px; }
.tvf-avatar-edit:hover { background: #b91c1c; }

.tvf-info-list {
    margin: 0 auto;
    max-width: 560px;
    padding: 0;
}
.tvf-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px 4px;
    border-bottom: 1px solid #f0f2f5;
    align-items: center;
}
.tvf-info-row:last-child { border-bottom: 0; }
.tvf-info-row dt {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}
.tvf-info-row dd {
    margin: 0;
    text-align: right;
    color: #111827;
    font-weight: 500;
}
.tvf-info-row .tvf-value { color: #111827; }

.tvf-add-info {
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
}
.tvf-add-info:hover { text-decoration: underline; }

.tvf-card-actions {
    display: flex; justify-content: center;
    margin-top: 24px;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.tvf-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tvf-btn-soft {
    background: #fef2f2;
    color: #dc2626;
}
.tvf-btn-soft:hover { background: #fee2e2; }
.tvf-btn-primary {
    background: #dc2626;
    color: #fff;
}
.tvf-btn-primary:hover { background: #b91c1c; color: #fff; }
.tvf-btn-ghost {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}
.tvf-btn-ghost:hover { background: #f9fafb; }

/* =========================================================
   PROFILE EDIT FORM
   ========================================================= */
.tvf-profile-edit { max-width: 520px; margin: 0 auto; }
.tvf-form-row { margin-bottom: 16px; display: flex; flex-direction: column; }
.tvf-form-row label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 500;
}
.tvf-form-row input,
.tvf-form-row select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
    color: #111827;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.tvf-form-row input:focus,
.tvf-form-row select:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}
.tvf-form-actions {
    display: flex; justify-content: center; gap: 12px;
    margin-top: 8px;
}
.tvf-form-msg {
    margin-top: 12px;
    text-align: center;
    font-size: 13.5px;
    min-height: 18px;
}
.tvf-form-msg.is-ok    { color: #047857; }
.tvf-form-msg.is-error { color: #b91c1c; }

/* =========================================================
   ORDERS
   ========================================================= */
.tvf-orders { display: flex; flex-direction: column; gap: 14px; }

.tvf-order {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.tvf-order-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.tvf-order-id { font-weight: 700; color: #111827; font-size: 14px; }
.tvf-order-date { color: #6b7280; font-size: 12.5px; }
.tvf-order-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eef2ff;
    color: #4338ca;
}
.tvf-status-processing { background: #fef3c7; color: #92400e; }
.tvf-status-completed  { background: #dcfce7; color: #166534; }
.tvf-status-cancelled,
.tvf-status-failed     { background: #fee2e2; color: #b91c1c; }
.tvf-status-on-hold    { background: #e0e7ff; color: #3730a3; }
.tvf-status-pending    { background: #f3f4f6; color: #374151; }

.tvf-order-body {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.tvf-order-meta {
    display: flex; flex-direction: column; gap: 2px;
    font-size: 14px;
}
.tvf-order-total { font-weight: 700; color: #dc2626; }
.tvf-order-actions { display: flex; gap: 8px; }

.tvf-pagination {
    margin-top: 20px;
    display: flex; gap: 10px; justify-content: center;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.tvf-empty {
    text-align: center;
    padding: 40px 16px;
}
.tvf-empty svg {
    width: 64px; height: 64px;
    color: #cbd5e1;
    margin-bottom: 12px;
}
.tvf-empty p {
    color: #6b7280;
    margin: 0 0 16px;
}

/* =========================================================
   ADDRESS FORM (style giống Checkout) + LIST CARDS
   ========================================================= */
.tvf-addr-card { padding: 20px 22px 22px; }

.tvf-addr-head {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 16px;
}
.tvf-addr-head h2 { flex: 1; }
.tvf-addr-add-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 14px;
    border: 1px solid #dc2626;
    background: #fff;
    color: #dc2626;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.tvf-addr-add-btn:hover { background: #dc2626; color: #fff; }
.tvf-addr-add-btn svg { width: 14px; height: 14px; }

/* ----- LIST CARDS ----- */
.tvf-addr-list { display: flex; flex-direction: column; gap: 10px; }
.tvf-addr-empty {
    color: #6b7280; font-size: 14px; padding: 24px 4px; text-align: center;
}
.tvf-addr-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s;
}
.tvf-addr-item:hover { border-color: #fecaca; }
.tvf-addr-item-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #fef2f2;
    color: #dc2626;
    display: flex; align-items: center; justify-content: center;
}
.tvf-addr-item-icon svg { width: 18px; height: 18px; }
.tvf-addr-item-info { min-width: 0; }
.tvf-addr-item-line { font-size: 14px; color: #111827; margin-bottom: 3px; }
.tvf-addr-item-line strong { font-weight: 700; }
.tvf-addr-item-phone { color: #6b7280; font-weight: 500; margin-left: 2px; }
.tvf-addr-item-addr {
    color: #4b5563; font-size: 13px; line-height: 1.4;
}
.tvf-addr-item-note { color: #9ca3af; font-size: 12px; margin-top: 3px; font-style: italic; }
.tvf-addr-item-actions { display: flex; gap: 4px; }
.tvf-addr-item-actions button {
    width: 32px; height: 32px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.tvf-addr-item-actions button svg { width: 14px; height: 14px; }
.tvf-addr-item-actions .tvf-addr-edit:hover { border-color: #dc2626; color: #dc2626; }
.tvf-addr-item-actions .tvf-addr-del:hover  { border-color: #b91c1c; color: #b91c1c; background: #fef2f2; }

/* ----- FORM TITLE + CANCEL ----- */
.tvf-addr-form-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f2f5;
}
.tvf-addr-actions .tvf-btn-ghost {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}
.tvf-addr-actions .tvf-btn-ghost:hover { background: #f9fafb; }
.tvf-addr-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid #dc2626;
    background: radial-gradient(circle, #dc2626 35%, #fff 36%);
    display: inline-block;
}
.tvf-addr-head h2 {
    margin: 0;
    font-size: 16px; font-weight: 700; color: #111827;
}

.tvf-addr-form { margin: 0; }
.tvf-addr-row {
    margin-bottom: 12px;
}
.tvf-addr-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) {
    .tvf-addr-row-2 { grid-template-columns: 1fr; }
}
.tvf-addr-field { width: 100%; }
.tvf-addr-field input,
.tvf-addr-field select,
.tvf-addr-field textarea {
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 11px 14px;
    font-size: 14px;
    color: #111827;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
    appearance: none;
    -webkit-appearance: none;
}
.tvf-addr-field select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23999' d='M0 0l5 6 5-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    color: #9ca3af;
}
.tvf-addr-field select.has-value { color: #111827; }
.tvf-addr-field textarea { resize: vertical; min-height: 78px; line-height: 1.5; }
.tvf-addr-field input::placeholder,
.tvf-addr-field textarea::placeholder { color: #9ca3af; }
.tvf-addr-field input:focus,
.tvf-addr-field select:focus,
.tvf-addr-field textarea:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,.10);
}

/* Radio */
.tvf-addr-radio { display: flex; gap: 22px; padding: 4px 0 6px; }
.tvf-addr-radio label {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; cursor: pointer; color: #111827;
}
.tvf-addr-radio input[type="radio"] {
    appearance: none; -webkit-appearance: none;
    width: 18px; height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin: 0;
    cursor: pointer;
    position: relative;
    background: #fff;
}
.tvf-addr-radio input[type="radio"]:checked {
    border-color: #dc2626;
}
.tvf-addr-radio input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #dc2626;
}

.tvf-addr-actions {
    display: flex; align-items: center; gap: 14px;
    margin-top: 16px;
}
.tvf-addr-msg { font-size: 13.5px; }
.tvf-addr-msg.is-ok    { color: #047857; }
.tvf-addr-msg.is-error { color: #b91c1c; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 600px) {
    .tvf-info-row { grid-template-columns: 1fr; gap: 4px; }
    .tvf-info-row dd { text-align: left; }
    .tvf-card-body { padding: 20px 16px 24px; }
    .tvf-card-header { padding: 14px 16px; }
}

/* =========================================================
   Select2 / selectWoo cho sổ địa chỉ (Tỉnh/Quận/Phường)
   ========================================================= */
.tvf-addr-form .select2-container--default .select2-selection--single {
    height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    display: flex;
    align-items: center;
}
.tvf-addr-form .select2-container--default.select2-container--focus .select2-selection--single,
.tvf-addr-form .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.tvf-addr-form .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding: 0;
    color: #111827;
    font-size: 14px;
}
.tvf-addr-form .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af;
}
.tvf-addr-form .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
    right: 8px;
}
.select2-dropdown {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
}
.select2-search--dropdown .select2-search__field:focus {
    border-color: #dc2626;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #dc2626;
    color: #fff;
}

/* Icon kính lúp + placeholder cho ô tìm kiếm Select2 */
.select2-search--dropdown {
    padding: 8px !important;
}
.select2-search--dropdown .select2-search__field.tvf-srch-with-icon {
    padding-left: 34px !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.35-4.35'/></svg>");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 16px 16px;
}
.select2-search--dropdown .select2-search__field.tvf-srch-with-icon::placeholder {
    color: #9ca3af;
}
