/* Ported from mua-hang-nhanh order-received.css */

.mks-my-account-custom {
    background-color: #f8f9fa;
}

/* Base Container & Scope */
.mks-my-account-custom {
    background-color: #f8f9fa;
}

/* Ensure our styles apply to the content area even if templates aren't fully swapped yet */
.woocommerce-MyAccount-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Force standard tables to look like our lovely cards/tables */
.mks-my-account-custom .woocommerce-MyAccount-content table.shop_table,
.mks-my-account-custom .woocommerce-MyAccount-content table.woocommerce-orders-table,
.mks-my-account-custom .woocommerce-MyAccount-content table.my_account_orders {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 0 24px;
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.mks-my-account-custom .woocommerce-MyAccount-content table.shop_table th,
.mks-my-account-custom .woocommerce-MyAccount-content table.shop_table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.mks-my-account-custom .woocommerce-MyAccount-content table.shop_table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    text-transform: none;
    /* Override typical theme caps */
}

.mks-my-account-custom .woocommerce-MyAccount-content table.shop_table tbody tr:last-child td {
    border-bottom: none;
}

/* Buttons generic override */
.mks-my-account-custom .woocommerce-Button.button,
.mks-my-account-custom a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid transparent;
    /* default */
    background: linear-gradient(to top right, #6366f1, #4f46e5);
    color: #ffffff !important;
    line-height: normal;
    border: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Specific Action Buttons */
.mks-renew-btn,
.mks-btn-change-key {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
    background-image: none !important;
    padding: 5px 5px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-align: center !important;
    border: none !important;
    line-height: 1 !important;
    transition: background-color 0.2s ease !important;
    margin-right: 5px !important;
    display: inline-flex !important;
    text-decoration: none !important;
}

.mks-renew-btn:hover,
.mks-btn-change-key:hover {
    background-color: #4338ca !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Button Sizes */
.mks-btn-sm {
    padding: 6px 12px !important;
    font-size: 13px !important;
    height: auto !important;
    min-height: 32px !important;
}

.mks-my-account-custom .woocommerce-Button.button:hover,
.mks-my-account-custom a.button:hover {
    box-shadow: 0 4px 14px -4px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
    background: linear-gradient(to top right, #4f46e5, #4338ca);
}

/* --- ICONS --- */
.mks-my-account-custom .mks-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mks-my-account-custom .mks-icon svg {
    width: 1em;
    height: 1em;
}

.mks-my-account-custom .mks-icon-title {
    font-size: 20px;
    color: #4f46e5;
    margin-right: 12px;
}

.mks-my-account-custom .mks-icon-sm {
    font-size: 16px;
    color: #6b7280;
    margin-right: 8px;
    flex-shrink: 0;
}

.mks-my-account-custom table.shop_table th {
    background-color: #f9fafb;
    font-weight: 600;
    text-transform: none;
    /* Avoid uppercase usually */
    font-size: 14px;
    padding: 12px 16px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.mks-my-account-custom table.shop_table td {
    padding: 16px;
    vertical-align: middle;
    font-size: 14px;
    color: #4b5563;
    border-bottom: 1px solid #f3f4f6;
}

/* Ensure tables inside cards have a clean border (no double rounding, no shadow) */
/* Fix Table Styling inside Cards: Remove double borders and rounding */
.mks-card .shop_table {
    border: none !important;
    border-radius: 0 !important;
    border-collapse: collapse !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    width: 100%;
}

/* Compact button style for consistent actions (View, Replace Key) */
.mks-btn-compact {
    margin-left: 5px !important;
    vertical-align: middle !important;
    font-size: 13px !important;
    padding: 4px 8px !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: 0 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* Force code/pre to match font size */
.mks-my-account-custom code,
.mks-my-account-custom pre {
    font-size: 13px;
    /* Slightly smaller for code */
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: #f3f4f6;
    padding: 2px 4px;
    border-radius: 4px;
    color: #1f2937;
}

/* Navigation Links */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #111827;
    /* Black text */
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mks-my-account-custom .woocommerce-MyAccount-navigation-link a:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.mks-my-account-custom .woocommerce-MyAccount-navigation-link.is-active a {
    background-color: #ecfdf5;
    color: #059669;
    font-weight: 600;
}

/* Icon Styles */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link a i,
.mks-my-account-custom .woocommerce-MyAccount-navigation-link a svg {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    color: #111827;
    /* Black icons */
    transition: color 0.2s;
}


/* --- GENERIC CARD STYLE (Used for Order Details, Subscriptions, etc.) --- */
.mks-my-account-custom .mks-card {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
}

.mks-my-account-custom .mks-card-header {
    padding: 24px;
    border-bottom: 1px solid #f3f4f6;
    background-color: #ffffff;
}

.mks-my-account-custom .mks-card-content {
    padding: 24px;
}

.mks-my-account-custom .mks-card-content.mks-card-content-no-padding {
    padding: 0;
}

/* --- DASHBOARD CARDS (New Grid) --- */
.mks-my-account-custom .mks-card-title {
    font-size: 18px;
    /* Reduced from 20px */
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.mks-my-account-custom .mks-dashboard-card {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    transition: all 0.2s ease;
    overflow: hidden;
    display: block;
    height: 100%;
}

.mks-my-account-custom .mks-dashboard-card:hover {
    border-color: #d1d5db;
    background-color: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.mks-my-account-custom .mks-dashboard-card .mks-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
}

.mks-my-account-custom .mks-dashboard-card .mks-card-icon {
    margin-bottom: 16px;
    color: #111827;
    /* Black icon */
}

.mks-my-account-custom .mks-dashboard-card .mks-card-icon svg {
    width: 32px;
    height: 32px;
}

.mks-my-account-custom .mks-dashboard-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    /* Black title */
    margin: 0 0 8px 0;
}

.mks-my-account-custom .mks-dashboard-card p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.mks-my-account-custom .mks-dashboard-card:hover h3 {
    color: #111827;
}

/* --- GRID LAYOUTS --- */
.mks-my-account-custom .mks-grid {
    display: grid;
    gap: 24px;
}

.mks-my-account-custom .mks-grid-summary {
    grid-template-columns: repeat(1, 1fr);
}

.mks-my-account-custom .mks-item-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.mks-my-account-custom .mks-item-value {
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
    margin: 0;
    word-break: break-word;
}

.mks-my-account-custom .mks-item-value-main {
    color: #4f46e5;
    font-size: 18px;
}

.mks-my-account-custom .mks-item-value-total {
    color: #4f46e5;
    font-size: 20px;
    font-weight: 700;
}

/* --- BADGE --- */
.mks-my-account-custom .mks-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
}

.mks-my-account-custom .mks-badge-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.mks-my-account-custom .mks-badge-outline {
    background-color: transparent;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.mks-my-account-custom .mks-status-badge.status-active {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.mks-my-account-custom .mks-status-badge.status-inactive {
    background-color: #fee2e2;
    /* Red background */
    color: #991b1b;
    /* Red text */
    border: 1px solid #fecaca;
}

/* Strikethrough for inactive keys */
.mks-my-account-custom .mks-key-inactive {
    text-decoration: line-through;
    color: #9ca3af !important;
    /* Grey out the text */
}

/* --- BUTTONS --- */
.mks-my-account-custom .mks-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid transparent;
    cursor: pointer;
}

.mks-my-account-custom .mks-button-primary {
    background: linear-gradient(to top right, #6366f1, #4f46e5);
    color: #ffffff;
}

.mks-my-account-custom .mks-button-primary:hover {
    box-shadow: 0 4px 14px -4px rgba(79, 70, 229, 0.4);
    color: #ffffff;
}

.mks-my-account-custom .mks-button-outline {
    background-color: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

.mks-my-account-custom .mks-button-outline:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* --- PRODUCT TABLE --- */
.mks-my-account-custom .mks-product-table {
    width: 100%;
    border-collapse: collapse;
}

.mks-my-account-custom .mks-product-table th,
.mks-my-account-custom .mks-product-table td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.mks-my-account-custom .mks-product-table th {
    font-weight: 500;
    color: #6b7280;
    background-color: rgba(243, 244, 246, 0.5);
}

.mks-my-account-custom .mks-product-table td .mks-product-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mks-my-account-custom .mks-product-table td .mks-product-info img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.mks-my-account-custom .mks-product-table td .mks-product-name {
    font-weight: 600;
    color: #111827;
    margin: 0;
    font-size: 14px;
}

.mks-my-account-custom .mks-product-table td .mks-product-price {
    font-weight: 600;
    color: #4f46e5;
}

/* --- RESPONSIVE TABLES (Generic) --- */
@media (max-width: 767px) {
    .mks-my-account-custom .mks-product-table thead {
        display: none;
    }

    .mks-my-account-custom .mks-product-table tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
    }

    .mks-my-account-custom .mks-product-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        text-align: right;
        border-bottom: 1px solid #f3f4f6;
    }

    .mks-my-account-custom .mks-product-table td:before {
        content: attr(data-label);
        font-weight: 500;
        color: #6b7280;
        text-align: left;
        width: 120px;
        /* Fixed width for labels on mobile */
        flex-shrink: 0;
    }
}

/* Hide Order Again button */
.mks-my-account-custom .order-again {
    display: none !important;
}

/* Hide Subscriptions (Gói Đăng Ký) menu item */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--my-subscription,
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--my-subscriptions,
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--subscriptions {
    display: none !important;
}

/* Hide Address (Địa chỉ) menu item */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--edit-address {
    display: none !important;
}

/* Adjust License Key Table Column Width */
/* Let the template CSS handle the column widths */
.mks-my-account-custom table .license-key,
.mks-my-account-custom table .lmfwc_license_key,
.mks-my-account-custom table .lmfwc-license-key,
.mks-my-account-custom table .lmfwc-col-key,
.mks-my-account-custom .lmfwc-license-keys-table td:first-child,
.mks-my-account-custom .lmfwc-license-keys-table th:first-child,
.mks-my-account-custom .lmfwc-license-table td:first-child,
.mks-my-account-custom .lmfwc-license-table th:first-child {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word;
}

/* Ensure Ordered Products table is also un-rounded inside card */
.mks-card .woocommerce-table--order-details,
.mks-card .shop_table.order_details,
.mks-card .mks-product-table {
    border: none !important;
    border-radius: 0 !important;
    border-collapse: collapse !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    width: 100%;
}

.mks-my-account-custom .lmfwc-myaccount-license-key,
.mks-my-account-custom table .lmfwc_license_key code {
    white-space: normal !important;
    word-break: break-all !important;
    display: block;
    width: 100%;
    font-size: 13px;
    /* Slightly smaller for better fit */
}

/* Target specific tables that lack our classes */
.mks-my-account-custom .woocommerce-MyAccount-content .my_account_subscriptions,
.mks-my-account-custom .woocommerce-MyAccount-content .lmfwc-license-keys-table,
.mks-my-account-custom .woocommerce-MyAccount-content table:not(.shop_table):not(.has-own-style) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 0 24px;
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.mks-my-account-custom .woocommerce-MyAccount-content .my_account_subscriptions th,
.mks-my-account-custom .woocommerce-MyAccount-content .lmfwc-license-keys-table th,
.mks-my-account-custom .woocommerce-MyAccount-content table:not(.shop_table):not(.has-own-style) th {
    padding: 16px;
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.mks-my-account-custom .woocommerce-MyAccount-content .my_account_subscriptions td,
.mks-my-account-custom .woocommerce-MyAccount-content .lmfwc-license-keys-table td,
.mks-my-account-custom .woocommerce-MyAccount-content table:not(.shop_table):not(.has-own-style) td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 14px;
    color: #4b5563;
}

/* Buttons inside these tables */
.mks-my-account-custom .woocommerce-MyAccount-content .my_account_subscriptions .button,
.mks-my-account-custom .woocommerce-MyAccount-content .lmfwc-license-keys-table .button {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    background: #fff;
    color: #4f46e5 !important;
    border: 1px solid #d1d5db;
    font-weight: 500;
    box-shadow: none;
    text-transform: none;
}

.mks-my-account-custom .woocommerce-MyAccount-content .my_account_subscriptions .button:hover,
.mks-my-account-custom .woocommerce-MyAccount-content .lmfwc-license-keys-table .button:hover {
    background-color: #f9fafb;
    border-color: #4f46e5;
}

/* Status badges adjustment */
.mks-my-account-custom .subscription-status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.mks-my-account-custom .subscription-status.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.mks-my-account-custom .subscription-status.status-on-hold,
.mks-my-account-custom .subscription-status.status-cancelled {
    background-color: #f3f4f6;
    color: #374151;
}

/* --- PLUGIN OUTPUTS (License, Subscription) --- */
/* Hide default direct H2s inside mks-plugins-output because we moved them inside cards */
.mks-my-account-custom .mks-plugins-output>h2 {
    display: none !important;
}

.mks-card-spacing {
    margin-bottom: 24px;
}

.mks-my-account-custom .mks-plugins-output .shop_table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background-color: #fff;
    font-size: 15px;
}

.mks-my-account-custom .mks-plugins-output .shop_table th,
.mks-my-account-custom .mks-plugins-output .shop_table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.mks-my-account-custom .mks-plugins-output .lmfwc-myaccount-license-key {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    background-color: #f3f4f6;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #1f2937;
    display: inline-block;
}

/* --- OVERRIDE WOOCOMMERCE DEFAULTS --- */
/* Hide default Woo titles inside our custom cards, and Bricks headers */
.mks-my-account-custom .woocommerce-account .woocommerce-MyAccount-content>h2,
.mks-my-account-custom #brx-content>h1,
.mks-my-account-custom .brxe-post-title,
.mks-my-account-custom .entry-title {
    display: none !important;
}

/* Custom Navigation Style - Horizontal Menu Override */
/* Force parent container to column to stack nav on top of content */
:root body.mks-my-account-custom .woocommerce {
    display: flex !important;
    flex-direction: column !important;
}

:root body.mks-my-account-custom .woocommerce-MyAccount-navigation {
    margin-bottom: 24px;
    width: 100% !important;
    float: none !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

:root body.mks-my-account-custom .woocommerce-MyAccount-content {
    width: 100% !important;
    float: none !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    /* Reset padding if theme adds it */
}

/* Flex Container for Menu Items */
:root body.mks-my-account-custom .woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 8px;
    /* Inner padding */
    margin: 0;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);

    /* Flexbox settings for horizontal layout */
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    /* allow wrapping on smaller screens */
    gap: 8px;
    /* Space between items */
    align-items: center;
}

/* Reset margin for li */
:root body.mks-my-account-custom .woocommerce-MyAccount-navigation li {
    margin-bottom: 0 !important;
    flex-grow: 1;
    flex: 1 1 auto;
    min-width: fit-content;
    /* Allow fitting content */
    display: block !important;
    /* Ensure li is not hidden or weird */
    border-bottom: none !important;
    /* Remove borders from theme vertical usage */
    padding: 0 !important;
}

/* Link styling adjustments for horizontal bar */
:root body.mks-my-account-custom .woocommerce-MyAccount-navigation li a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    /* Center content */
    padding: 10px 5px !important;
    color: #4b5563;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
    white-space: nowrap;
    /* Keep text on one line if possible */
    height: 100%;
    /* Fill height */
    text-align: center;
}

.mks-my-account-custom .woocommerce-MyAccount-navigation li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #4b5563;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 15px;
    /* Professional size */
}

/* Sidebar Icons using mask-image for easy coloring */
.mks-my-account-custom .woocommerce-MyAccount-navigation li a::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    margin-right: 12px;
    background-color: #9ca3af;
    /* Inactive color */
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.mks-my-account-custom .woocommerce-MyAccount-navigation li a:hover {
    background-color: #f9fafb;
    color: #111827;
}

.mks-my-account-custom .woocommerce-MyAccount-navigation li a:hover::before {
    background-color: #111827;
}

.mks-my-account-custom .woocommerce-MyAccount-navigation li.is-active a {
    background-color: #ecfdf5;
    color: #065f46;
    font-weight: 600;
}

.mks-my-account-custom .woocommerce-MyAccount-navigation li.is-active a::before {
    background-color: #065f46;
    /* Active color */
}

/* Icons for specific items */
/* Dashboard */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--dashboard a::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>');
}

/* Orders */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--orders a::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><line x1="16.5" y1="9.4" x2="7.5" y2="4.21"/><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><line x1="16.5" y1="9.4" x2="7.5" y2="4.21"/><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>');
}

/* License Keys */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--license-keys a::before,
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--view-license-keys a::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"/></svg>');
}

/* Downloads */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--downloads a::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>');
}

/* Addresses */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--edit-address a::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/></svg>');
}

/* Account Details */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--edit-account a::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>');
}

/* Subscriptions */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--my-subscription a::before,
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--my-subscriptions a::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>');
}

/* Logout */
.mks-my-account-custom .woocommerce-MyAccount-navigation-link--customer-logout a::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>');
}

/* Media Queries for Grid */
@media (min-width: 768px) {
    .mks-my-account-custom .mks-grid-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .mks-my-account-custom .mks-grid-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- RESPONSIVE FIXES (Mobile & Tablet) --- */
@media (max-width: 768px) {

    /* 1. Reset Fixed Table Widths */
    .mks-my-account-custom table .license-key,
    .mks-my-account-custom table .lmfwc_license_key,
    .mks-my-account-custom table .lmfwc-license-key,
    .mks-my-account-custom table .lmfwc-col-key,
    .mks-my-account-custom .lmfwc-license-keys-table td:first-child,
    .mks-my-account-custom .lmfwc-license-keys-table th:first-child,
    .mks-my-account-custom .lmfwc-license-table td:first-child,
    .mks-my-account-custom .lmfwc-license-table th:first-child {
        width: auto !important;
    }

    /* 2. Allow Tables to Scroll Horizontally (Prevent breaking layout) */
    .mks-my-account-custom .mks-card-content {
        overflow-x: visible;
        /* Fix: Don't scroll whole card, let content wrap */
    }

    .mks-my-account-custom .mks-plugins-output {
        overflow-x: auto;
    }

    .mks-my-account-custom table.shop_table,
    .mks-my-account-custom table.my_account_orders,
    .mks-my-account-custom table.woocommerce-orders-table,
    .mks-my-account-custom table.lmfwc-license-table {
        min-width: 600px;
        /* Force min width to ensure columns don't squish too much, triggering scroll */
    }

    /* 3. Reduce Card Padding */
    .mks-my-account-custom .mks-card-header,
    .mks-my-account-custom .mks-card-content {
        padding: 16px;
    }

    /* 4. Navigation Stack (if sidebar exists) */
    .mks-my-account-custom .woocommerce-MyAccount-navigation {
        margin-bottom: 20px;
    }

    .mks-my-account-custom .woocommerce-MyAccount-navigation ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        background: transparent;
        box-shadow: none;
        border: none;
    }

    .mks-my-account-custom .woocommerce-MyAccount-navigation li {
        margin-bottom: 0;
        flex: 1 1 45%;
        /* 2 items per row approx */
    }

    .mks-my-account-custom .woocommerce-MyAccount-navigation li a {
        background: #fff;
        border: 1px solid #e5e7eb;
        justify-content: center;
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Hide icons on mobile nav to save space if needed, or keep them */
    .mks-my-account-custom .woocommerce-MyAccount-navigation li a::before {
        margin-right: 8px;
    }
}

/* Subscription View Grid & Responsive Fixes */
.mks-subscription-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Force exactly 50/50 split */
    gap: 24px;
    margin-bottom: 32px;
    width: 100%;
}

.mks-sub-info,
.mks-sub-totals {
    width: 100%;
    /* Ensure children take full width of their grid cell */
}

@media (max-width: 991px) {
    .mks-subscription-grid {
        grid-template-columns: 1fr;
        /* Stack on smaller screens */
    }

    .mks-sub-totals,
    .mks-sub-info {
        width: 100%;
        overflow-x: visible;
    }

    /* Fix Subscription Info Text Wrapping on Mobile */
    .mks-info-list {
        word-break: break-word;
        /* Ensure long words break */
    }

    .mks-info-list>div {
        display: flex;
        flex-direction: column;
        /* Stack label and value for better space usage */
        margin-bottom: 12px !important;
    }

    .mks-info-list strong {
        width: auto !important;
        /* Release fixed width */
        display: block !important;
        margin-bottom: 4px;
    }

    /* Status badge wrapper also needs to wrap */
    .mks-info-list .mks-status-badge {
        white-space: nowrap;
        /* Keep badge text single line */
        width: fit-content;
    }

    /* Force table to fit screen width (NO SCROLL) */
    .mks-sub-totals table {
        display: table;
        width: 100%;
        table-layout: fixed;
        /* Crucial: Forces table to respect width */
        min-width: 0 !important;
        /* Override generic table min-width */
    }

    /* Allow wrapping for product name and values */
    .mks-sub-totals table th,
    .mks-sub-totals table td {
        white-space: normal;
        word-wrap: break-word;
        word-break: break-word;
        /* Ensure long words break */
        padding: 8px 0;
        /* Reduce padding slightly */
    }

    /* Give Product Name column more space if possible, or 50/50 */
    .mks-sub-totals table th {
        width: 60%;
    }

    .mks-sub-totals table td {
        width: 40%;
    }
}

/* ==========================================================================
   MISSING CSS CLASSES - Added to match templates
   ========================================================================== */

/* --- GRID ITEM --- */
.mks-my-account-custom .mks-grid-item {
    padding: 8px 0;
}

/* --- ALERT MESSAGES --- */
.mks-my-account-custom .mks-alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mks-my-account-custom .mks-alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.mks-my-account-custom .mks-alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.mks-my-account-custom .mks-alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.mks-my-account-custom .mks-alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* --- PAGINATION --- */
.mks-my-account-custom .mks-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-top: 16px;
}

/* --- ACTION BUTTONS --- */
.mks-my-account-custom .mks-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- CONTAINER --- */
.mks-my-account-custom .mks-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* --- KEY STYLES --- */
.mks-my-account-custom .mks-key-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mks-my-account-custom .mks-key-parts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mks-my-account-custom .mks-key-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background-color: #f3f4f6;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    word-break: break-all;
}

.mks-my-account-custom .mks-key-icon {
    display: inline-flex;
    align-items: center;
    color: #6b7280;
}

.mks-my-account-custom .mks-key-inactive-box {
    opacity: 0.6;
    text-decoration: line-through;
}

.mks-my-account-custom .mks-copy-key-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- CARD VARIANTS --- */
.mks-my-account-custom .mks-card-success {
    border-color: #86efac;
    background-color: #f0fdf4;
}

/* --- ICON VARIANTS --- */
.mks-my-account-custom .mks-icon-check {
    color: #22c55e;
}

.mks-my-account-custom .mks-success-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: #dcfce7;
    border-radius: 50%;
    margin-bottom: 16px;
}

/* --- UTILITY CLASSES --- */
.mks-my-account-custom .mks-text-center {
    text-align: center;
}

.mks-my-account-custom .mks-text-right {
    text-align: right;
}

/* --- TABLE HEADER CLASSES --- */
.mks-my-account-custom .mks-th-status,
.mks-my-account-custom .mks-th-expires,
.mks-my-account-custom .mks-th-actions {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

/* --- TOAST NOTIFICATIONS --- */
.mks-my-account-custom .mks-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #1f2937;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- PRODUCT SKU --- */
.mks-my-account-custom .mks-product-sku {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* --- TOTAL VALUE --- */
.mks-my-account-custom .mks-total-value {
    font-size: 18px;
    font-weight: 700;
    color: #4f46e5;
}

/* --- EDIT ACCOUNT FORM CARD --- */
.mks-my-account-custom .woocommerce-EditAccountForm {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.mks-my-account-custom .woocommerce-EditAccountForm fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.mks-my-account-custom .woocommerce-EditAccountForm legend {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    padding: 0;
}

/* --- LICENSE KEYS SECTION IN VIEW ORDER (LMFWC) --- */
/* DISABLE old wrapper styling because we are using inner template wrapper .mks-card now */
.mks-my-account-custom .lmfwc-license-keys,
.mks-my-account-custom .lmfwc-myaccount-licenses-wrapper,
.mks-my-account-custom section.woocommerce-order-details+section {
    background-color: transparent !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin-top: 24px;
    margin-bottom: 24px;
}

.mks-my-account-custom .lmfwc-license-keys h2,
.mks-my-account-custom .lmfwc-myaccount-licenses-wrapper h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

/* --- LICENSE TABLE IN VIEW ORDER --- */
.mks-my-account-custom .lmfwc-license-keys table,
.mks-my-account-custom .lmfwc-myaccount-licenses-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.mks-my-account-custom .lmfwc-license-keys table th,
.mks-my-account-custom .lmfwc-myaccount-licenses-wrapper table th {
    background-color: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.mks-my-account-custom .lmfwc-license-keys table td,
.mks-my-account-custom .lmfwc-myaccount-licenses-wrapper table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #374151;
}

/* --- VIEW LICENSE KEYS PAGE (Main Content Wrapper) --- */
/* Wrap the entire content of view-license-keys page with white rounded card */
/* --- VIEW LICENSE KEYS PAGE (Main Content Wrapper) --- */
/* Restored Style WITHOUT Borders (Preserving Layout) */
.mks-my-account-custom .woocommerce-MyAccount-content h2.woocommerce-column__title {
    background: transparent;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    /* Added separator for clarity */
    padding: 0 0 16px 0;
    /* Adjusted padding to fit inside card */
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    text-transform: none;
    /* Ensure sentence case like 'Sản phẩm đã đặt' */
}

.mks-my-account-custom .woocommerce-MyAccount-content h2.woocommerce-column__title+h4,
.mks-my-account-custom .woocommerce-MyAccount-content h2.woocommerce-column__title~h4 {
    background: transparent;
    border: none;
    padding: 8px 0;
    /* Adjusted padding */
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.mks-my-account-custom .woocommerce-MyAccount-content h2.woocommerce-column__title~table.lmfwc-license-table {
    background: transparent;
    border: none;
    margin: 0;
    width: 100%;
}

.mks-my-account-custom .woocommerce-MyAccount-content h2.woocommerce-column__title~table.lmfwc-license-table:last-of-type {
    border: none;
    margin-bottom: 0;
}