/**
 * ESP My Account Styles
 * Inspired by Paul B Wholesale's clean, card-based account area design
 */

/* ============================================
   CSS Variables - Account Page Specific
   ============================================ */
:root {
    --esp-account-card-bg: #ffffff;
    --esp-account-card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --esp-account-card-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --esp-account-card-radius: 0.5rem;
    --esp-account-border: #e5e7eb;
    --esp-account-text: #1f2937;
    --esp-account-text-muted: #6b7280;
    --esp-account-link: #D69E2E;
    --esp-account-link-hover: #B7791F;
    --esp-account-icon-bg: #fef3c7;
    --esp-account-success: #10b981;
    --esp-account-bg-light: #F3F4F6;
    --esp-account-surface-light: #FFFFFF;
}

/* ============================================
   Main Account Container
   ============================================ */
.esp-my-account {
    background-color: #f9fafb;
    min-height: 60vh;
    padding: 2rem 0 3rem;
    position: relative;
}

/* Diamond tread background pattern */
.esp-my-account::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0L40 20L20 40L0 20L20 0z' fill='none' stroke='%23d1d5db' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
    background-size: 40px 40px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.esp-my-account > * {
    position: relative;
    z-index: 1;
}

.esp-my-account .esp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Page Title */
.esp-my-account__title {
    font-size: var(--esp-text-4xl);         /* 2.25rem / 36px */
    font-weight: var(--esp-font-bold);      /* 700 */
    color: var(--esp-account-text);
    margin: 0 0 2rem;
    text-transform: uppercase;
    letter-spacing: var(--esp-tracking-wide); /* 0.025em */
    line-height: var(--esp-leading-tight);
}

@media (max-width: 767px) {
    .esp-my-account__title {
        font-size: var(--esp-text-3xl);     /* 1.875rem / 30px */
        margin-bottom: 1.5rem;
    }
}

/* ============================================
   WooCommerce Account Layout Override
   ============================================ */
/* Force grid layout on the WooCommerce wrapper */
.esp-my-account .woocommerce,
.esp-my-account-body .woocommerce {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    align-items: start !important;
}

/* Two-column layout on larger screens */
@media (min-width: 1024px) {
    .esp-my-account .woocommerce,
    .esp-my-account-body .woocommerce {
        grid-template-columns: 280px 1fr !important;
        gap: 2rem !important;
    }
}

.woocommerce-MyAccount-navigation,
.woocommerce-MyAccount-content {
    width: 100% !important;
    min-width: 0; /* Prevent overflow in grid */
}

/* Ensure proper grid placement */
.woocommerce-MyAccount-navigation {
    grid-column: 1;
    grid-row: 1;
}

.woocommerce-MyAccount-content {
    grid-column: 1;
    grid-row: 2;
}

@media (min-width: 1024px) {
    .woocommerce-MyAccount-content {
        grid-column: 2;
        grid-row: 1;
    }
}

/* ============================================
   Sidebar Navigation - Card Style
   ============================================ */
.woocommerce-MyAccount-navigation {
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
    .woocommerce-MyAccount-navigation {
        position: sticky;
        top: 2rem;
        margin-bottom: 0;
    }
}

/* Navigation Title (added via CSS) */
.woocommerce-MyAccount-navigation::before {
    content: "My Account";
    display: block;
    font-size: var(--esp-text-lg);          /* 1.125rem / 18px */
    font-weight: var(--esp-font-semibold);  /* 600 */
    color: var(--esp-account-text);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--esp-account-border);
}

/* Navigation List */
.woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-MyAccount-navigation ul li {
    margin: 0;
    padding: 0;
}

.woocommerce-MyAccount-navigation ul li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    color: var(--esp-account-text);
    text-decoration: none;
    font-size: var(--esp-text-base);        /* 1rem / 16px */
    border-radius: 0.25rem;
    transition: all 0.15s ease;
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background-color: #fef3c7;
    color: var(--esp-account-link-hover);
}

/* Active/Current State */
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--dashboard.is-active a {
    background-color: var(--esp-account-link);
    color: white;
    font-weight: var(--esp-font-semibold);  /* 600 */
}

/* Navigation Icons */
.woocommerce-MyAccount-navigation ul li a::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
}

.woocommerce-MyAccount-navigation-link--dashboard a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231f2937' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6'/%3E%3C/svg%3E");
}

.woocommerce-MyAccount-navigation-link--orders a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231f2937' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01'/%3E%3C/svg%3E");
}

.woocommerce-MyAccount-navigation-link--downloads a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231f2937' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4'/%3E%3C/svg%3E");
}

.woocommerce-MyAccount-navigation-link--edit-address a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231f2937' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 11a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3C/svg%3E");
}

.woocommerce-MyAccount-navigation-link--payment-methods a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231f2937' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z'/%3E%3C/svg%3E");
}

.woocommerce-MyAccount-navigation-link--edit-account a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231f2937' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'/%3E%3C/svg%3E");
}

.woocommerce-MyAccount-navigation-link--wishlist a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231f2937' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z'/%3E%3C/svg%3E");
}

.woocommerce-MyAccount-navigation-link--customer-logout a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231f2937' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1'/%3E%3C/svg%3E");
}

/* Active state icon color */
.woocommerce-MyAccount-navigation ul li.is-active a::before {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* Logout link separator */
.woocommerce-MyAccount-navigation-link--customer-logout {
    margin-top: 1rem !important;
    padding-top: 1rem;
    border-top: 1px solid var(--esp-account-border);
}

/* ============================================
   Main Content Area
   ============================================ */
.woocommerce-MyAccount-content {
    min-height: 400px;
}

/* ============================================
   Dashboard Page
   ============================================ */
.woocommerce-MyAccount-content > p:first-child {
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--esp-account-text);
}

.woocommerce-MyAccount-content > p:first-child a {
    color: var(--esp-account-link);
    font-weight: 600;
    text-decoration: none;
}

.woocommerce-MyAccount-content > p:first-child a:hover {
    color: var(--esp-account-link-hover);
    text-decoration: underline;
}

/* ============================================
   Section Cards (Addresses, Account Info, etc.)
   ============================================ */
.woocommerce-MyAccount-content .woocommerce-Address,
.woocommerce-MyAccount-content .u-columns,
.woocommerce-MyAccount-content .woocommerce-Addresses {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .woocommerce-MyAccount-content .u-columns,
    .woocommerce-MyAccount-content .woocommerce-Addresses {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Address Cards */
.woocommerce-MyAccount-content .woocommerce-Address,
.woocommerce-MyAccount-content .u-column1,
.woocommerce-MyAccount-content .u-column2,
.woocommerce-MyAccount-content .woocommerce-address-fields,
.woocommerce-MyAccount-content .woocommerce-column--billing-address,
.woocommerce-MyAccount-content .woocommerce-column--shipping-address {
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
    padding: 1.5rem 2rem;
}

/* Card Headers */
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3,
.woocommerce-MyAccount-content .woocommerce-Address-title {
    font-size: var(--esp-text-xl);          /* 1.25rem / 20px */
    font-weight: var(--esp-font-semibold);  /* 600 */
    color: var(--esp-account-text);
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--esp-account-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.woocommerce-MyAccount-content .woocommerce-Address-title h3 {
    border: none;
    padding: 0;
    margin: 0;
}

/* Edit Links */
.woocommerce-MyAccount-content .woocommerce-Address-title .edit,
.woocommerce-MyAccount-content a.edit {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--esp-account-link);
    text-decoration: none;
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    font-weight: var(--esp-font-medium);    /* 500 */
    transition: color 0.15s ease;
}

.woocommerce-MyAccount-content .woocommerce-Address-title .edit:hover,
.woocommerce-MyAccount-content a.edit:hover {
    color: var(--esp-account-link-hover);
}

.woocommerce-MyAccount-content .woocommerce-Address-title .edit::after,
.woocommerce-MyAccount-content a.edit::after {
    content: '→';
    font-size: 1rem;
}

/* Address Display */
.woocommerce-MyAccount-content address {
    font-style: normal;
    line-height: 1.7;
    color: var(--esp-account-text-muted);
}

/* ============================================
   Orders Table
   ============================================ */
.woocommerce-orders-table,
.woocommerce-MyAccount-content table {
    width: 100%;
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
    border-collapse: collapse;
    overflow: hidden;
}

.woocommerce-orders-table thead,
.woocommerce-MyAccount-content table thead {
    background-color: #f3f4f6;
}

.woocommerce-orders-table th,
.woocommerce-MyAccount-content table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: var(--esp-text-xs);          /* 0.75rem / 12px */
    font-weight: var(--esp-font-semibold);  /* 600 */
    text-transform: uppercase;
    letter-spacing: var(--esp-tracking-wider); /* 0.05em */
    color: var(--esp-account-text-muted);
    border-bottom: 1px solid var(--esp-account-border);
}

.woocommerce-orders-table td,
.woocommerce-MyAccount-content table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--esp-account-border);
    color: var(--esp-account-text);
    font-size: var(--esp-text-base);        /* 1rem / 16px */
}

.woocommerce-orders-table tbody tr:last-child td,
.woocommerce-MyAccount-content table tbody tr:last-child td {
    border-bottom: none;
}

.woocommerce-orders-table tbody tr:hover,
.woocommerce-MyAccount-content table tbody tr:hover {
    background-color: #fafafa;
}

/* Order Number Link */
.woocommerce-orders-table__cell-order-number a {
    color: var(--esp-account-link);
    font-weight: 600;
    text-decoration: none;
}

.woocommerce-orders-table__cell-order-number a:hover {
    color: var(--esp-account-link-hover);
    text-decoration: underline;
}

/* Order Status Badges */
.woocommerce-orders-table__cell-order-status {
    text-transform: capitalize;
}

/* Action Buttons */
.woocommerce-orders-table__cell-order-actions a,
.woocommerce-MyAccount-content .woocommerce-button,
.woocommerce-MyAccount-content .button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background-color: var(--esp-account-link);
    color: white !important;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.woocommerce-orders-table__cell-order-actions a:hover,
.woocommerce-MyAccount-content .woocommerce-button:hover,
.woocommerce-MyAccount-content .button:hover {
    background-color: var(--esp-account-link-hover);
    color: white !important;
}

/* View button (smaller) */
.woocommerce-orders-table__cell-order-actions .woocommerce-button--view {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ============================================
   Forms Styling
   ============================================ */
.woocommerce-MyAccount-content form {
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
    padding: 2rem;
}

.woocommerce-MyAccount-content form.woocommerce-form-login,
.woocommerce-MyAccount-content form.woocommerce-form-register {
    max-width: 480px;
}

.woocommerce-MyAccount-content fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.woocommerce-MyAccount-content legend {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--esp-account-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--esp-account-border);
    width: 100%;
}

/* Form Fields */
.woocommerce-MyAccount-content .form-row {
    margin-bottom: 1.25rem;
}

.woocommerce-MyAccount-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    font-weight: var(--esp-font-medium);    /* 500 */
    color: var(--esp-account-text);
}

.woocommerce-MyAccount-content label .required {
    color: #ef4444;
}

.woocommerce-MyAccount-content input[type="text"],
.woocommerce-MyAccount-content input[type="email"],
.woocommerce-MyAccount-content input[type="password"],
.woocommerce-MyAccount-content input[type="tel"],
.woocommerce-MyAccount-content select,
.woocommerce-MyAccount-content textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--esp-account-border);
    border-radius: 0.25rem;
    font-size: 1rem;
    color: var(--esp-account-text);
    background-color: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.woocommerce-MyAccount-content input:focus,
.woocommerce-MyAccount-content select:focus,
.woocommerce-MyAccount-content textarea:focus {
    outline: none;
    border-color: var(--esp-account-link);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* Checkbox styling */
.woocommerce-MyAccount-content input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

/* Submit Button */
.woocommerce-MyAccount-content button[type="submit"],
.woocommerce-MyAccount-content input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background-color: var(--esp-account-link);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: var(--esp-text-base);        /* 1rem / 16px */
    font-weight: var(--esp-font-semibold);  /* 600 */
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.woocommerce-MyAccount-content button[type="submit"]:hover,
.woocommerce-MyAccount-content input[type="submit"]:hover {
    background-color: var(--esp-account-link-hover);
}

/* ============================================
   Empty States
   ============================================ */
.woocommerce-MyAccount-content .woocommerce-info,
.woocommerce-MyAccount-content .woocommerce-message {
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
    padding: 2rem;
    text-align: center;
    color: var(--esp-account-text-muted);
    border-left: 4px solid var(--esp-account-link);
}

.woocommerce-MyAccount-content .woocommerce-info::before {
    content: none;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 1023px) {
    .woocommerce-MyAccount-navigation::before {
        cursor: pointer;
    }

    .woocommerce-MyAccount-navigation ul li a {
        padding: 0.625rem 0.75rem;
    }
}

@media (max-width: 767px) {
    .esp-my-account {
        padding: 1rem 0 2rem;
    }

    .woocommerce-MyAccount-navigation {
        padding: 1rem;
    }

    .woocommerce-MyAccount-content address,
    .woocommerce-MyAccount-content p {
        font-size: 0.9375rem;
    }

    .woocommerce-orders-table {
        display: block;
        overflow-x: auto;
    }

    .woocommerce-orders-table th,
    .woocommerce-orders-table td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .woocommerce-MyAccount-content form {
        padding: 1.25rem;
    }

    .woocommerce-MyAccount-content .u-columns,
    .woocommerce-MyAccount-content .woocommerce-Addresses {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Dashboard Welcome Card with Icon
   ============================================ */
.woocommerce-MyAccount-content > p:first-child {
    position: relative;
    padding-left: 5rem;
}

.woocommerce-MyAccount-content > p:first-child::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background-color: var(--esp-account-icon-bg);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f59e0b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'/%3E%3C/svg%3E");
    background-size: 28px;
    background-position: center;
    background-repeat: no-repeat;
}

@media (max-width: 640px) {
    .woocommerce-MyAccount-content > p:first-child {
        padding-left: 1.5rem;
        padding-top: 4.5rem;
    }

    .woocommerce-MyAccount-content > p:first-child::before {
        top: 1.25rem;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ============================================
   Downloads Page
   ============================================ */
.woocommerce-MyAccount-downloads-file {
    color: var(--esp-account-link);
    font-weight: 500;
    text-decoration: none;
}

.woocommerce-MyAccount-downloads-file:hover {
    color: var(--esp-account-link-hover);
    text-decoration: underline;
}

/* ============================================
   Payment Methods Page
   ============================================ */
.woocommerce-MyAccount-paymentMethods {
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
    overflow: hidden;
}

/* ============================================
   Wishlist Integration
   ============================================ */
.woocommerce-MyAccount-content .wishlist-items-wrapper {
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
}

/* ============================================
   Custom Dashboard Sections (ESP)
   ============================================ */
.esp-account-section {
    margin-bottom: 2rem;
}

.esp-account-section__title {
    font-size: var(--esp-text-2xl);         /* 1.5rem / 24px */
    font-weight: var(--esp-font-semibold);  /* 600 */
    color: var(--esp-account-text);
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.esp-account-section__action {
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    font-weight: var(--esp-font-medium);    /* 500 */
    color: var(--esp-account-link);
    text-decoration: underline;
    transition: color 0.15s ease;
}

.esp-account-section__action:hover {
    color: var(--esp-account-link-hover);
}

/* Card Grid - Account Information */
.esp-account-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* Card Grid - Address Book */
.esp-account-cards--addresses {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .esp-account-cards--addresses {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Contact Information Card */
.esp-account-card--contact {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
    padding: 2rem;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .esp-account-card--contact {
        max-width: 50%;
    }
}

@media (max-width: 639px) {
    .esp-account-card--contact {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

/* Address Cards */
.esp-account-card--address {
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.esp-account-card--address > .esp-account-card__content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Card Icon */
.esp-account-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    background-color: var(--esp-account-icon-bg);
    border-radius: 50%;
    color: var(--esp-account-link);
}

/* Card Content */
.esp-account-card__content {
    flex: 1;
}

.esp-account-card__title {
    font-size: var(--esp-text-lg);          /* 1.125rem / 18px */
    font-weight: var(--esp-font-semibold);  /* 600 */
    color: var(--esp-account-text);
    margin: 0 0 0.75rem;
    border: none !important;
    padding: 0 !important;
}

.esp-account-card__info {
    color: var(--esp-account-text-muted);
    margin: 0 0 0.5rem;
    line-height: 1.6;
}

.esp-account-card__info--company {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--esp-account-border);
}

.esp-account-card__address {
    font-style: normal;
    color: var(--esp-account-text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
    flex: 1;
}

.esp-account-card__address a {
    color: var(--esp-account-link);
    text-decoration: none;
}

.esp-account-card__address a:hover {
    text-decoration: underline;
}

.esp-account-card__empty {
    color: var(--esp-account-text-muted);
    font-style: italic;
    margin-bottom: 1rem;
    flex: 1;
}

/* Card Links */
.esp-account-card__links {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.esp-account-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--esp-account-link);
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    font-weight: var(--esp-font-medium);    /* 500 */
    text-decoration: none;
    transition: color 0.15s ease;
    width: fit-content;
}

.esp-account-card__link:hover {
    color: var(--esp-account-link-hover);
}

.esp-account-card__link svg {
    transition: transform 0.15s ease;
}

.esp-account-card__link:hover svg {
    transform: translateX(2px);
}

/* Hide default WooCommerce dashboard greeting on dashboard when our content is showing */
.woocommerce-MyAccount-content > p:first-child {
    display: none;
}

/* Show it only if our custom sections are not present (fallback) */
.woocommerce-MyAccount-content:not(:has(.esp-account-section)) > p:first-child {
    display: block;
}

/* ============================================
   Login/Register Page (Logged Out State)
   Designer concept: Diamond tread pattern, card-based layout
   ============================================ */

/* Hide page title when on login/register page */
.esp-my-account:has(#customer_login) .esp-my-account__title {
    display: none;
}

/* Main account container with background pattern - only for login page */
.esp-my-account:has(#customer_login) {
    position: relative;
    padding: 3rem 0;
    background-color: var(--esp-account-bg-light);
    overflow: hidden;
}

/* Diamond tread SVG background pattern */
.esp-my-account:has(#customer_login)::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.05;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20 L20 0 L40 20 L20 40 Z' fill='none' stroke='%231f2937' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* Ensure content is above pattern */
.esp-my-account:has(#customer_login) .esp-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
}

/* Reset the parent grid when login form is present */
.esp-my-account .woocommerce:has(#customer_login) {
    display: block !important;
    grid-template-columns: none !important;
}

/* Main container - CSS Grid for two-column layout */
.esp-my-account #customer_login {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 100%;
    padding: 0;
}

@media (min-width: 768px) {
    .esp-my-account #customer_login {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        grid-auto-rows: auto;
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .esp-my-account #customer_login {
        gap: 3rem;
    }
}

/* Login Card (Left Column) - Orange top border, shadow-xl */
.esp-my-account #customer_login .u-column1,
.esp-my-account .woocommerce #customer_login .col-1,
.woocommerce .esp-my-account #customer_login .col-1 {
    background-color: var(--esp-account-surface-light);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow-xl);
    border-top: 4px solid var(--esp-account-link);
    padding: 2rem 2.25rem 2.25rem;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

/* Explicit grid placement for desktop - Login in column 1 */
@media (min-width: 768px) {
    .esp-my-account #customer_login .u-column1,
    .esp-my-account .woocommerce #customer_login .col-1,
    .woocommerce .esp-my-account #customer_login .col-1 {
        grid-column: 1;
        grid-row: 1;
    }
}

/* Register Card (Right Column) - Gray top border */
.esp-my-account #customer_login .u-column2,
.esp-my-account .woocommerce #customer_login .col-2,
.woocommerce .esp-my-account #customer_login .col-2 {
    background-color: var(--esp-account-surface-light);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow-xl);
    border-top: 4px solid #374151;
    padding: 2rem 2.25rem 2.25rem;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

/* Explicit grid placement for desktop - Register in column 2 */
@media (min-width: 768px) {
    .esp-my-account #customer_login .u-column2,
    .esp-my-account .woocommerce #customer_login .col-2,
    .woocommerce .esp-my-account #customer_login .col-2 {
        grid-column: 2;
        grid-row: 1;
    }
}

/* Card Headings - Bold uppercase with tracking */
.esp-my-account #customer_login h2 {
    font-size: 1.625rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.375rem;
    padding: 0;
    border: none;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    font-family: 'Oswald', sans-serif;
    line-height: 1.2;
}

/* Subtitle text under heading */
.esp-my-account #customer_login .u-column1 > form::before {
    content: "If you have an account, sign in with your email address.";
    display: block;
    color: var(--esp-account-text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 1.75rem;
    margin-top: 0.125rem;
}

/* Remove the inner form border/box that WooCommerce adds */
.esp-my-account #customer_login .woocommerce-form-login,
.esp-my-account #customer_login .woocommerce-form-register {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0;
}

/* Login form - ensure no extra space at bottom */
.esp-my-account #customer_login .woocommerce-form-login {
    display: flex;
    flex-direction: column;
}

/* Social buttons section is last child - no margin after */
.esp-my-account #customer_login .woocommerce-form-login > *:last-child {
    margin-bottom: 0 !important;
}

/* Form fields */
.esp-my-account #customer_login .form-row {
    margin-bottom: 1.25rem;
    background: transparent;
    border: none;
    padding: 0;
}

/* Password field row - reduced bottom margin for equal spacing around Remember me */
.esp-my-account #customer_login .form-row:has(input#password) {
    margin-bottom: 0;
}

/* Labels */
.esp-my-account #customer_login label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--esp-account-text);
}

.esp-my-account #customer_login .required {
    color: #ef4444;
}

/* Input fields with rounded corners and focus ring */
.esp-my-account #customer_login input[type="text"],
.esp-my-account #customer_login input[type="email"],
.esp-my-account #customer_login input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--esp-account-border);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.25;
    color: var(--esp-account-text);
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.esp-my-account #customer_login input[type="text"]:focus,
.esp-my-account #customer_login input[type="email"]:focus,
.esp-my-account #customer_login input[type="password"]:focus {
    outline: none;
    border-color: var(--esp-account-link);
    box-shadow: 0 0 0 3px rgba(214, 158, 46, 0.2);
}

.esp-my-account #customer_login input::placeholder {
    color: #9ca3af;
}

/* Password field wrapper */
.esp-my-account #customer_login .password-input {
    position: relative;
    display: flex;
    align-items: center;
}

/* Email/Username field icon (envelope) */
.esp-my-account #customer_login .woocommerce-form-login .form-row:has(input#username) {
    position: relative;
}

.esp-my-account #customer_login .woocommerce-form-login .form-row:has(input#username)::after {
    content: '';
    position: absolute;
    left: 0.875rem;
    bottom: 0.875rem;
    width: 1.125rem;
    height: 1.125rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Password field icon (lock) */
.esp-my-account #customer_login .password-input::before {
    content: '';
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.125rem;
    height: 1.125rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
}

.esp-my-account #customer_login .show-password-input {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 0.75rem;
    height: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
}

.esp-my-account #customer_login .show-password-input:hover {
    color: var(--esp-account-text);
}

/* Login Form Layout - Use CSS Grid for precise control */
.esp-my-account #customer_login .woocommerce-form-login {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    position: relative; /* Context for Lost Password positioning */
}

/* Remember me checkbox styling */
.esp-my-account #customer_login .woocommerce-form-login__rememberme {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--esp-account-text);
}

.esp-my-account #customer_login .woocommerce-form-login__rememberme input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--esp-account-link);
    border-radius: 0.25rem;
    margin: 0 !important;
}

/* Row containing Remember me + Submit button - restructure with flexbox */
.esp-my-account #customer_login .woocommerce-form-login > .form-row:has(.woocommerce-form-login__rememberme) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    margin-bottom: 0;
    margin-top: 1rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
}

/* Hide hidden inputs from flex layout */
.esp-my-account #customer_login .woocommerce-form-login > .form-row:has(.woocommerce-form-login__rememberme) > input[type="hidden"] {
    display: none !important;
}

/* Remember me label - left aligned flush with input */
.esp-my-account #customer_login .woocommerce-form-login > .form-row:has(.woocommerce-form-login__rememberme) .woocommerce-form-login__rememberme {
    order: 1;
    flex: 0 0 auto;
    margin: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Submit button - full width at bottom */
.esp-my-account #customer_login .woocommerce-form-login > .form-row:has(.woocommerce-form-login__rememberme) .woocommerce-button {
    order: 3;
    flex: 1 1 100%;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 1rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Lost Password link - right aligned flush with input */
.esp-my-account #customer_login .woocommerce-LostPassword {
    order: 2;
    flex: 0 0 auto;
    text-align: right;
    margin: 0 !important;
    margin-left: auto !important;
    padding: 0 !important;
    padding-right: 0 !important;
}

.esp-my-account #customer_login .woocommerce-LostPassword a {
    color: var(--esp-account-link);
    text-decoration: underline;
    text-decoration-style: solid;
    text-underline-offset: 2px;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.esp-my-account #customer_login .woocommerce-LostPassword a:hover {
    color: var(--esp-account-link-hover);
}

/* Submit button - Full width, uppercase */
.esp-my-account #customer_login .u-column1 button[type="submit"],
.esp-my-account #customer_login .woocommerce-form-login .woocommerce-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--esp-account-link);
    color: #fff !important;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.esp-my-account #customer_login .u-column1 button[type="submit"]:hover,
.esp-my-account #customer_login .woocommerce-form-login .woocommerce-button:hover {
    background-color: var(--esp-account-link-hover);
}

/* ============================================
   Register Column (New Customers)
   ============================================ */

/* Register heading */
.esp-my-account #customer_login .u-column2 h2 {
    margin-bottom: 0.5rem;
}

/* Info text below register heading */
.esp-my-account #customer_login .u-column2 > p:first-of-type {
    color: var(--esp-account-text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Register intro text */
.esp-my-account .esp-register-intro {
    color: var(--esp-account-text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem !important;
    margin-top: 0 !important;
}

/* Benefits box styling - sized naturally to content */
.esp-my-account .esp-benefits-box {
    background-color: var(--esp-account-bg-light);
    border: 1px solid var(--esp-account-border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem !important;
}

.esp-my-account .esp-benefits-box h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--esp-account-font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--esp-account-text);
    margin: 0 0 1rem 0;
}

.esp-my-account .esp-benefits-box h3 svg {
    color: var(--esp-account-link);
    flex-shrink: 0;
}

.esp-my-account .esp-benefits-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.esp-my-account .esp-benefits-box li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--esp-account-text-muted);
    margin-bottom: 0.75rem;
}

.esp-my-account .esp-benefits-box li:last-child {
    margin-bottom: 0;
}

.esp-my-account .esp-benefits-box li svg {
    color: #16a34a;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Legacy benefits box pseudo-element - remove */
.esp-my-account #customer_login .u-column2::after {
    content: '';
    display: block;
    flex: 1;
}

/* Privacy policy text - hidden on register form */
.esp-my-account #customer_login .woocommerce-privacy-policy-text {
    display: none !important;
}

/* Hide "A link to set a new password..." text on register form - target text-only paragraphs */
.esp-my-account #customer_login .woocommerce-form-register > p:not(:has(label)):not(:has(button)):not(.esp-register-intro) {
    display: none !important;
}

/* Register form layout */
.esp-my-account #customer_login .woocommerce-form-register {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

/* Button row - push to bottom to align with Sign In button */
.esp-my-account #customer_login .woocommerce-form-register > p:has(button[type="submit"]) {
    margin-top: auto !important;
    padding-top: 1rem;
}

/* Registration form elements - hidden by default, shown when form is expanded */
/* Email field */
.esp-my-account #customer_login .woocommerce-form-register > p:has(label[for="reg_email"]) {
    display: none;
    margin-bottom: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Social buttons container - New Customers column only */
.esp-my-account #customer_login .u-column2 .nsl-container {
    display: none !important;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Wholesale link - visible by default */
.esp-my-account #customer_login .esp-wholesale-link {
    display: block !important;
    opacity: 1;
    max-height: 100px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Show all elements when form/column is expanded */
.esp-my-account #customer_login .woocommerce-form-register.esp-form-expanded > p:has(label[for="reg_email"]) {
    display: block !important;
    opacity: 1;
    max-height: 200px;
}

.esp-my-account #customer_login .u-column2.esp-register-expanded .nsl-container {
    display: block !important;
    opacity: 1;
    max-height: 200px;
}

/* Hide wholesale link when form is expanded */
.esp-my-account #customer_login .u-column2.esp-register-expanded .esp-wholesale-link {
    display: none !important;
    opacity: 0;
    max-height: 0;
}

.esp-my-account #customer_login .woocommerce-form-register > p:first-of-type > label {
    display: block;
    margin-bottom: 0.25rem;
}

.esp-my-account #customer_login .woocommerce-form-register > p:first-of-type > input {
    width: 100%;
}

/* Register button - Outlined style */
.esp-my-account #customer_login .woocommerce-form-register .form-row:has(button[type="submit"]) {
    position: static;
    margin: 0;
    padding: 0;
    border: none;
}

.esp-my-account #customer_login .u-column2 button[type="submit"] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: transparent;
    color: var(--esp-account-text) !important;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.esp-my-account #customer_login .u-column2 button[type="submit"]:hover {
    background-color: #f3f4f6;
}

/* ============================================
   Wholesale Application Link (Register Section)
   ============================================ */
.esp-wholesale-link {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px dashed #9ca3af;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.esp-wholesale-link:hover {
    color: var(--esp-account-link);
    border-color: var(--esp-account-link);
}

/* ============================================
   Nextend Social Login Buttons - Horizontal Layout
   ============================================ */

/* "Or continue with" divider above social buttons - with horizontal lines */
.esp-my-account #customer_login .nsl-container::before {
    content: 'Or continue with';
    display: flex;
    width: 100%;
    text-align: center;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--esp-account-text-muted);
    text-transform: none;
    letter-spacing: 0;
}

/* Horizontal lines on both sides of divider text */
.esp-my-account #customer_login .nsl-container {
    position: relative;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Login column - remove extra bottom space after social buttons */
.esp-my-account #customer_login .u-column1 .nsl-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Reduce bottom padding on login card to match gap above social buttons (1rem) */
.esp-my-account #customer_login .u-column1 {
    padding-bottom: 1rem !important;
}

/* Ensure social button container has no extra bottom margin */
.esp-my-account #customer_login .nsl-container-buttons {
    margin-bottom: 0 !important;
}

.esp-my-account #customer_login .nsl-container::before {
    background: linear-gradient(to right,
        var(--esp-account-border) 0%,
        var(--esp-account-border) calc(50% - 80px),
        transparent calc(50% - 80px),
        transparent calc(50% + 80px),
        var(--esp-account-border) calc(50% + 80px),
        var(--esp-account-border) 100%
    );
    background-size: 100% 1px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Make button container horizontal - 3 columns (Facebook, Google, Apple) */
.esp-my-account #customer_login .nsl-container-buttons {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem !important;
    width: 100% !important;
}

/* Remove default flex layout */
.esp-my-account #customer_login .nsl-container-buttons a[data-plugin="nsl"] {
    display: block !important;
    width: 100% !important;
}

/* Button styling - icon only appearance, consistent height */
.esp-my-account #customer_login .nsl-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.75rem !important;
    min-height: 48px !important;
    height: 48px !important;
    border-radius: 0.5rem !important;
    border: 1px solid var(--esp-account-border) !important;
    box-sizing: border-box !important;
    transition: background-color 0.15s ease, border-color 0.15s ease !important;
}

/* Hide the text label, show only icon */
.esp-my-account #customer_login .nsl-button-label-container {
    display: none !important;
}

.esp-my-account #customer_login .nsl-button-svg-container {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.esp-my-account #customer_login .nsl-button-svg-container svg {
    width: 24px !important;
    height: 24px !important;
}

/* Apple icon needs to be larger due to its narrow aspect ratio */
.esp-my-account #customer_login .nsl-button-apple .nsl-button-svg-container svg {
    width: 46px !important;
    height: 46px !important;
}

/* Social buttons - white background with gray border, monochrome icons */
.esp-my-account #customer_login .nsl-button-facebook {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}

.esp-my-account #customer_login .nsl-button-facebook:hover {
    background-color: #f9fafb !important;
    border-color: #d1d5db !important;
}

/* Facebook icon - dark gray/black (intentionally uncolored) */
.esp-my-account #customer_login .nsl-button-facebook svg,
.esp-my-account #customer_login .nsl-button-facebook svg path {
    fill: #374151 !important;
}

.esp-my-account #customer_login .nsl-button-facebook img {
    filter: grayscale(100%) brightness(0.3) !important;
}

/* Google button - white background with gray border (matching other social buttons) */
.esp-my-account #customer_login .nsl-button-google {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
    box-shadow: none !important;
}

.esp-my-account #customer_login .nsl-button-google:hover {
    background-color: #f9fafb !important;
    border-color: #d1d5db !important;
}

/* Google icon - dark/black (intentionally uncolored) */
.esp-my-account #customer_login .nsl-button-google svg,
.esp-my-account #customer_login .nsl-button-google img {
    filter: grayscale(100%) brightness(0.3) !important;
}

/* Apple button - white background with gray border */
.esp-my-account #customer_login .nsl-button-apple {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}

.esp-my-account #customer_login .nsl-button-apple:hover {
    background-color: #f9fafb !important;
    border-color: #d1d5db !important;
}

/* Apple icon - hide internal background rect, make logo black */
.esp-my-account #customer_login .nsl-button-apple svg rect {
    fill: transparent !important;
}

.esp-my-account #customer_login .nsl-button-apple svg path {
    fill: #000000 !important;
}

.esp-my-account #customer_login .nsl-button-apple img {
    filter: brightness(0) !important;
    width: 46px !important;
    height: 46px !important;
    object-fit: contain !important;
}

/* Apple SVG icon - make taller to match visual weight of other icons */
.esp-my-account #customer_login .nsl-button-apple svg {
    width: 46px !important;
    height: 46px !important;
}

.esp-my-account #customer_login .nsl-button-apple .nsl-button-svg-container {
    background: transparent !important;
    width: 46px !important;
    height: 46px !important;
}

/* Mobile responsive - 3 columns still work on mobile */
@media (max-width: 480px) {
    .esp-my-account #customer_login .nsl-container-buttons {
        gap: 0.5rem !important;
    }

    .esp-my-account #customer_login .nsl-button {
        padding: 0.5rem !important;
        min-height: 44px !important;
        height: 44px !important;
    }

    .esp-my-account #customer_login .nsl-button-svg-container svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* ============================================
   Support Contact Section
   ============================================ */
.esp-login-support {
    margin-top: 3rem;
    text-align: center;
}

.esp-login-support__text {
    color: var(--esp-account-text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
}

.esp-login-support__link {
    color: var(--esp-account-link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.esp-login-support__link:hover {
    color: var(--esp-account-link-hover);
    text-decoration: underline;
}

/* ============================================
   Brand Bar - Partner Logos
   ============================================ */
.esp-brand-bar {
    background-color: var(--esp-account-surface-light);
    border-top: 1px solid var(--esp-account-border);
    border-bottom: 1px solid var(--esp-account-border);
    padding: 2rem 1rem;
}

.esp-brand-bar__container {
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.esp-brand-bar__logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: all 0.5s ease;
}

.esp-brand-bar__logos:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.esp-brand-bar__logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: #9ca3af;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.05em;
}

@media (min-width: 768px) {
    .esp-brand-bar__logos {
        gap: 3rem;
    }

    .esp-brand-bar__logo {
        font-size: 1.75rem;
    }
}

.esp-brand-bar__logo--baldwin {
    font-style: italic;
}

.esp-brand-bar__logo--kondex {
    background-color: #9ca3af;
    color: #fff;
    padding: 0.25rem 0.5rem;
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .esp-brand-bar__logo--kondex {
        font-size: 1.5rem;
    }
}

/* ============================================
   Phone Number Banner
   ============================================ */
.esp-phone-banner {
    background-color: var(--esp-account-link);
    padding: 1rem;
}

.esp-phone-banner__container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
}

.esp-phone-banner__number {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.1em;
}

/* ============================================
   Registration Success Modal
   ============================================ */

/* Body lock when modal is open */
body.esp-modal-open {
    overflow: hidden;
}

/* Modal container - full screen fixed overlay */
.esp-registration-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Backdrop */
.esp-registration-modal__backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Container for the modal content */
.esp-registration-modal__container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
}

/* Modal content card */
.esp-registration-modal__content {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    text-align: center;
    position: relative;
}

/* Close button (X) */
.esp-registration-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.15s ease;
    border-radius: 0.25rem;
}

.esp-registration-modal__close:hover {
    color: #1f2937;
    background-color: #f3f4f6;
}

.esp-registration-modal__close:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--esp-account-link);
}

/* Email icon */
.esp-registration-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: var(--esp-account-icon-bg);
    border-radius: 50%;
    color: var(--esp-account-link);
    margin-bottom: 1.5rem;
}

/* Title */
.esp-registration-modal__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--esp-account-text);
    margin: 0 0 1rem;
    border: none !important;
    padding: 0 !important;
}

/* Message content */
.esp-registration-modal__message {
    margin-bottom: 1.5rem;
}

.esp-registration-modal__message p {
    margin: 0 0 0.5rem;
    color: var(--esp-account-text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.esp-registration-modal__email {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--esp-account-text);
    background-color: #f3f4f6;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.75rem 0 !important;
    word-break: break-all;
}

.esp-registration-modal__instructions {
    font-size: 0.9375rem;
    color: var(--esp-account-text-muted);
}

/* Tips section */
.esp-registration-modal__tips {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 0.375rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.esp-registration-modal__tips p {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: var(--esp-account-text);
}

.esp-registration-modal__tips ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--esp-account-text-muted);
    font-size: 0.875rem;
}

.esp-registration-modal__tips li {
    margin-bottom: 0.25rem;
}

/* Action buttons */
.esp-registration-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .esp-registration-modal__actions {
        flex-direction: row-reverse;
        justify-content: center;
    }
}

/* Resend button (secondary) */
.esp-registration-modal__resend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #fff;
    color: var(--esp-account-link);
    border: 1px solid var(--esp-account-link);
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 140px;
}

.esp-registration-modal__resend:hover:not(:disabled) {
    background-color: #fffbeb;
}

.esp-registration-modal__resend:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.esp-registration-modal__resend--loading {
    color: var(--esp-account-text-muted);
}

/* Spinner animation */
.esp-registration-modal__spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.esp-registration-modal__spinner .animate-spin {
    animation: esp-spin 1s linear infinite;
}

@keyframes esp-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Close button (primary) */
.esp-registration-modal__close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--esp-account-link);
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
    min-width: 140px;
}

.esp-registration-modal__close-btn:hover {
    background-color: var(--esp-account-link-hover);
}

/* Success message */
.esp-registration-modal__success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.375rem;
    color: #059669;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Error message */
.esp-registration-modal__error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Modal transitions */
.esp-modal-transition-enter {
    transition: opacity 0.2s ease-out;
}
.esp-modal-transition-enter-start {
    opacity: 0;
}
.esp-modal-transition-enter-end {
    opacity: 1;
}
.esp-modal-transition-leave {
    transition: opacity 0.15s ease-in;
}
.esp-modal-transition-leave-start {
    opacity: 1;
}
.esp-modal-transition-leave-end {
    opacity: 0;
}

.esp-modal-content-enter {
    transition: all 0.2s ease-out;
}
.esp-modal-content-enter-start {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
}
.esp-modal-content-enter-end {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.esp-modal-content-leave {
    transition: all 0.15s ease-in;
}
.esp-modal-content-leave-start {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.esp-modal-content-leave-end {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
}

/* ============================================
   Lost Password / Reset Password Forms
   ============================================ */

/* Main container for lost-password page */
.esp-my-account .woocommerce:has(.woocommerce-ResetPassword),
.esp-my-account .woocommerce:has(form.lost_reset_password) {
    display: block !important;
}

/* Lost password form card */
.esp-my-account .woocommerce-ResetPassword,
.esp-my-account form.lost_reset_password {
    max-width: 480px;
    margin: 0 auto;
    background: var(--esp-account-card-bg);
    border-radius: var(--esp-account-card-radius);
    box-shadow: var(--esp-account-card-shadow);
    padding: 2rem;
}

/* Form instructions text */
.esp-my-account .woocommerce-ResetPassword p:first-of-type:not(.form-row),
.esp-my-account form.lost_reset_password > p:first-child {
    color: var(--esp-account-text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Labels - prevent wrapping */
.esp-my-account .woocommerce-ResetPassword label,
.esp-my-account form.lost_reset_password label {
    display: block;
    white-space: nowrap;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--esp-account-text);
}

/* Form rows */
.esp-my-account .woocommerce-ResetPassword .form-row,
.esp-my-account form.lost_reset_password .form-row {
    margin-bottom: 1.25rem;
}

/* Input fields */
.esp-my-account .woocommerce-ResetPassword input[type="text"],
.esp-my-account .woocommerce-ResetPassword input[type="email"],
.esp-my-account .woocommerce-ResetPassword input[type="password"],
.esp-my-account form.lost_reset_password input[type="text"],
.esp-my-account form.lost_reset_password input[type="email"],
.esp-my-account form.lost_reset_password input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--esp-account-border);
    border-radius: 0.25rem;
    font-size: 1rem;
    color: var(--esp-account-text);
    background-color: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.esp-my-account .woocommerce-ResetPassword input:focus,
.esp-my-account form.lost_reset_password input:focus {
    outline: none;
    border-color: var(--esp-account-link);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* Submit button */
.esp-my-account .woocommerce-ResetPassword button[type="submit"],
.esp-my-account form.lost_reset_password button[type="submit"],
.esp-my-account form.lost_reset_password input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--esp-account-link);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
    margin-top: 0.5rem;
}

.esp-my-account .woocommerce-ResetPassword button[type="submit"]:hover,
.esp-my-account form.lost_reset_password button[type="submit"]:hover,
.esp-my-account form.lost_reset_password input[type="submit"]:hover {
    background-color: var(--esp-account-link-hover);
}

/* Password strength meter */
.esp-my-account .woocommerce-password-strength {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.esp-my-account .woocommerce-password-strength.short {
    background-color: #fef2f2;
    color: #dc2626;
}

.esp-my-account .woocommerce-password-strength.bad {
    background-color: #fff7ed;
    color: #ea580c;
}

.esp-my-account .woocommerce-password-strength.good {
    background-color: #fefce8;
    color: #ca8a04;
}

.esp-my-account .woocommerce-password-strength.strong {
    background-color: #ecfdf5;
    color: #059669;
}

/* Password hint text */
.esp-my-account .woocommerce-password-hint {
    font-size: 0.8125rem;
    color: var(--esp-account-text-muted);
    margin-top: 0.375rem;
}

/* ============================================
   Social Login Integration (Nextend Social Login)
   ============================================ */

/* Social login wrapper */
.esp-social-login-wrapper {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

/* "Or continue with" separator */
.esp-social-login-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 1rem;
}

.esp-social-login-separator::before,
.esp-social-login-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--esp-account-border);
}

.esp-social-login-separator span {
    padding: 0 1rem;
    font-size: 0.875rem;
    color: var(--esp-account-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Social login buttons container */
.esp-social-login-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

/* Nextend button overrides for ESP styling */
.esp-social-login-buttons .nsl-container {
    margin: 0 !important;
}

.esp-social-login-buttons .nsl-container-buttons {
    display: flex !important;
    justify-content: center !important;
    gap: 0.75rem !important;
}

/* Style the Google button with ESP gold hover */
.esp-social-login-buttons .nsl-button {
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.esp-social-login-buttons .nsl-button:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25) !important;
    transform: translateY(-1px) !important;
}

/* Icon-only style adjustments */
.esp-social-login-buttons .nsl-button-icon {
    padding: 0.75rem !important;
}

/* Text button style adjustments */
.esp-social-login-buttons .nsl-button-default {
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
}

/* Google button specific styling */
.esp-social-login-buttons .nsl-button-google {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
}

.esp-social-login-buttons .nsl-button-google:hover {
    border-color: #f59e0b !important;
    background-color: #fffbeb !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .esp-social-login-wrapper {
        margin-top: 1.25rem;
        padding-top: 1.25rem;
    }

    .esp-social-login-separator span {
        font-size: 0.75rem;
        padding: 0 0.75rem;
    }

    .esp-social-login-buttons .nsl-button-default {
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .woocommerce-MyAccount-navigation {
        display: none;
    }

    .woocommerce-account .woocommerce {
        display: block;
    }

    .woocommerce-MyAccount-content {
        box-shadow: none;
    }

    .esp-registration-modal {
        display: none !important;
    }
}
