/*
 * ED Account Page v1.0.1
 * Scope: WooCommerce My Account only.
 * No WooCommerce templates or account logic are replaced.
 */

body.ed-account-page {
    --ed-bg: #0b0b0b;
    --ed-panel: #121212;
    --ed-panel-2: #171717;
    --ed-panel-3: #1d1d1d;
    --ed-border: rgba(255,255,255,.09);
    --ed-border-strong: rgba(212,175,55,.42);
    --ed-text: #f3f3f3;
    --ed-muted: #a8a8a8;
    --ed-gold: #d4af37;
    --ed-gold-soft: #e1c35a;
    --ed-danger: #ff6b6b;
    --ed-success: #78d99b;
    --ed-radius: 18px;
    background: var(--ed-bg) !important;
    color: var(--ed-text);
}

body.ed-account-page #content,
body.ed-account-page .site-content,
body.ed-account-page .site-main,
body.ed-account-page .content-area,
body.ed-account-page .woocommerce-account,
body.ed-account-page .woocommerce {
    background: var(--ed-bg) !important;
}

body.ed-account-page .site-content,
body.ed-account-page #content {
    padding-top: 44px;
    padding-bottom: 72px;
}

body.ed-account-page .site-content > .container,
body.ed-account-page #content > .container,
body.ed-account-page .woocommerce {
    max-width: 1240px;
}

/* Remove the large blank/default title treatment while keeping page content accessible. */
body.ed-account-page .page-header,
body.ed-account-page .woostify-page-header,
body.ed-account-page .entry-header .entry-title,
body.ed-account-page h1.entry-title {
    display: none !important;
}

body.ed-account-page .entry-content,
body.ed-account-page .entry-content > .woocommerce {
    margin-top: 0 !important;
}

/* Main two-column account shell */
body.ed-account-page .woocommerce-MyAccount-navigation {
    width: 27% !important;
    float: left;
    margin: 0 !important;
    padding: 16px !important;
    border: 1px solid var(--ed-border) !important;
    border-radius: var(--ed-radius) !important;
    background:
        radial-gradient(circle at top left, rgba(212,175,55,.08), transparent 34%),
        var(--ed-panel) !important;
    box-shadow: 0 18px 50px rgba(0,0,0,.24);
    position: sticky;
    top: 104px;
}

body.ed-account-page .woocommerce-MyAccount-content {
    width: calc(73% - 28px) !important;
    float: right;
    margin: 0 !important;
    padding: clamp(26px, 3.3vw, 44px) !important;
    min-height: 460px;
    border: 1px solid var(--ed-border) !important;
    border-radius: var(--ed-radius) !important;
    background:
        linear-gradient(145deg, rgba(255,255,255,.018), transparent 44%),
        var(--ed-panel) !important;
    box-shadow: 0 18px 50px rgba(0,0,0,.24);
    color: var(--ed-text) !important;
}

body.ed-account-page .woocommerce::after,
body.ed-account-page .woocommerce::before {
    content: "";
    display: table;
    clear: both;
}

/* Navigation */
body.ed-account-page .woocommerce-MyAccount-navigation ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border: 0 !important;
}

body.ed-account-page .woocommerce-MyAccount-navigation li {
    margin: 4px 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

/*
 * Woostify/WooBuilder can inject its own endpoint icon in addition to the ED icon.
 * Keep one clean icon column only: the ED icon remains on the link ::before.
 */
body.ed-account-page .woocommerce-MyAccount-navigation li::before,
body.ed-account-page .woocommerce-MyAccount-navigation li::after,
body.ed-account-page .woocommerce-MyAccount-navigation li a::after {
    content: none !important;
    display: none !important;
}

body.ed-account-page .woocommerce-MyAccount-navigation li a > i,
body.ed-account-page .woocommerce-MyAccount-navigation li a > svg,
body.ed-account-page .woocommerce-MyAccount-navigation li a > .icon,
body.ed-account-page .woocommerce-MyAccount-navigation li a > [class*="icon-"] ,
body.ed-account-page .woocommerce-MyAccount-navigation li a > [class*="-icon"],
body.ed-account-page .woocommerce-MyAccount-navigation li a > .woostify-icon,
body.ed-account-page .woocommerce-MyAccount-navigation li a > .woostify-svg-icon {
    display: none !important;
}

body.ed-account-page .woocommerce-MyAccount-navigation li a {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px 0 46px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    color: #d8d8d8 !important;
    background: transparent !important;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    text-decoration: none !important;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

body.ed-account-page .woocommerce-MyAccount-navigation li a:hover {
    color: #fff !important;
    background: rgba(255,255,255,.045) !important;
    border-color: var(--ed-border) !important;
    transform: translateX(2px);
}

body.ed-account-page .woocommerce-MyAccount-navigation li.is-active a {
    color: #111 !important;
    background: linear-gradient(135deg, var(--ed-gold-soft), var(--ed-gold)) !important;
    border-color: rgba(255,255,255,.16) !important;
    box-shadow: 0 8px 22px rgba(212,175,55,.18);
}

/* Neutral, dependency-free line icons */
body.ed-account-page .woocommerce-MyAccount-navigation li a::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    opacity: .82;
    background-position: center;
    background-size: 16px 16px;
    background-repeat: no-repeat;
    filter: invert(91%);
}

body.ed-account-page .woocommerce-MyAccount-navigation li.is-active a::before {
    filter: none;
    opacity: .9;
}

body.ed-account-page .woocommerce-MyAccount-navigation-link--dashboard a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
}
body.ed-account-page .woocommerce-MyAccount-navigation-link--orders a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E");
}
body.ed-account-page .woocommerce-MyAccount-navigation-link--downloads a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m0 0 4-4m-4 4-4-4M5 21h14'/%3E%3C/svg%3E");
}
body.ed-account-page .woocommerce-MyAccount-navigation-link--edit-address a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.5 12 4l8 6.5V20H4z'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3C/svg%3E");
}
body.ed-account-page .woocommerce-MyAccount-navigation-link--payment-methods a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 10h18M7 15h4'/%3E%3C/svg%3E");
}
body.ed-account-page .woocommerce-MyAccount-navigation-link--edit-account a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4.5 21a7.5 7.5 0 0 1 15 0'/%3E%3C/svg%3E");
}
body.ed-account-page .woocommerce-MyAccount-navigation-link--customer-logout a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5M15 12H3'/%3E%3Cpath d='M14 4h5a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-5'/%3E%3C/svg%3E");
}

/* Generic/custom endpoint fallback, including wishlist plugins. */
body.ed-account-page .woocommerce-MyAccount-navigation li:not([class*="--dashboard"]):not([class*="--orders"]):not([class*="--downloads"]):not([class*="--edit-address"]):not([class*="--payment-methods"]):not([class*="--edit-account"]):not([class*="--customer-logout"]) a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-4.35-7-10A4 4 0 0 1 12 8a4 4 0 0 1 7 3c0 5.65-7 10-7 10Z'/%3E%3C/svg%3E");
}

/* Content typography */
body.ed-account-page .woocommerce-MyAccount-content,
body.ed-account-page .woocommerce-MyAccount-content p,
body.ed-account-page .woocommerce-MyAccount-content address,
body.ed-account-page .woocommerce-MyAccount-content label,
body.ed-account-page .woocommerce-MyAccount-content td,
body.ed-account-page .woocommerce-MyAccount-content th {
    color: var(--ed-text) !important;
}

body.ed-account-page .woocommerce-MyAccount-content p {
    color: #c8c8c8 !important;
    line-height: 1.75;
}

body.ed-account-page .woocommerce-MyAccount-content > p:first-child {
    margin-top: 0;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid var(--ed-border);
    background: var(--ed-panel-2);
}

body.ed-account-page .woocommerce-MyAccount-content h2,
body.ed-account-page .woocommerce-MyAccount-content h3,
body.ed-account-page .woocommerce-MyAccount-content .woocommerce-order-details__title,
body.ed-account-page .woocommerce-MyAccount-content .woocommerce-column__title {
    color: #fff !important;
    font-weight: 700 !important;
    letter-spacing: -.02em;
}

body.ed-account-page .woocommerce-MyAccount-content a:not(.button):not(.woocommerce-button) {
    color: var(--ed-gold-soft) !important;
    text-decoration: none;
}
body.ed-account-page .woocommerce-MyAccount-content a:not(.button):not(.woocommerce-button):hover {
    color: #fff !important;
}

/* Tables: Orders, Downloads, payment methods, order details */
body.ed-account-page table.shop_table,
body.ed-account-page .woocommerce-orders-table,
body.ed-account-page .woocommerce-table {
    width: 100%;
    border: 1px solid var(--ed-border) !important;
    border-radius: 14px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden;
    background: var(--ed-panel-2) !important;
    box-shadow: none !important;
}

body.ed-account-page table.shop_table thead th,
body.ed-account-page .woocommerce-orders-table thead th {
    padding: 14px 16px !important;
    background: var(--ed-panel-3) !important;
    color: var(--ed-gold-soft) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--ed-border) !important;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
}

body.ed-account-page table.shop_table td,
body.ed-account-page table.shop_table th,
body.ed-account-page .woocommerce-orders-table td,
body.ed-account-page .woocommerce-orders-table th {
    padding: 16px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--ed-border) !important;
    vertical-align: middle;
}
body.ed-account-page table.shop_table tr:last-child td,
body.ed-account-page table.shop_table tr:last-child th,
body.ed-account-page .woocommerce-orders-table tr:last-child td {
    border-bottom: 0 !important;
}

/* Buttons */
body.ed-account-page .woocommerce button.button,
body.ed-account-page .woocommerce a.button,
body.ed-account-page .woocommerce input.button,
body.ed-account-page .woocommerce .button,
body.ed-account-page .woocommerce-button,
body.ed-account-page button[type="submit"] {
    min-height: 42px;
    padding: 0 18px !important;
    border: 1px solid var(--ed-gold) !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, var(--ed-gold-soft), var(--ed-gold)) !important;
    color: #111 !important;
    font-weight: 700 !important;
    line-height: 40px !important;
    text-transform: none !important;
    box-shadow: none !important;
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease !important;
}
body.ed-account-page .woocommerce button.button:hover,
body.ed-account-page .woocommerce a.button:hover,
body.ed-account-page .woocommerce input.button:hover,
body.ed-account-page .woocommerce .button:hover,
body.ed-account-page .woocommerce-button:hover,
body.ed-account-page button[type="submit"]:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 8px 24px rgba(212,175,55,.16) !important;
}

/* Forms */
body.ed-account-page .woocommerce form .form-row {
    margin-bottom: 18px !important;
}
body.ed-account-page .woocommerce form .form-row label,
body.ed-account-page .woocommerce label {
    display: block;
    margin-bottom: 7px;
    color: #d6d6d6 !important;
    font-weight: 600;
    font-size: 13px;
}
body.ed-account-page .woocommerce input[type="text"],
body.ed-account-page .woocommerce input[type="email"],
body.ed-account-page .woocommerce input[type="tel"],
body.ed-account-page .woocommerce input[type="password"],
body.ed-account-page .woocommerce input[type="number"],
body.ed-account-page .woocommerce select,
body.ed-account-page .woocommerce textarea,
body.ed-account-page .select2-container--default .select2-selection--single {
    min-height: 48px !important;
    width: 100%;
    padding: 11px 14px !important;
    border: 1px solid var(--ed-border) !important;
    border-radius: 10px !important;
    background: #0f0f0f !important;
    color: #f2f2f2 !important;
    box-shadow: none !important;
    outline: 0 !important;
}
body.ed-account-page .woocommerce textarea {
    min-height: 120px !important;
}
body.ed-account-page .woocommerce input:focus,
body.ed-account-page .woocommerce select:focus,
body.ed-account-page .woocommerce textarea:focus,
body.ed-account-page .select2-container--focus .select2-selection--single {
    border-color: var(--ed-border-strong) !important;
    box-shadow: 0 0 0 3px rgba(212,175,55,.08) !important;
}
body.ed-account-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #f2f2f2 !important;
    line-height: 24px !important;
}
body.ed-account-page fieldset {
    margin: 24px 0 !important;
    padding: 22px !important;
    border: 1px solid var(--ed-border) !important;
    border-radius: 14px !important;
    background: var(--ed-panel-2) !important;
}
body.ed-account-page fieldset legend {
    padding: 0 8px;
    color: var(--ed-gold-soft) !important;
    font-weight: 700;
}

/* Addresses */
body.ed-account-page .woocommerce-Addresses {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 18px;
}
body.ed-account-page .woocommerce-Address {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 22px !important;
    border: 1px solid var(--ed-border) !important;
    border-radius: 14px !important;
    background: var(--ed-panel-2) !important;
}
body.ed-account-page .woocommerce-Address-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
body.ed-account-page .woocommerce-Address-title h3 {
    margin: 0 !important;
}
body.ed-account-page .woocommerce-Address address {
    margin-top: 14px;
    line-height: 1.7;
    color: #c8c8c8 !important;
}

/* Notices */
body.ed-account-page .woocommerce-message,
body.ed-account-page .woocommerce-info,
body.ed-account-page .woocommerce-error {
    border: 1px solid var(--ed-border) !important;
    border-left: 3px solid var(--ed-gold) !important;
    border-radius: 12px !important;
    background: var(--ed-panel-2) !important;
    color: var(--ed-text) !important;
    padding: 16px 18px 16px 46px !important;
}
body.ed-account-page .woocommerce-message::before,
body.ed-account-page .woocommerce-info::before {
    color: var(--ed-gold) !important;
}
body.ed-account-page .woocommerce-error {
    border-left-color: var(--ed-danger) !important;
}
body.ed-account-page .woocommerce-error::before {
    color: var(--ed-danger) !important;
}

/* Payment methods cards */
body.ed-account-page .woocommerce-PaymentMethods,
body.ed-account-page .woocommerce-MyAccount-paymentMethods {
    margin: 0 0 20px !important;
}

/* Login/register state */
body.ed-account-page .woocommerce:not(:has(.woocommerce-MyAccount-navigation)) {
    max-width: 1080px;
    margin-inline: auto;
}
body.ed-account-page #customer_login {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 22px;
}
body.ed-account-page #customer_login > .col-1,
body.ed-account-page #customer_login > .col-2,
body.ed-account-page .woocommerce-form-login,
body.ed-account-page .woocommerce-form-register,
body.ed-account-page .woocommerce-ResetPassword {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 28px !important;
    border: 1px solid var(--ed-border) !important;
    border-radius: var(--ed-radius) !important;
    background: var(--ed-panel) !important;
}

/* Prevent white blocks from Woostify/Woo defaults. */
body.ed-account-page .woocommerce-MyAccount-content .woocommerce-customer-details,
body.ed-account-page .woocommerce-MyAccount-content .woocommerce-order-details,
body.ed-account-page .woocommerce-MyAccount-content section,
body.ed-account-page .woocommerce-MyAccount-content .wc-block-components-notice-banner {
    color: var(--ed-text);
}

/* Tablet */
@media (max-width: 991px) {
    body.ed-account-page .site-content,
    body.ed-account-page #content {
        padding-top: 26px;
        padding-bottom: 48px;
    }
    body.ed-account-page .woocommerce-MyAccount-navigation,
    body.ed-account-page .woocommerce-MyAccount-content {
        float: none !important;
        width: 100% !important;
    }
    body.ed-account-page .woocommerce-MyAccount-navigation {
        position: static;
        margin-bottom: 18px !important;
        padding: 10px !important;
    }
    body.ed-account-page .woocommerce-MyAccount-navigation ul {
        display: grid;
        grid-template-columns: repeat(3, minmax(0,1fr));
        gap: 6px;
    }
    body.ed-account-page .woocommerce-MyAccount-navigation li {
        margin: 0 !important;
        min-width: 0;
    }
    body.ed-account-page .woocommerce-MyAccount-navigation li a {
        min-height: 46px;
        padding-right: 10px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Mobile: nav becomes a compact 2-column grid and Woo tables become cards. */
@media (max-width: 640px) {
    body.ed-account-page .site-content,
    body.ed-account-page #content {
        padding-top: 16px;
        padding-bottom: 32px;
    }
    body.ed-account-page .site-content > .container,
    body.ed-account-page #content > .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    body.ed-account-page .woocommerce-MyAccount-navigation ul {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
    body.ed-account-page .woocommerce-MyAccount-navigation li a {
        min-height: 44px;
        padding-left: 40px !important;
        font-size: 12.5px;
    }
    body.ed-account-page .woocommerce-MyAccount-navigation li a::before {
        left: 13px;
        width: 15px;
        height: 15px;
        background-size: 15px 15px;
    }
    body.ed-account-page .woocommerce-MyAccount-content {
        padding: 20px 16px !important;
        min-height: 0;
        border-radius: 15px !important;
    }
    body.ed-account-page .woocommerce-Addresses,
    body.ed-account-page #customer_login {
        grid-template-columns: 1fr;
    }
    body.ed-account-page .woocommerce-orders-table thead {
        display: none !important;
    }
    body.ed-account-page .woocommerce-orders-table,
    body.ed-account-page .woocommerce-orders-table tbody,
    body.ed-account-page .woocommerce-orders-table tr,
    body.ed-account-page .woocommerce-orders-table td {
        display: block !important;
        width: 100% !important;
    }
    body.ed-account-page .woocommerce-orders-table tr {
        padding: 12px 14px !important;
        border-bottom: 1px solid var(--ed-border) !important;
    }
    body.ed-account-page .woocommerce-orders-table tr:last-child {
        border-bottom: 0 !important;
    }
    body.ed-account-page .woocommerce-orders-table td {
        display: flex !important;
        justify-content: space-between;
        gap: 14px;
        padding: 8px 0 !important;
        border: 0 !important;
        text-align: right !important;
    }
    body.ed-account-page .woocommerce-orders-table td::before {
        color: var(--ed-muted) !important;
        text-align: left;
        font-weight: 600;
    }
    body.ed-account-page .woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions {
        display: block !important;
        text-align: left !important;
        padding-top: 12px !important;
    }
    body.ed-account-page .woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions::before {
        display: none !important;
    }
    body.ed-account-page .woocommerce-orders-table .button {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ed-account-page * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
