/* tm-offers — Mi Cuenta CSS */
:root {
    --tm-green:          #5CB82E;
    --tm-green-light:    #EAF6DF;
    --tm-dark:           #0A0A0A;
    --tm-orange:         #E8600A;
    --tm-blue:           #1A56A0;
    --tm-gray-bg:        #F4F4F2;
    --tm-gray-border:    #E0E0E0;
    --tm-gray-text:      #666666;
    --tm-white:          #FFFFFF;
    --tm-radius:         8px;
    --tm-radius-sm:      4px;
    --tm-shadow:         0 1px 3px rgba(0,0,0,.08);
    --tm-font:           'Barlow', 'Arial', sans-serif;
    --tm-nav-width:      260px;
}

/* ── Layout wrapper ─────────────────────────────────────────── */
.tm-account-wrapper {
    display: grid;
    grid-template-columns: var(--tm-nav-width) 1fr;
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: var(--tm-font);
    align-items: start;
}

/* ── Navegación lateral ─────────────────────────────────────── */
.tm-account-nav {
    background: var(--tm-white);
    border: 1px solid var(--tm-gray-border);
    border-radius: var(--tm-radius);
    overflow: hidden;
    position: sticky;
    top: 24px;
}

.tm-account-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--tm-gray-border);
    background: var(--tm-dark);
}

.tm-account-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50%;
    flex-shrink: 0;
}

.tm-account-user-info {
    overflow: hidden;
}

.tm-account-user-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--tm-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tm-account-user-email {
    display: block;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toggle móvil — oculto en desktop */
.tm-account-nav-toggle { display: none; }

/* Menú */
.tm-account-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.tm-account-menu-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tm-dark);
    text-decoration: none;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}

.tm-account-menu-item a:hover {
    background: var(--tm-gray-bg);
    color: var(--tm-green);
}

.tm-account-menu-item.is-active a,
.tm-account-menu-item.woocommerce-MyAccount-navigation-link--active a {
    background: var(--tm-green-light);
    color: var(--tm-green);
    border-left-color: var(--tm-green);
    font-weight: 700;
}

.tm-menu-icon {
    display: flex;
    align-items: center;
    opacity: .6;
    flex-shrink: 0;
}

.tm-account-menu-item.is-active .tm-menu-icon,
.tm-account-menu-item.woocommerce-MyAccount-navigation-link--active .tm-menu-icon {
    opacity: 1;
}

.tm-menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tm-orange);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 4px;
    margin-left: auto;
}

/* Logout */
.tm-account-menu-item:last-child {
    border-top: 1px solid var(--tm-gray-border);
    margin-top: 4px;
    padding-top: 4px;
}

.tm-account-menu-item:last-child a {
    color: var(--tm-gray-text);
    font-size: 13px;
}

/* ── Contenido ──────────────────────────────────────────────── */
.tm-account-content {
    min-width: 0;
}

/* ── Header de pestaña ──────────────────────────────────────── */
.tm-tab-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--tm-gray-border);
}

.tm-tab-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--tm-dark);
    margin: 0 0 6px;
}

.tm-tab-subtitle {
    font-size: 14px;
    color: var(--tm-gray-text);
    margin: 0;
}

/* ── Formularios ────────────────────────────────────────────── */
.tm-form-section {
    background: var(--tm-white);
    border: 1px solid var(--tm-gray-border);
    border-radius: var(--tm-radius);
    padding: 24px;
    margin-bottom: 20px;
}

.tm-form-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--tm-dark);
    margin: 0 0 4px;
}

.tm-form-section-desc {
    font-size: 13px;
    color: var(--tm-gray-text);
    margin: 0 0 20px;
}

.tm-form-row { margin-bottom: 16px; }
.tm-form-row--two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tm-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.tm-field input[type="text"],
.tm-field input[type="email"],
.tm-field input[type="tel"],
.tm-field input[type="password"],
.tm-field input[type="number"],
.tm-field textarea,
.tm-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tm-gray-border);
    border-radius: var(--tm-radius-sm);
    font-size: 14px;
    font-family: var(--tm-font);
    background: var(--tm-white);
    box-sizing: border-box;
    transition: border-color .15s;
    color: var(--tm-dark);
}

.tm-field input:focus,
.tm-field textarea:focus {
    outline: none;
    border-color: var(--tm-green);
    box-shadow: 0 0 0 3px rgba(92,184,46,.12);
}

.tm-required { color: var(--tm-orange); }

.tm-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

/* ── Botones ────────────────────────────────────────────────── */
.tm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 24px;
    border-radius: var(--tm-radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity .15s, transform .1s;
    font-family: var(--tm-font);
    line-height: 1;
}

.tm-btn:hover { opacity: .88; transform: translateY(-1px); }
.tm-btn:active { transform: translateY(0); }

.tm-btn-primary {
    background: var(--tm-green);
    color: #fff !important;
}

.tm-btn-dark {
    background: var(--tm-dark);
    color: #fff !important;
}

.tm-btn-link {
    background: none;
    border: none;
    color: var(--tm-green);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-family: var(--tm-font);
}

/* ── Preferencias de comunicación ───────────────────────────── */
.tm-comm-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tm-comm-option {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
}

.tm-comm-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tm-comm-option-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid var(--tm-gray-border);
    border-radius: var(--tm-radius-sm);
    width: 100%;
    transition: border-color .15s, background .15s;
}

.tm-comm-option input:checked + .tm-comm-option-content {
    border-color: var(--tm-green);
    background: var(--tm-green-light);
}

.tm-comm-option-icon { font-size: 22px; }

.tm-comm-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tm-comm-option-text strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--tm-dark);
}

.tm-comm-option-text small {
    font-size: 12px;
    color: var(--tm-gray-text);
}

/* ── Intereses ──────────────────────────────────────────────── */
.tm-interests-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

.tm-interests-separator { color: var(--tm-gray-border); }

.tm-interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.tm-interest-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid var(--tm-gray-border);
    border-radius: var(--tm-radius);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
    background: var(--tm-white);
}

.tm-interest-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tm-interest-card.is-checked,
.tm-interest-card:has(input:checked) {
    border-color: var(--tm-green);
    background: var(--tm-green-light);
}

.tm-interest-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--tm-radius-sm);
}

.tm-interest-thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tm-gray-bg);
    border-radius: var(--tm-radius-sm);
    color: var(--tm-gray-text);
}

.tm-interest-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--tm-dark);
    line-height: 1.3;
}

.tm-interest-count {
    font-size: 11px;
    color: var(--tm-gray-text);
}

.tm-interest-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--tm-green);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s;
}

.tm-interest-card.is-checked .tm-interest-check,
.tm-interest-card:has(input:checked) .tm-interest-check {
    opacity: 1;
}

/* ── Tarjetas de oferta ─────────────────────────────────────── */
.tm-offers-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tm-offer-card {
    display: flex;
    gap: 16px;
    background: var(--tm-white);
    border: 1px solid var(--tm-gray-border);
    border-radius: var(--tm-radius);
    overflow: hidden;
    transition: box-shadow .15s;
}

.tm-offer-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.tm-offer-card__image {
    flex-shrink: 0;
    width: 120px;
}

.tm-offer-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tm-offer-card__body {
    flex: 1;
    padding: 16px 16px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.tm-offer-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tm-offer-card__product {
    font-size: 15px;
    font-weight: 700;
    color: var(--tm-dark);
    text-decoration: none;
}

.tm-offer-card__product:hover { color: var(--tm-green); }

.tm-offer-card__prices {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tm-offer-card__price-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tm-offer-card__price-label {
    font-size: 11px;
    color: var(--tm-gray-text);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.tm-offer-card__price-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--tm-dark);
}

.tm-price-original { text-decoration: line-through; color: var(--tm-gray-text); font-weight: 400; }
.tm-price-counter  { color: var(--tm-blue); }
.tm-discount-pct   { font-size: 12px; color: var(--tm-orange); font-weight: 600; }

.tm-offer-card__note {
    font-size: 13px;
    color: #555;
    background: var(--tm-gray-bg);
    border-left: 3px solid var(--tm-gray-border);
    padding: 8px 12px;
    border-radius: 0 var(--tm-radius-sm) var(--tm-radius-sm) 0;
}

.tm-offer-card__expiry {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--tm-orange);
    background: #FFF3CD;
    padding: 8px 12px;
    border-radius: var(--tm-radius-sm);
}

.tm-offer-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--tm-gray-border);
}

.tm-offer-card__date {
    font-size: 12px;
    color: var(--tm-gray-text);
}

/* ── Badges ─────────────────────────────────────────────────── */
.tm-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tm-badge--pending    { background: #FFF3CD; color: #856404; }
.tm-badge--accepted   { background: var(--tm-green-light); color: #2d6e0f; }
.tm-badge--rejected   { background: #F4F4F2; color: #666; }
.tm-badge--countered  { background: #E8F0FB; color: var(--tm-blue); }
.tm-badge--expired    { background: #FEE; color: #c00; }
.tm-badge--formalized { background: var(--tm-dark); color: #fff; }

/* ── Feedback ────────────────────────────────────────────────── */
.tm-feedback {
    padding: 12px 16px;
    border-radius: var(--tm-radius-sm);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.tm-feedback.tm-success { background: var(--tm-green-light); border: 1px solid var(--tm-green); color: #2d6e0f; }
.tm-feedback.tm-error   { background: #FFF0EE; border: 1px solid #e04040; color: #c00; }

/* ── Estado vacío ────────────────────────────────────────────── */
.tm-empty-state-box {
    text-align: center;
    padding: 48px 24px;
    background: var(--tm-white);
    border: 1px solid var(--tm-gray-border);
    border-radius: var(--tm-radius);
}

.tm-empty-icon { font-size: 48px; margin-bottom: 16px; }

.tm-empty-state-box h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--tm-dark);
    margin: 0 0 8px;
}

.tm-empty-state-box p {
    font-size: 14px;
    color: var(--tm-gray-text);
    margin: 0 0 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Paginación ──────────────────────────────────────────────── */
.tm-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
}

.tm-pagination__item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--tm-gray-border);
    border-radius: var(--tm-radius-sm);
    font-size: 14px;
    color: var(--tm-dark);
    text-decoration: none;
    transition: all .15s;
}

.tm-pagination__item:hover,
.tm-pagination__item.is-active {
    background: var(--tm-green);
    border-color: var(--tm-green);
    color: #fff;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {

    .tm-account-wrapper {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }

    .tm-account-nav {
        position: static;
    }

    /* Ocultar info de usuario en móvil (está en el toggle) */
    .tm-account-user { display: none; }

    /* Mostrar toggle */
    .tm-account-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 16px;
        background: var(--tm-dark);
        color: #fff;
        border: none;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        font-family: var(--tm-font);
    }

    .tm-account-menu {
        display: none;
        border-top: 1px solid var(--tm-gray-border);
    }

    .tm-account-menu.is-open { display: block; }

    /* Formularios en una columna */
    .tm-form-row--two { grid-template-columns: 1fr; }

    /* Tarjetas de oferta en móvil */
    .tm-offer-card { flex-direction: column; }
    .tm-offer-card__image { width: 100%; height: 180px; }
    .tm-offer-card__body { padding: 16px; }

    /* Intereses en 2 columnas */
    .tm-interests-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .tm-interests-grid { grid-template-columns: 1fr 1fr; }
    .tm-offer-card__prices { flex-direction: column; gap: 8px; }
}

/* ── Intereses — lista horizontal ───────────────────────────── */
.tm-interests-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--tm-gray-border);
    border-radius: var(--tm-radius);
    overflow: hidden;
    margin-top: 16px;
}

.tm-interest-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--tm-gray-border);
    background: var(--tm-white);
    transition: background .12s;
}

.tm-interest-row:last-child { border-bottom: none; }
.tm-interest-row:hover { background: var(--tm-gray-bg); }
.tm-interest-row.is-checked { background: var(--tm-green-light); }

.tm-interest-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Icono / miniatura */
.tm-interest-row__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--tm-radius-sm);
    background: var(--tm-gray-bg);
    flex-shrink: 0;
    color: var(--tm-gray-text);
    overflow: hidden;
}

.tm-interest-row__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tm-interest-row.is-checked .tm-interest-row__thumb {
    background: rgba(92,184,46,.15);
    color: var(--tm-green);
}

/* Texto */
.tm-interest-row__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tm-interest-row__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--tm-dark);
}

.tm-interest-row__count {
    font-size: 12px;
    color: var(--tm-gray-text);
}

/* Toggle switch */
.tm-interest-row__toggle {
    flex-shrink: 0;
}

.tm-interest-row__toggle-track {
    display: flex;
    align-items: center;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--tm-gray-border);
    padding: 2px;
    transition: background .2s;
}

.tm-interest-row.is-checked .tm-interest-row__toggle-track {
    background: var(--tm-green);
}

.tm-interest-row__toggle-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tm-white);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
    transform: translateX(0);
}

.tm-interest-row.is-checked .tm-interest-row__toggle-thumb {
    transform: translateX(20px);
}

/* ── Acciones de notificación ───────────────────────────────── */
.tm-notif-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tm-btn-link--danger { color: #cc4444 !important; }

.tm-notif-item__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s;
}

.tm-notif-item:hover .tm-notif-item__actions { opacity: 1; }

.tm-notif-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--tm-gray-border);
    background: var(--tm-white);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .12s;
    color: #555;
}

.tm-notif-mark-read:hover { background: var(--tm-green-light); border-color: var(--tm-green); color: var(--tm-green); }
.tm-notif-delete:hover    { background: #FEE; border-color: #e04040; color: #c00; }

/* ── Respuesta a contraoferta ───────────────────────────────── */
.tm-counter-respond {
    margin-top: 8px;
}

.tm-toggle-respond {
    font-size: 13px;
    color: var(--tm-blue) !important;
}

.tm-respond-form {
    margin-top: 12px;
}

.tm-respond-form__inner {
    background: var(--tm-gray-bg);
    border: 1px solid var(--tm-gray-border);
    border-radius: var(--tm-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tm-respond-divider {
    font-size: 12px;
    color: var(--tm-gray-text);
    text-align: center;
    position: relative;
}

.tm-respond-divider::before,
.tm-respond-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--tm-gray-border);
}

.tm-respond-divider::before { left: 0; }
.tm-respond-divider::after  { right: 0; }

.tm-respond-price-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tm-new-offer-message {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tm-gray-border);
    border-radius: var(--tm-radius-sm);
    font-size: 13px;
    font-family: var(--tm-font);
    resize: vertical;
    box-sizing: border-box;
}

.tm-new-offer-message:focus {
    outline: none;
    border-color: var(--tm-green);
}

.tm-respond-feedback {
    padding: 8px 12px;
    border-radius: var(--tm-radius-sm);
    font-size: 13px;
    font-weight: 600;
}
