@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

:root {
    --twm-color-primary: #000000;
    --twm-color-primary-soft: #f5f5f5;
    --twm-color-text: #000000;
    --twm-color-muted: #666666;
    --twm-color-card: #ffffff;
    --twm-color-card-bg: #f9f9f9;
    --twm-color-icon: #000000;
    --twm-color-card-title: #000000;
    --twm-color-card-subtitle: #666666;
    --twm-color-surface: #ffffff;
    --twm-color-border: #e0e0e0;
}

.twm-myaccount-container {
    font-family: 'Manrope', sans-serif;
    background: transparent;
    padding: 4rem 1rem;
}

/* ---- Sub-secciones (no dashboard): sin card envolvente ---- */
.twm-section-page {
    padding: 0;
    background: transparent;
}

.twm-section-page .twm-myaccount-card {
    max-width: 100%;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
}

.twm-section-page .twm-myaccount-content {
    padding: 0;
}

/* Full width override for compare page container - AGGRESSIVE */
.twm-myaccount-container.twm-is-compare-container {
    padding: 2rem !important;
    width: 100vw !important;
    max-width: none !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    box-sizing: border-box !important;
    /* Ensure background matches */
}

/* Ensure background stretches on scroll - REVERTED to avoid header expansion */
/* Instead, we handle background on the table wrapper if needed */
.twm-is-compare-container .twm-myaccount-card.twm-is-compare {
    min-width: 100%;
    width: 100% !important;
    /* Keep card at viewport width */
}

/* Default Card Style (Restored) */
.twm-myaccount-card {
    max-width: 960px;
    margin: 0 auto;
    background: var(--twm-color-card);
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

/* Reset card styles for full width compare page */
.twm-myaccount-card.twm-is-compare {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* Force Header content to stay in viewport and not wrap awkwardly */
.twm-is-compare .twm-myaccount-header {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 1rem;
    /* Add some padding if needed */
    flex-wrap: nowrap !important;
    /* Force single line */
    align-items: center;
}

.twm-is-compare .twm-myaccount-header .twm-actions {
    margin-left: auto;
    /* Push to right */
    white-space: nowrap;
    /* Prevent internal wrapping */
}

/* Scrolling Content Configuration */
.twm-is-compare .twm-myaccount-content {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2rem;
    /* Ensure styles apply to the scrolling area */
    background: #fff;
}

/* Ensure the table has enough width to trigger scroll */
.twm-is-compare table.xstore-compare-table {
    background: #fff;
    /* Ensure table has background */
}

.twm-myaccount-header {
    position: relative;
    display: block;
    margin-bottom: 2rem;
    padding-top: 0.5rem;
}

.twm-header-text {
    max-width: 60%;
}

.twm-hello {
    font-size: 1.5rem;
    color: var(--twm-color-text);
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.twm-subtitle {
    margin: 0;
    color: var(--twm-color-muted);
}

.twm-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--twm-color-muted);
}

.twm-avatar-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.twm-avatar {
    width: 100%;
    height: 100%;
}

.twm-link {
    color: var(--twm-color-primary);
    text-decoration: none;
    font-weight: 500;
}

.twm-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.twm-dashboard-card {
    background: var(--twm-color-card-bg);
    padding: 1rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--twm-color-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.twm-dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.twm-card-icon {
    flex-shrink: 0;
}

.twm-dashboard-card .twm-icon-badge {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    background: var(--twm-color-icon-bg, #f5f5f5);
    color: var(--twm-color-icon);
    font-weight: 600;
    font-size: 1.1rem;
}

.twm-card-body {
    flex: 1;
}

.twm-dashboard-card .twm-card-title {
    margin: 0;
    font-weight: 600;
    color: var(--twm-color-card-title);
}

.twm-dashboard-card .twm-card-subtitle {
    margin: 0.25rem 0 0;
    color: var(--twm-color-card-subtitle);
    font-size: 0.9rem;
}

.twm-status-active {
    color: var(--twm-color-primary);
    font-weight: 500;
}

.twm-status-muted {
    color: var(--twm-color-muted);
}

.twm-card-arrow {
    font-size: 1.3rem;
    color: var(--twm-color-primary);
}

.twm-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
}

.twm-orders-header h2 {
    color: #000000;
    margin: 0;
}

.twm-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.twm-auth-wrapper {
    max-width: 960px;
    margin: 3rem auto;
    padding: 1rem;
}

.twm-auth-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-items: center;
    background: #fff;
    border-radius: 32px;
    padding: 2rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.08);
}

.twm-auth-left {
    background: var(--twm-login-bg, linear-gradient(135deg, #000000 0%, #333333 100%));
    border-radius: 24px;
    padding: 2rem;
    color: #fff;
}

.twm-auth-left h1,
.twm-auth-left h2,
.twm-auth-left h3,
.twm-auth-left p {
    color: #fff;
}

.twm-auth-right .woocommerce-form-login {
    background: #ffffff;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.twm-auth-right .woocommerce-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.twm-auth-right .woocommerce-form-row label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--twm-color-text);
}

.twm-auth-right .woocommerce-Input,
.twm-auth-right input.woocommerce-Input--text,
.twm-auth-right input[type="text"],
.twm-auth-right input[type="email"],
.twm-auth-right input[type="password"] {
    display: block;
    width: 100%;
    background: #f8f8f8;
    border: 1.5px solid var(--twm-color-border);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--twm-color-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.twm-auth-right input[type="text"]:focus,
.twm-auth-right input[type="email"]:focus,
.twm-auth-right input[type="password"]:focus {
    border-color: var(--twm-color-primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
    background: #fff;
}

/* Fila del checkbox + botón submit */
.twm-auth-right .form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.twm-auth-right .woocommerce-form__label-for-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.twm-auth-right .woocommerce-form-login__submit,
.twm-auth-right button[name="login"],
.twm-auth-right button[name="register"] {
    background: var(--twm-color-primary);
    border: none;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.twm-auth-right .woocommerce-form-login__submit:hover,
.twm-auth-right button[name="login"]:hover,
.twm-auth-right button[name="register"]:hover {
    opacity: 0.85;
}

.twm-auth-right .woocommerce-LostPassword {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.twm-auth-right .woocommerce-LostPassword a {
    color: var(--twm-color-muted);
    text-decoration: underline;
}

.twm-register-hint {
    margin-top: 1rem;
    font-size: 0.95rem;
}

.twm-register-hint a {
    color: var(--twm-color-primary);
    font-weight: 600;
}

/* Password toggle (ojito) */
.twm-password-wrap {
    position: relative;
    display: block;
}

.twm-password-wrap input[type="password"],
.twm-password-wrap input[type="text"] {
    padding-right: 2.75rem !important;
    width: 100%;
    box-sizing: border-box;
}

.twm-toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--twm-color-muted, #999);
    display: flex;
    align-items: center;
    line-height: 1;
    transition: color 0.2s ease;
}

.twm-toggle-password:hover {
    color: var(--twm-color-text, #222);
}

.twm-eye-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.twm-toggle-password .twm-eye-hide {
    display: none;
}

.twm-toggle-password.is-visible .twm-eye-show {
    display: none;
}

.twm-toggle-password.is-visible .twm-eye-hide {
    display: block;
}

.twm-security-row label {
    font-weight: 500;
}

.twm-security-row input {
    width: 100%;
    border: 1px solid var(--twm-color-border);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
}

.twm-address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.twm-address-card {
    background: #fff;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
}

.twm-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.twm-card-head h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--twm-color-text);
}

.twm-address-body {
    color: var(--twm-color-text);
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.twm-orders-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.twm-filter {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.twm-input {
    border: 1px solid var(--twm-color-border);
    background: #fff;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 0.95rem;
}

.twm-btn {
    border-radius: 999px;
    padding: 0.55rem 1.5rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: opacity 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.twm-btn-primary {
    background: var(--twm-color-primary);
    color: #fff;
    font-weight: 600;
}

.twm-btn-ghost {
    background: transparent;
    color: var(--twm-color-primary);
    border: 1px solid var(--twm-color-border);
    font-weight: 500;
}

.twm-btn.is-disabled {
    pointer-events: none;
    opacity: 0.5;
}

.twm-muted {
    color: var(--twm-color-muted);
    font-size: 0.9rem;
}

.twm-orders-table table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

body .twm-orders-table th,
body .twm-orders-table td {
    padding: 1.5rem 2.5rem !important;
    text-align: left;
    border-bottom: 1px solid var(--twm-color-border);
    font-size: 0.95rem;
    vertical-align: middle;
}

.twm-orders-table th {
    font-weight: 700;
    color: var(--twm-color-text);
    background: #fcfcfc;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.twm-orders-table tr:last-child td {
    border-bottom: none;
}

.twm-order-time {
    color: var(--twm-color-muted);
}

.twm-empty-state {
    margin: 0;
    padding: 2rem;
    text-align: center;
    color: var(--twm-color-muted);
}

.twm-downloads-table table {
    box-shadow: none;
}

.twm-status-badge {
    display: inline-flex;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
    background: var(--twm-color-primary-soft);
    color: var(--twm-color-primary);
}

.twm-status-processing,
.twm-status-on-hold {
    background: rgba(255, 193, 7, 0.2);
    color: #9c6500;
}

.twm-status-completed {
    background: rgba(0, 0, 0, 0.15);
    color: var(--twm-color-primary);
}

.twm-status-pending {
    background: rgba(0, 123, 255, 0.15);
    color: #0056b3;
}

.twm-status-cancelled,
.twm-status-failed {
    background: rgba(220, 53, 69, 0.15);
    color: #a11221;
}

.twm-pagination {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.twm-pagination-info {
    color: var(--twm-color-muted);
    font-size: 0.9rem;
}

.twm-embed {
    background: #fff;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
}

.twm-embed .twm-empty-state {
    padding: 1rem 0;
}

.twm-order-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.twm-order-items table {
    width: 100%;
    margin-top: 1rem;
}

.twm-order-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.twm-label {
    margin: 0 0 0.35rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--twm-color-muted);
    letter-spacing: 0.05em;
}

.twm-form-card {
    background: #fff;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
}

.twm-form-card form {
    display: grid;
    gap: 1.25rem;
}

/* El form de direcciones envuelve los campos en .woocommerce-address-fields >
   __field-wrapper (no son hijos directos del grid del form), asi que les damos
   su propia rejilla para que las filas no queden pegadas entre si. */
.twm-form-card .woocommerce-address-fields {
    display: grid;
    gap: 1.25rem;
}

.twm-form-card .woocommerce-address-fields__field-wrapper {
    display: grid;
    gap: 1.1rem;
}

.twm-form-card .woocommerce-address-fields p {
    margin: 0;
}

.twm-form-card .woocommerce-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
}

.twm-form-card .woocommerce-form-row label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--twm-color-text);
}

.twm-form-card .woocommerce-input-wrapper {
    display: block;
    width: 100%;
}

.twm-form-card input[type="text"],
.twm-form-card input[type="email"],
.twm-form-card input[type="password"],
.twm-form-card input[type="tel"],
.twm-form-card input[type="number"],
.twm-form-card select,
.twm-form-card textarea {
    display: block;
    width: 100%;
    background: #f8f8f8;
    border: 1.5px solid var(--twm-color-border);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--twm-color-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.twm-form-card input:focus,
.twm-form-card select:focus,
.twm-form-card textarea:focus {
    border-color: var(--twm-color-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
    background: #fff;
}

/* Select2 (selects de pais/provincia de WooCommerce) consistente con los inputs. */
.twm-form-card .select2-container {
    width: 100% !important;
}

.twm-form-card .select2-container--default .select2-selection--single {
    height: auto;
    min-height: 0;
    background: #f8f8f8;
    border: 1.5px solid var(--twm-color-border);
    border-radius: 12px;
    padding: 0.35rem 0.5rem;
}

.twm-form-card .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.7;
    padding-left: 0.5rem;
    color: var(--twm-color-text);
}

.twm-form-card .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 0.5rem;
}

.twm-form-card .woocommerce-Button,
.twm-form-card button.woocommerce-Button {
    justify-self: start;
    border-radius: 999px;
    background: var(--twm-color-primary);
    color: #fff;
    padding: 0.75rem 2rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.twm-form-card .woocommerce-Button:hover {
    opacity: 0.9;
}

.twm-form-card fieldset {
    display: grid;
    gap: 1.1rem;
    border: 1px solid var(--twm-color-border);
    border-radius: 16px;
    padding: 1.25rem;
    margin: 0;
}

.twm-form-card legend {
    font-weight: 600;
    padding: 0;
    margin-bottom: 0.25rem;
}

.twm-activity {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--twm-color-border);
}

.twm-activity h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--twm-color-text);
}

.twm-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.twm-activity-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.twm-activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--twm-color-primary);
    margin-top: 0.45rem;
    flex-shrink: 0;
}

.twm-activity-text {
    margin: 0;
    color: var(--twm-color-text);
    font-size: 0.95rem;
}

.twm-activity-time {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--twm-color-muted);
}

.twm-activity-empty {
    margin: 0;
    color: var(--twm-color-muted);
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .twm-myaccount-header {
        display: block;
        padding-top: 0;
    }

    .twm-header-text {
        max-width: 100%;
    }

    .twm-actions {
        position: static;
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .twm-avatar-wrap {
        order: -1;
    }

    .twm-orders-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .twm-orders-table td {
        font-size: 0.85rem;
    }
}

.twm-card-image-icon {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
    display: block;
}

/* Membership Directory */
.twm-membership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.twm-membership-card {
    background: #fff;
    border-radius: 20px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--twm-color-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--twm-color-border);
}

.twm-membership-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--twm-color-primary);
}

.twm-membership-card .twm-card-icon {
    width: 60px;
    height: 60px;
    background: var(--twm-color-primary-soft);
    color: var(--twm-color-primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.25rem;
}

.twm-membership-card .twm-card-content h3 {
    margin: 0 0 1.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--twm-color-text);
}

.twm-btn-outline {
    background: transparent;
    border: 1.5px solid var(--twm-color-primary);
    color: var(--twm-color-primary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.45rem 1.25rem;
}

.twm-membership-card:hover .twm-btn-outline {
    background: var(--twm-color-primary);
    color: #fff;
}

.twm-empty-state .dashicons-lock {
    font-size: 3rem;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    color: var(--twm-color-primary-soft);
}

.twm-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--twm-color-border);
}

.twm-selection-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--twm-color-primary);
}

.twm-btn-sm {
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
}

/* Compare Page Full Width Override */
.twm-myaccount-card.twm-is-compare {
    max-width: 100%;
}

.twm-is-compare .twm-myaccount-content {
    overflow-x: auto;
    width: 100%;
    /* Ensure scrollbar is visible and usable */
    padding-bottom: 1rem;
}

/* Ensure the table has enough width to trigger scroll on smaller screens if native styles don't force it */
.twm-is-compare table.xstore-compare-table {
    min-width: 100%;
    /* Ensure table doesn't get squashed */
    width: max-content;
    max-width: none;
    border-collapse: separate;
    /* Required for sticky positioning */
    border-spacing: 0;
}

/* Product Column Widths & Compactness */
.twm-is-compare .xstore-compare-table td {
    min-width: 220px;
    /* Constrain width */
    max-width: 220px;
    /* Force wrap */
    padding: 0.75rem 1rem !important;
    /* Reduce padding */
    vertical-align: top;
    /* Better alignment for wrapping text */
    white-space: normal !important;
    /* Force wrap */
}

.twm-is-compare .xstore-compare-table td:first-child {
    min-width: 140px;
    max-width: 140px;
}

/* Optimize Image Size */
.twm-is-compare .xstore-compare-image img {
    max-width: 120px !important;
    /* Slightly smaller */
    width: auto !important;
    height: auto !important;
    margin: 0 auto 0.5rem;
    display: block;
}

/* Compact Text Styles */
.twm-is-compare .xstore-compare-title .product-title {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.5rem !important;
    display: block;
    white-space: normal !important;
    /* Ensure title wraps */
    overflow-wrap: break-word;
}

.twm-is-compare .xstore-compare-price {
    font-weight: 700;
    color: var(--twm-color-primary);
    padding-bottom: 0.5rem !important;
}

.twm-is-compare .xstore-compare-excerpt {
    font-size: 0.85rem !important;
    color: var(--twm-color-muted);
    line-height: 1.4 !important;
    white-space: normal !important;
    /* Ensure excerpt wraps */
}

.twm-is-compare .xstore-compare-stock_status {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

/* Compact Quantity Selector */
.twm-is-compare .quantity-wrapper {
    transform: scale(0.9);
    transform-origin: center top;
    margin-bottom: 0.5rem;
}

/* ============================
   Modo Menú Horizontal
   ============================ */
.twm-layout-horizontal .twm-card-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0;
    padding-bottom: 4px;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    border-bottom: 1.5px solid var(--twm-color-border, #e5e7eb);
    background: transparent;
    /* Centra cuando pocos items; scroll cuando desbordan */
    justify-content: safe center;
}

.twm-layout-horizontal .twm-card-grid::-webkit-scrollbar {
    display: none;
}

.twm-layout-horizontal .twm-dashboard-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    min-width: 100px;
    max-width: 120px;
    flex: 0 0 auto;
    padding: 0.75rem 0.6rem 0.85rem;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    gap: 0.4rem;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: var(--twm-color-text);
    transition: color 0.18s ease;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    /* Align bottom border with container border */
}

.twm-layout-horizontal .twm-dashboard-card:hover {
    color: var(--twm-color-primary);
    border-bottom-color: var(--twm-color-primary);
    background: transparent;
    box-shadow: none;
    transform: none;
}

.twm-layout-horizontal .twm-card-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--twm-color-icon-bg, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.18s ease;
}

.twm-layout-horizontal .twm-dashboard-card:hover .twm-card-icon-wrap {
    background: color-mix(in srgb, var(--twm-color-primary) 12%, white);
}

.twm-layout-horizontal .twm-card-icon-wrap .dashicons,
.twm-layout-horizontal .twm-card-icon-wrap img,
.twm-layout-horizontal .twm-card-icon-wrap svg {
    font-size: 1.2rem;
    width: 1.2rem;
    height: 1.2rem;
    color: var(--twm-color-icon);
}

.twm-layout-horizontal .twm-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.twm-layout-horizontal .twm-card-title {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    color: inherit;
    text-align: center;
}

.twm-layout-horizontal .twm-card-subtitle {
    font-size: 0.7rem;
    color: var(--twm-color-muted, #888);
    line-height: 1.2;
    text-align: center;
}

.twm-layout-horizontal .twm-card-arrow {
    display: none;
}

/* Activity section: mantiene su diseño normal debajo de la barra */
.twm-layout-horizontal .twm-activity {
    margin-top: 1.5rem;
    border-top: none;
}

/* ============================
   Panel Inline (contenido bajo las cards)
   ============================ */

/* La card activa */
.twm-dashboard-card.twm-card-active {
    border: 2px solid var(--twm-color-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    background: color-mix(in srgb, var(--twm-color-primary) 6%, var(--twm-color-card-bg));
}

/* En layout horizontal: el tab activo usa subrayado en lugar de borde */
.twm-layout-horizontal .twm-dashboard-card.twm-card-active {
    border: none;
    box-shadow: none;
    background: transparent;
    color: var(--twm-color-primary);
    border-bottom: 2.5px solid var(--twm-color-primary);
}

.twm-layout-horizontal .twm-dashboard-card.twm-card-active .twm-card-title {
    color: var(--twm-color-primary);
}

/* El botón-card por defecto */
.twm-dashboard-card[type="button"] {
    border: 2px solid transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

/* Panel inline contenedor — fuera del max-width del .twm-myaccount-card  */
.twm-inline-panel {
    width: 100%;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* padding 0 para no añadir márgenes extra; el contenido ya trae los suyos */
    padding: 0;
}

.twm-inline-panel.twm-panel-open {
    opacity: 1;
    transform: translateY(0);
}

/* Spinner de carga */
.twm-panel-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.twm-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid var(--twm-color-border);
    border-top-color: var(--twm-color-primary);
    border-radius: 50%;
    animation: twm-spin 0.75s linear infinite;
}

@keyframes twm-spin {
    to {
        transform: rotate(360deg);
    }
}