/* ============================================================
   MY ACCOUNT V3 — Camo Chem
   Custom styles for page-myaccount-v3.php
   ============================================================ */

/* ── Reset & Wrapper ── */
.mav3-wrap {
    max-width: 960px;
    margin: 32px auto;
    padding: 0 16px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}
.mav3-card {
    background: #F9FAFB;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

/* ── Header ── */
.mav3-header {
    padding: 32px 32px 0;
    border-bottom: 1px solid #E5E7EB;
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
}
.mav3-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

/* ── Desktop Tabs ── */
.mav3-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: -1px;
}
.mav3-card .mav3-tab,
.mav3-card .mav3-tab:link,
.mav3-card .mav3-tab:visited,
.mav3-card .mav3-tab:active {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 400;
    color: #6B7280 !important;
    text-decoration: none !important;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.15s ease;
    cursor: pointer;
    background: none;
}
.mav3-card .mav3-tab:hover {
    color: #111827 !important;
}
.mav3-card .mav3-tab.is-active,
.mav3-card .mav3-tab.is-active:link,
.mav3-card .mav3-tab.is-active:visited {
    color: #111827 !important;
    font-weight: 600;
    border-bottom-color: #111827;
}
.mav3-card .mav3-tab-logout,
.mav3-card .mav3-tab-logout:link,
.mav3-card .mav3-tab-logout:visited,
.mav3-card .mav3-tab-logout:hover {
    margin-left: auto;
    color: #DC2626 !important;
}
.mav3-card .mav3-tab-logout.is-active {
    border-bottom-color: #DC2626;
    color: #DC2626 !important;
}

/* ── Mobile Dropdown (hidden on desktop, colors defined globally for specificity) ── */
.mav3-mobile-dd {
    display: none;
}
.mav3-card .mav3-dd-trigger,
.mav3-card .mav3-dd-trigger:link,
.mav3-card .mav3-dd-trigger:visited,
.mav3-card .mav3-dd-trigger:hover,
.mav3-card .mav3-dd-trigger:active {
    color: #111827 !important;
    background: #F9FAFB !important;
    background-color: #F9FAFB !important;
    text-decoration: none !important;
}
.mav3-card .mav3-dd-list a,
.mav3-card .mav3-dd-list a:link,
.mav3-card .mav3-dd-list a:visited,
.mav3-card .mav3-dd-list a:active {
    color: #374151 !important;
    text-decoration: none !important;
}
.mav3-card .mav3-dd-list a:hover {
    color: #111827 !important;
}
.mav3-card .mav3-dd-list a.is-active,
.mav3-card .mav3-dd-list a.is-active:link,
.mav3-card .mav3-dd-list a.is-active:visited {
    color: #111827 !important;
}
.mav3-card .mav3-dd-list a.mav3-dd-logout,
.mav3-card .mav3-dd-list a.mav3-dd-logout:link,
.mav3-card .mav3-dd-list a.mav3-dd-logout:visited,
.mav3-card .mav3-dd-list a.mav3-dd-logout:hover {
    color: #DC2626 !important;
}

/* ── Content Area ── */
.mav3-content {
    padding: 32px;
}

/* ── Summary Cards (Dashboard) ── */
.mav3-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}
.mav3-summary-card {
    border-radius: 12px;
    padding: 20px 24px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mav3-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.mav3-summary-green { background: #F0FDF4; }
.mav3-summary-blue  { background: #EFF6FF; }
.mav3-summary-orange { background: #FFF7ED; }
.mav3-summary-label {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 4px;
}
.mav3-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

/* ── Section Title ── */
.mav3-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
    line-height: 1.4;
}
.mav3-section-muted {
    color: #6B7280;
}

/* ── Recent Orders Compact (Dashboard) ── */
.mav3-orders-compact {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
}
.mav3-order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #fff;
}
.mav3-order-row + .mav3-order-row {
    border-top: 1px solid #F3F4F6;
}
.mav3-order-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mav3-order-num {
    font-weight: 600;
    color: #111827;
    text-decoration: none;
}
.mav3-order-num:hover {
    color: #2563EB;
}
.mav3-order-date {
    font-size: 13px;
    color: #6B7280;
}
.mav3-order-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.mav3-order-total {
    font-weight: 600;
    color: #111827;
    min-width: 70px;
    text-align: right;
}

/* ── Status Badges ── */
.mav3-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.mav3-badge-completed   { background: #DCFCE7; color: #166534; }
.mav3-badge-processing  { background: #FEF3C7; color: #92400E; }
.mav3-badge-on-hold     { background: #FEF3C7; color: #92400E; }
.mav3-badge-pending     { background: #FFEDD5; color: #9A3412; }
.mav3-badge-cancelled   { background: #FEE2E2; color: #991B1B; }
.mav3-badge-failed      { background: #FEE2E2; color: #991B1B; }
.mav3-badge-refunded    { background: #F3F4F6; color: #6B7280; }

/* ── Table ── */
.mav3-table-wrap {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
}
.mav3-table {
    width: 100%;
    border-collapse: collapse;
    border: none !important;
}
.mav3-table thead th {
    padding: 12px 20px;
    background: #F9FAFB;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border: none !important;
    border-bottom: 1px solid #E5E7EB !important;
}
.mav3-table tbody td {
    padding: 14px 20px;
    border: none !important;
    border-top: 1px solid #F3F4F6 !important;
    font-size: 14px;
    color: #374151;
    background: #fff;
}
.mav3-table tfoot td {
    padding: 12px 20px;
    border: none !important;
    border-top: 1px solid #E5E7EB !important;
    font-size: 14px;
    color: #374151;
    background: #F9FAFB;
}
.mav3-total-row td {
    border-top: 2px solid #E5E7EB;
    font-size: 15px;
}
.mav3-order-link {
    font-weight: 600;
    color: #111827;
    text-decoration: none;
}
.mav3-order-link:hover {
    color: #2563EB;
}
.mav3-view-link {
    font-size: 13px;
    font-weight: 500;
    color: #2563EB;
    text-decoration: none;
    cursor: pointer;
}
.mav3-view-link:hover {
    text-decoration: underline;
}

/* ── Pagination ── */
.mav3-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}
.mav3-page-link {
    font-size: 14px;
    font-weight: 500;
    color: #2563EB;
    text-decoration: none;
}
.mav3-page-link:hover {
    text-decoration: underline;
}
.mav3-page-info {
    font-size: 14px;
    color: #6B7280;
}

/* ── Single Order View ── */
.mav3-back-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: #2563EB;
    text-decoration: none;
    margin-bottom: 20px;
}
.mav3-back-link:hover {
    text-decoration: underline;
}
.mav3-order-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}
.mav3-order-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.mav3-order-meta {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 24px 0;
}

/* ── Wallet ── */
.mav3-wallet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}
.mav3-wallet-card {
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    background: #F9FAFB;
    transition: transform 0.15s ease;
}
.mav3-wallet-card.mav3-wallet-active {
    background: linear-gradient(135deg, #1E3A5F, #2563EB);
    border-color: transparent;
    color: #fff;
}
.mav3-wallet-currency {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.7;
    margin-bottom: 8px;
}
.mav3-wallet-active .mav3-wallet-currency {
    opacity: 0.85;
    color: #fff;
}
.mav3-wallet-amount {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}
.mav3-wallet-active .mav3-wallet-amount {
    color: #fff;
}

/* ── Transaction types ── */
.mav3-tx-type {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
}
.mav3-tx-credit {
    color: #166534;
}
.mav3-tx-type.mav3-tx-credit {
    background: #DCFCE7;
}
.mav3-tx-debit {
    color: #DC2626;
}
.mav3-tx-type.mav3-tx-debit {
    background: #FEE2E2;
}

/* ── Coupons ── */
.mav3-coupon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}
.mav3-coupon-card {
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}
.mav3-coupon-active {
    border: 2px dashed #0D9488;
    background: #F0FDFA;
}
.mav3-coupon-used {
    border: 2px dashed #D1D5DB;
    background: #F9FAFB;
    opacity: 0.6;
}
.mav3-coupon-amount {
    font-size: 32px;
    font-weight: 700;
}
.mav3-coupon-active .mav3-coupon-amount {
    color: #0D9488;
}
.mav3-coupon-used .mav3-coupon-amount {
    color: #9CA3AF;
}
.mav3-coupon-type {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-top: 4px;
}
.mav3-coupon-used .mav3-coupon-type {
    color: #6B7280;
}
.mav3-coupon-code {
    display: inline-block;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: #6B7280;
    background: #E5E7EB;
    padding: 4px 12px;
    border-radius: 6px;
    margin-top: 8px;
}
.mav3-coupon-expiry {
    font-size: 12px;
    color: #6B7280;
    margin-top: 8px;
}
.mav3-coupon-desc {
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 6px;
    font-style: italic;
}
.mav3-coupon-active:hover {
    border-color: #0D9488;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
    transform: translateY(-1px);
    transition: all 0.15s ease;
}
.mav3-coupon-card {
    transition: all 0.15s ease;
}

/* ── Addresses ── */
.mav3-hint {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 24px 0;
}
.mav3-address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.mav3-address-card {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 24px;
}
.mav3-address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.mav3-address-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}
.mav3-edit-link {
    font-size: 13px;
    font-weight: 500;
    color: #2563EB;
    text-decoration: none;
    cursor: pointer;
}
.mav3-edit-link:hover {
    text-decoration: underline;
}
.mav3-address-body {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.8;
}
.mav3-muted {
    color: #9CA3AF;
    font-style: italic;
}

/* ── Account Form ── */
.mav3-account-form {
    max-width: 520px;
}
.mav3-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.mav3-field {
    margin-bottom: 16px;
}
.mav3-form-row-2col .mav3-field {
    margin-bottom: 0;
}
.mav3-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.mav3-field input[type="text"],
.mav3-field input[type="email"],
.mav3-field input[type="password"],
.mav3-field input[type="tel"],
.mav3-field select,
.mav3-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}
.mav3-field input:focus,
.mav3-field select:focus,
.mav3-field textarea:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.mav3-req {
    color: #DC2626;
}
.mav3-divider {
    border: none;
    border-top: 1px solid #E5E7EB;
    margin: 24px 0;
}

/* ── Password Section ── */
.mav3-pw-section {
    margin-bottom: 24px;
}
.mav3-pw-toggle,
.mav3-pw-toggle:link,
.mav3-pw-toggle:visited,
.mav3-pw-toggle:active {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151 !important;
    font-family: inherit;
    text-decoration: none !important;
}
.mav3-pw-toggle:hover {
    color: #111827 !important;
    background: none !important;
    background-color: transparent !important;
}
.mav3-pw-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}
.mav3-pw-arrow.is-rotated {
    transform: rotate(90deg);
}
.mav3-pw-fields {
    display: none;
    margin-top: 16px;
}
.mav3-pw-fields.is-visible {
    display: block;
}

/* ── Buttons ── */
.mav3-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}
.mav3-btn:hover {
    background: #1F2937;
}

/* ── Generic WC button overrides inside V3 ── */
.mav3-content button[type="submit"],
.mav3-content input[type="submit"],
.mav3-content .woocommerce-Button,
.mav3-content .button {
    display: inline-block;
    padding: 12px 32px;
    background: #111827 !important;
    background-color: #111827 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}
.mav3-content button[type="submit"]:hover,
.mav3-content input[type="submit"]:hover,
.mav3-content .woocommerce-Button:hover,
.mav3-content .button:hover {
    background: #1F2937 !important;
    background-color: #1F2937 !important;
    color: #fff !important;
}

/* ── Empty State ── */
.mav3-empty {
    font-size: 14px;
    color: #9CA3AF;
    font-style: italic;
    padding: 32px 0;
    text-align: center;
}

/* ── WooCommerce Address Edit Form Override ── */
.mav3-content .woocommerce-address-fields .form-row {
    margin-bottom: 16px;
    padding: 0;
    float: none;
    width: 100%;
}
.mav3-content .woocommerce-address-fields .form-row-first,
.mav3-content .woocommerce-address-fields .form-row-last {
    width: 48%;
    display: inline-block;
}
.mav3-content .woocommerce-address-fields .form-row-first {
    margin-right: 4%;
}
.mav3-content .woocommerce-address-fields label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.mav3-content .woocommerce-address-fields input.input-text,
.mav3-content .woocommerce-address-fields select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    font-family: inherit;
    box-sizing: border-box;
}
.mav3-content .woocommerce-address-fields input.input-text:focus,
.mav3-content .woocommerce-address-fields select:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}
.mav3-content .woocommerce-address-fields button[type="submit"] {
    display: inline-block;
    padding: 12px 32px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
}
.mav3-content .woocommerce-address-fields button[type="submit"]:hover {
    background: #1F2937;
}

/* ── WooCommerce Notices ── */
.mav3-content .woocommerce-message,
.mav3-content .woocommerce-info {
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #BEF2E0;
    background: #F0FDF4;
    color: #166534;
    font-size: 14px;
    margin-bottom: 20px;
}
.mav3-content .woocommerce-error {
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #FECACA;
    background: #FEF2F2;
    color: #991B1B;
    font-size: 14px;
    margin-bottom: 20px;
    list-style: none;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .mav3-wrap {
        margin: 0;
        padding: 0;
    }
    .mav3-card {
        border-radius: 0;
        box-shadow: none;
        background: #fff;
        border: none;
    }
    .mav3-header {
        padding: 20px 16px 0;
    }
    .mav3-title {
        font-size: 20px;
        margin-bottom: 16px;
    }

    /* Hide desktop tabs, show mobile dropdown */
    .mav3-tabs {
        display: none;
    }
    .mav3-mobile-dd {
        display: block;
        position: relative;
        margin-bottom: 0;
        padding-bottom: 16px;
    }
    .mav3-dd-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 12px 16px;
        background: #F9FAFB !important;
        background-color: #F9FAFB !important;
        border: 1px solid #E5E7EB !important;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 600;
        color: #111827 !important;
        cursor: pointer;
        font-family: inherit;
    }
    .mav3-dd-trigger > span:first-child {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .mav3-dd-icon {
        font-size: 16px;
    }
    .mav3-dd-chevron {
        font-size: 14px;
        color: #6B7280 !important;
        transition: transform 0.2s ease;
    }
    .mav3-dd-list {
        display: none;
        position: absolute;
        top: calc(100% - 12px);
        left: 0;
        right: 0;
        background: #fff !important;
        background-color: #fff !important;
        border: 1px solid #E5E7EB !important;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        z-index: 100;
        overflow: hidden;
    }
    .mav3-dd-list.is-open {
        display: block;
    }
    .mav3-dd-list a,
    .mav3-dd-list a:link,
    .mav3-dd-list a:visited {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        font-size: 14px;
        color: #374151 !important;
        text-decoration: none !important;
        border-bottom: 1px solid #F3F4F6;
    }
    .mav3-dd-list a:last-child {
        border-bottom: none;
    }
    .mav3-dd-list a.is-active,
    .mav3-dd-list a.is-active:link,
    .mav3-dd-list a.is-active:visited {
        background: #F0F9FF;
        color: #111827 !important;
        font-weight: 600;
    }
    .mav3-dd-list a:hover {
        background: #F9FAFB;
        color: #111827 !important;
    }
    .mav3-dd-list a.mav3-dd-logout,
    .mav3-dd-list a.mav3-dd-logout:link,
    .mav3-dd-list a.mav3-dd-logout:visited,
    .mav3-dd-list a.mav3-dd-logout:hover {
        color: #DC2626 !important;
    }

    /* Content */
    .mav3-content {
        padding: 20px 16px 32px;
    }

    /* Summary cards stack */
    .mav3-summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Tables responsive */
    .mav3-table-wrap {
        border: none;
        border-radius: 0;
    }
    .mav3-table thead {
        display: none;
    }
    .mav3-table tbody tr {
        display: block;
        padding: 16px 0;
        border-top: 1px solid #F3F4F6;
    }
    .mav3-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border: none !important;
        background: transparent;
    }
    .mav3-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: #6B7280;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
    .mav3-table tfoot td {
        padding: 10px 20px;
    }

    /* Wallet cards */
    .mav3-wallet-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Coupons */
    .mav3-coupon-grid {
        grid-template-columns: 1fr;
    }

    /* Addresses */
    .mav3-address-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Account form */
    .mav3-form-row-2col {
        grid-template-columns: 1fr;
    }
    .mav3-account-form {
        max-width: none;
    }

    /* WC address form */
    .mav3-content .woocommerce-address-fields .form-row-first,
    .mav3-content .woocommerce-address-fields .form-row-last {
        width: 100%;
        display: block;
        margin-right: 0;
    }

    /* Order rows compact */
    .mav3-order-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 16px;
    }
    .mav3-order-right {
        width: 100%;
        justify-content: space-between;
    }
}
