/* ── Estado "solicitado" del botón de traducción (vive en hmtheme) ─────── */
body #product .hkp-action-row .hkp-action-translate--done,
body[id^="product"] .hkp-action-row .hkp-action-translate--done {
    border-color: var(--hk-accent, #8A4A4A) !important;
    background: var(--hk-cream, #FBF6EF) !important;
}

body #product .hkp-action-row .hkp-action-translate--done span,
body[id^="product"] .hkp-action-row .hkp-action-translate--done span,
body #product .hkp-action-row .hkp-action-translate--done svg,
body[id^="product"] .hkp-action-row .hkp-action-translate--done svg {
    color: var(--hk-accent, #8A4A4A) !important;
}

/* ── Overlay ─────────────────────────────────────────────────────────── */
.hmtr-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
}

.hmtr-overlay--open {
    display: block;
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.hmtr-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: #fff;
    border-radius: 8px;
    padding: 1.75rem 2rem;
    width: 92%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.hmtr-modal--open {
    display: block;
}

.hmtr-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.875rem;
}

.hmtr-modal__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: var(--hk-ink, #3A2C28);
}

.hmtr-modal__close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
    margin-top: -0.125rem;
}

.hmtr-modal__close:hover {
    color: var(--hk-ink, #3A2C28);
}

.hmtr-modal__intro {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1.25rem;
    line-height: 1.55;
}

/* ── Formulario ──────────────────────────────────────────────────────── */
.hmtr-form__group {
    margin-bottom: 1rem;
}

.hmtr-form__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--hk-ink, #3A2C28);
}

.hmtr-form__label abbr {
    text-decoration: none;
    color: var(--hk-accent, #8A4A4A);
}

.hmtr-form__select,
.hmtr-form__input,
.hmtr-form__textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.hmtr-form__select:focus,
.hmtr-form__input:focus,
.hmtr-form__textarea:focus {
    outline: none;
    border-color: var(--hk-accent, #8A4A4A);
}

.hmtr-form__textarea {
    min-height: 120px;
    resize: vertical;
}

.hmtr-form__hint {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.3rem;
    margin-bottom: 0;
}

.hmtr-form__error {
    display: none;
    color: var(--hk-accent, #8A4A4A);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--hk-cream, #FBF6EF);
    border-radius: 4px;
    border-left: 3px solid var(--hk-accent, #8A4A4A);
}

/* ── Footer del modal ────────────────────────────────────────────────── */
.hmtr-modal__footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    justify-content: flex-end;
}

.hmtr-modal__cancel {
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: #555;
    font-family: inherit;
}

.hmtr-modal__cancel:hover {
    background: #f5f5f5;
}

.hmtr-modal__submit {
    padding: 0.5rem 1.5rem;
    background: var(--hk-accent, #8A4A4A);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    transition: opacity 0.15s;
}

.hmtr-modal__submit:hover {
    opacity: 0.88;
}

.hmtr-modal__submit:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ── Aviso del boceto (dentro del modal de la ficha) ─────────────────── */
.hmtr-modal__notice {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 1.25rem;
    padding: 0.75rem 0.875rem;
    background: var(--hk-cream, #FBF6EF);
    border-left: 3px solid var(--hk-accent, #8A4A4A);
    border-radius: 4px;
}

.hmtr-modal__notice-icon {
    flex-shrink: 0;
    color: var(--hk-accent, #8A4A4A);
    line-height: 0;
    margin-top: 1px;
}

.hmtr-modal__notice-text {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--hk-ink, #3A2C28);
}

/* ── Enlace "Ver traducción" en carrito / checkout ───────────────────── */
.hmtr-cart-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--hk-accent, #8A4A4A);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.hmtr-cart-link:hover,
.hmtr-cart-link:focus {
    color: var(--hk-accent, #8A4A4A);
    text-decoration: underline;
}

.hmtr-cart-link svg {
    flex-shrink: 0;
}

/* ── Modal read-only de consulta (Bootstrap) ─────────────────────────── */
.hmtr-view-modal .modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hk-ink, #3A2C28);
}

.hmtr-view-lang {
    font-size: 0.875rem;
    color: var(--hk-ink, #3A2C28);
    margin-bottom: 0.625rem;
}

.hmtr-view-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #333;
    background: var(--hk-cream, #FBF6EF);
    border-radius: 4px;
    padding: 0.875rem 1rem;
}

.hmtr-view-hint {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* ── Aviso "tiene traducción" en el detalle del pedido (Mi cuenta) ────── */
.hmtr-order-note {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--hk-cream, #FBF6EF);
    border-left: 3px solid var(--hk-accent, #8A4A4A);
    border-radius: 4px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--hk-ink, #3A2C28);
    word-break: break-word;
}

.hmtr-order-note svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--hk-accent, #8A4A4A);
}

.hmtr-order-note strong {
    color: var(--hk-accent, #8A4A4A);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .hmtr-modal {
        padding: 1.25rem;
    }

    .hmtr-modal__footer {
        flex-direction: column-reverse;
    }

    .hmtr-modal__cancel,
    .hmtr-modal__submit {
        width: 100%;
        text-align: center;
    }
}


/* -- PRUEBA PILOTO: pills de idioma + vista previa + confirmacion ------ */
.hmtr-lang-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.hmtr-lang-pill {
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--hk-ink-2, #6B5852);
    background: var(--hk-cream, #FBF6EF);
    border: 1px solid #E3D8CC;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.hmtr-lang-pill:hover {
    border-color: var(--hk-accent, #8A4A4A);
    color: var(--hk-ink, #3A2C28);
}

.hmtr-lang-pill--active {
    background: var(--hk-accent, #8A4A4A);
    border-color: var(--hk-accent, #8A4A4A);
    color: #fff;
}

.hmtr-info-note {
    display: none;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.8rem;
    background: var(--hk-paper, #F5EAE2);
    border-radius: 6px;
    font-size: 0.78125rem;
    line-height: 1.5;
    color: var(--hk-ink-2, #6B5852);
}

.hmtr-info-note__icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--hk-sage-dk, #6F8568);
    line-height: 0;
}

.hmtr-info-note strong {
    color: var(--hk-ink, #3A2C28);
}

.hmtr-preview-box {
    display: none;
    margin-bottom: 1rem;
    padding: 0.75rem 0.875rem;
    background: var(--hk-cream, #FBF6EF);
    border: 1px solid #E3D8CC;
    border-radius: 6px;
}

.hmtr-preview-box__label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hk-sage-dk, #6F8568);
    margin-bottom: 0.4rem;
}

.hmtr-preview-box__text {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--hk-ink, #3A2C28);
    white-space: pre-wrap;
}

.hmtr-confirm-row {
    display: none;
    align-items: flex-start;
    gap: 0.5rem;
    margin: -0.4rem 0 1rem;
    font-size: 0.8125rem;
    color: var(--hk-ink-2, #6B5852);
    cursor: pointer;
}

.hmtr-confirm-row input {
    margin-top: 0.2rem;
    accent-color: var(--hk-accent, #8A4A4A);
    flex-shrink: 0;
}
