/**
 * Mecha Shipping Calculator - Modal Styles
 * Multi-contexto, diferenciado logueado/invitado
 *
 * @package MechaShipping
 * @since 1.0.0
 */

/* ========================================
   VARIABLES
   ======================================== */
:root {
    --mecha-primary: #6017b1;
    --mecha-primary-hover: #4c1290;
    --mecha-success: #00a650;
    --mecha-success-light: #e8f8ef;
    --mecha-warning: #FFD700;

    --mecha-white: #ffffff;
    --mecha-gray-50: #fafafa;
    --mecha-gray-100: #f5f5f5;
    --mecha-gray-200: #e5e5e5;
    --mecha-gray-300: #d4d4d4;
    --mecha-gray-400: #a3a3a3;
    --mecha-gray-500: #737373;
    --mecha-gray-600: #525252;
    --mecha-gray-700: #404040;
    --mecha-gray-800: #262626;

    --mecha-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --mecha-radius: 8px;
    --mecha-radius-sm: 4px;
    --mecha-transition: 150ms ease;

    --mecha-z-modal: 100000;
    /* Ajustado para ser alto */
    --mecha-z-overlay: 99999;
    /* Justo debajo del modal */
}

/* Utilidad */
.mecha-hidden {
    display: none !important;
}

/* ========================================
   OVERLAY
   ======================================== */
.mecha-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: var(--mecha-z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--mecha-transition), visibility var(--mecha-transition);
}

.mecha-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   MODAL
   ======================================== */
.mecha-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.97);
    width: 94%;
    max-width: 420px;
    max-height: 90vh;
    background: var(--mecha-white);
    border-radius: var(--mecha-radius);
    box-shadow: var(--mecha-shadow);
    z-index: var(--mecha-z-modal);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mecha-modal.is-active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* ====== Bottom sheet en móvil ====== */
@media (max-width: 640px) {
    .mecha-modal {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    }
    .mecha-modal.is-active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    /* Handle visual para el bottom sheet */
    .mecha-modal::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--mecha-gray-200);
        border-radius: 2px;
        margin: 10px auto 4px;
        flex-shrink: 0;
    }
}

/* ========================================
   HEADER
   ======================================== */
.mecha-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--mecha-gray-200);
}

.mecha-header__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--mecha-gray-800);
    margin: 0;
}

.mecha-close {
    background: none;
    border: none;
    color: var(--mecha-gray-400);
    padding: 4px;
    cursor: pointer;
}

.mecha-close:hover {
    color: var(--mecha-gray-600);
}

/* ========================================
   BODY
   ======================================== */
.mecha-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.mecha-step {
    display: block;
}

.mecha-step.mecha-hidden {
    display: none;
}

.mecha-subtitle {
    font-size: 13px;
    color: var(--mecha-gray-700);
    margin: 0 0 16px;
    line-height: 1.4;
}

.mecha-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--mecha-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0 0 10px;
}

/* ========================================
   DIRECCIONES GUARDADAS
   ======================================== */
.mecha-address-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.mecha-address-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--mecha-white);
    border: 1px solid var(--mecha-gray-200);
    border-radius: var(--mecha-radius-sm);
    padding: 0;
    transition: border-color var(--mecha-transition);
}

.mecha-address-row:hover {
    border-color: var(--mecha-gray-300);
}

.mecha-address-row:has(.mecha-address-item__radio:checked) {
    border-color: var(--mecha-primary);
    background: rgba(96, 23, 177, 0.02);
}

.mecha-address-item {
    flex: 1;
    /* Ocupa todo el espacio menos el botón */
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
    background: transparent;
    border: none;
    margin: 0;
}

/* Remover border hover original que ahora maneja el row */
.mecha-address-item:hover {
    border-color: transparent;
}

/* Mover estilo seleccionado al row padre en lugar del label */
.mecha-address-item:has(.mecha-address-item__radio:checked) {
    border-color: transparent;
    background: transparent;
}

.mecha-address-item__radio {
    margin: 2px 0 0;
    accent-color: var(--mecha-primary);
}

.mecha-address-item__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mecha-address-item__alias {
    font-size: 14px;
    font-weight: 600;
    color: var(--mecha-gray-700);
}

.mecha-address-item__detail {
    font-size: 13px;
    color: var(--mecha-gray-500);
}

.mecha-address-item__delete {
    position: relative;
    /* Ya no absoluto */
    top: auto;
    right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin-right: 4px;
    /* Espacio del borde derecho */
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--mecha-gray-400);
    cursor: pointer;
    transition: all 0.2s;
}

.mecha-address-item__delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ========================================
   CAMPOS DEL FORMULARIO
   ======================================== */
.mecha-field {
    margin-bottom: 12px;
}

.mecha-field:last-child {
    margin-bottom: 0;
}

.mecha-field__label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--mecha-gray-800);
}

.mecha-field__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--mecha-gray-200);
    border-radius: var(--mecha-radius-sm);
    font-size: 14px;
    transition: all var(--mecha-transition);
    outline: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    /* Prevenir zoom automático en iOS Safari al enfocar campos */
    .mecha-field__input,
    .mecha-field__input--large {
        font-size: 16px !important;
        padding: 12px 14px;
    }
}

.mecha-field__input:focus {
    border-color: var(--mecha-primary);
    box-shadow: 0 0 0 3px rgba(96, 23, 177, 0.1);
}

.mecha-field__input::placeholder {
    color: var(--mecha-gray-500);
}

/* Input wrapper for autocomplete */
.mecha-input-wrapper {
    position: relative;
    width: 100%;
}

/* Dropdown */
.mecha-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--mecha-white);
    border: 1px solid var(--mecha-gray-200);
    border-radius: var(--mecha-radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 180px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.mecha-dropdown.is-active {
    display: block;
}

.mecha-dropdown__item {
    padding: 10px 12px;
    font-size: 14px;
    color: var(--mecha-gray-700);
    cursor: pointer;
    border-bottom: 1px solid var(--mecha-gray-100);
}

.mecha-dropdown__item:last-child {
    border-bottom: none;
}

.mecha-dropdown__item:hover {
    background: var(--mecha-gray-50);
}

.mecha-dropdown__empty {
    padding: 14px;
    text-align: center;
    color: var(--mecha-gray-400);
    font-size: 13px;
}

/* ========================================
   BOTONES
   ======================================== */
.mecha-actions {
    margin-top: 16px;
}

.mecha-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--mecha-radius-sm);
    cursor: pointer;
    border: none;
    transition: background var(--mecha-transition);
}

.mecha-btn--primary {
    background: var(--mecha-gray-200);
    color: var(--mecha-gray-400);
}

.mecha-btn--primary:not(:disabled) {
    background: var(--mecha-primary);
    color: var(--mecha-white);
}

.mecha-btn--primary:not(:disabled):hover {
    background: var(--mecha-primary-hover);
}

.mecha-btn--primary:disabled {
    cursor: not-allowed;
}

.mecha-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--mecha-primary);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 0;
    cursor: pointer;
}

.mecha-link:hover {
    text-decoration: underline;
}

.mecha-link--center {
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}

/* Botón Agregar Dirección (Destacado) */
.mecha-btn-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: 1px dashed var(--mecha-primary);
    border-radius: var(--mecha-radius-sm);
    color: var(--mecha-primary);
    background: rgba(96, 23, 177, 0.04);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mecha-btn-add:hover {
    background: rgba(96, 23, 177, 0.08);
    border-style: solid;
}

.mecha-btn-add svg {
    stroke-width: 2.5;
}

/* Empty State */
.mecha-empty-addresses {
    text-align: center;
    padding: 28px 16px;
    border: 1px solid var(--mecha-gray-200);
    border-radius: var(--mecha-radius-sm);
    background: var(--mecha-gray-50);
    color: var(--mecha-gray-500);
    font-size: 14px;
    margin-bottom: 10px;
}

.mecha-empty-addresses__icon {
    display: block;
    margin: 0 auto 12px;
    width: 40px;
    height: 40px;
    opacity: 0.35;
}

.mecha-empty-addresses__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--mecha-gray-700);
    margin: 0 0 6px;
}

.mecha-empty-addresses__text {
    font-size: 13px;
    color: var(--mecha-gray-400);
    margin: 0;
    line-height: 1.5;
}

.mecha-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--mecha-gray-500);
    font-size: 13px;
    padding: 0;
    margin-bottom: 14px;
    cursor: pointer;
}

.mecha-back:hover {
    color: var(--mecha-gray-700);
}

.mecha-hint {
    font-size: 12px;
    color: var(--mecha-gray-700);
    margin: 10px 0 0;
}

.mecha-hint a {
    color: var(--mecha-primary);
    text-decoration: none;
}

.mecha-hint a:hover {
    text-decoration: underline;
}

/* ========================================
   LOADING
   ======================================== */
.mecha-loading {
    padding: 40px 20px;
    text-align: center;
}

.mecha-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--mecha-gray-200);
    border-top-color: var(--mecha-primary);
    border-radius: 50%;
    animation: mecha-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

.mecha-loading p {
    color: var(--mecha-gray-500);
    font-size: 13px;
    margin: 0;
}

/* ========================================
   RESULTADOS
   ======================================== */
.mecha-eta-card {
    background: var(--mecha-gray-50);
    border-radius: var(--mecha-radius);
    padding: 16px;
    text-align: center;
    margin-bottom: 14px;
}

.mecha-eta-card__location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: var(--mecha-gray-600);
    margin-bottom: 8px;
}

.mecha-eta-card__location svg {
    color: var(--mecha-primary);
}

.mecha-eta-card__time {
    font-size: 20px;
    font-weight: 700;
    color: var(--mecha-primary);
    margin-bottom: 2px;
    transition: color 0.3s ease;
}

/* Velocidad de entrega: clases aplicadas via JS */
.mecha-eta-card.is-fast .mecha-eta-card__time    { color: #16a34a; } /* verde: ≤2 días */
.mecha-eta-card.is-medium .mecha-eta-card__time  { color: #ea580c; } /* naranja: 3-5 días */
.mecha-eta-card.is-slow .mecha-eta-card__time    { color: var(--mecha-gray-500); } /* gris: 6+ días */

.mecha-eta-card__label {
    font-size: 11px;
    color: var(--mecha-gray-400);
}

.mecha-eta-card__disclaimer {
    font-size: 10px;
    font-style: italic;
    color: var(--mecha-gray-400);
    margin-top: 8px;
}

/* Free Shipping */
.mecha-freeship {
    margin-bottom: 14px;
}

.mecha-freeship__pending {
    padding: 10px 12px;
    background: var(--mecha-gray-50);
    border-radius: var(--mecha-radius-sm);
}

.mecha-freeship__text {
    font-size: 12px;
    color: var(--mecha-gray-600);
    margin: 0 0 6px;
}

.mecha-freeship__text strong {
    color: var(--mecha-primary);
}

.mecha-freeship__bar {
    height: 6px;
    background: var(--mecha-gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.mecha-freeship__progress {
    height: 100%;
    background: var(--mecha-warning);
    border-radius: 3px;
    width: 0;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.mecha-freeship.is-qualified .mecha-freeship__progress {
    background: var(--mecha-success);
    width: 100%;
}

.mecha-freeship__success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--mecha-success-light);
    color: var(--mecha-success);
    border-radius: var(--mecha-radius-sm);
    font-size: 13px;
    font-weight: 500;
}

/* Carriers */
.mecha-carriers {
    margin-bottom: 4px;
}

.mecha-carrier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 4px;
    background: transparent;
    border-bottom: 1px solid var(--mecha-gray-100);
    margin-bottom: 0;
}

.mecha-carrier:last-child {
    border-bottom: none;
}

.mecha-carrier.is-free {
    background: transparent;
    border-color: var(--mecha-success-light);
}

.mecha-carrier__info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mecha-carrier__logo {
    width: auto;
    height: auto;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--mecha-gray-600);
}

.mecha-carrier__logo svg {
    display: block;
    width: auto;
    height: 20px;
    /* Tamaño del logo ajustado para fluir con texto */
    max-width: 100px;
    object-fit: contain;
    object-position: left center;
}

.mecha-carrier__prefix {
    font-size: 13px;
    color: var(--mecha-gray-600);
}

.mecha-carrier__price {
    font-size: 15px;
    font-weight: 600;
    color: var(--mecha-gray-800);
}

.mecha-carrier__price.is-free {
    color: var(--mecha-success);
}

/* ========================================
   HEADER TRIGGER (Display en Header)
   ======================================== */
.mecha-header-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    padding: 0 5px !important;
    cursor: pointer !important;
    height: auto !important;
    min-height: 40px !important;
    line-height: normal !important;
    margin-left: 0 !important;
    color: inherit !important;
    text-decoration: none !important;
    border: none !important;
    background: transparent !important;
    position: relative !important;
}

.mecha-header-trigger:hover {
    opacity: 0.8;
}

/* Indicador pulsante: aparece cuando no hay ubicación seleccionada */
.mecha-header-trigger.needs-location::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #ea580c;
    border-radius: 50%;
    border: 2px solid white;
    animation: mecha-pulse 1.8s ease-in-out infinite;
}

@keyframes mecha-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.4); opacity: 0.7; }
}

.mecha-header-trigger svg {
    display: block !important;
    flex-shrink: 0 !important;
    width: 32px !important;
    height: 32px !important;
    max-width: none !important;
    max-height: none !important;
    fill: #411073 !important;
    margin: 0 !important;
}

.mecha-header-trigger__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.mecha-header-trigger__label {
    font-size: 11px;
    color: #777 !important;
    opacity: 1;
    font-weight: 400;
    margin-bottom: -2px;
}

.mecha-header-trigger__value {
    font-size: 13px;
    font-weight: 700;
    color: #411073 !important;
    max-width: 180px;
    /* Un poco más de espacio */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ocultar inyecciones automáticas fallidas si las hubiera */
.mecha-trigger-duplicate {
    display: none;
}

/* ========================================
   HOME WIDGET (Card en Home)
   ======================================== */
.mecha-home-widget {
    background: var(--mecha-white);
    border: 1px solid var(--mecha-gray-200);
    border-radius: var(--mecha-radius);
    padding: 16px;
    max-width: 320px;
}

.mecha-home-widget__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--mecha-gray-700);
    margin: 0 0 4px;
}

.mecha-home-widget__subtitle {
    font-size: 12px;
    color: var(--mecha-gray-500);
    margin: 0 0 12px;
}

.mecha-home-widget__input-row {
    display: flex;
    gap: 8px;
}

.mecha-home-widget__input {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--mecha-gray-200);
    border-radius: var(--mecha-radius-sm);
    outline: none;
}

.mecha-home-widget__input:focus {
    border-color: var(--mecha-primary);
}

.mecha-home-widget__btn {
    padding: 10px 14px;
    background: var(--mecha-primary);
    color: var(--mecha-white);
    border: none;
    border-radius: var(--mecha-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.mecha-home-widget__btn:hover {
    background: var(--mecha-primary-hover);
}

/* ========================================
   PRODUCT TRIGGER (Botón en Producto)
   ======================================== */
.mecha-product-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    margin-top: 12px;
    background: rgba(96, 23, 177, 0.05);
    color: var(--mecha-primary);
    border: 1px dashed var(--mecha-primary);
    border-radius: var(--mecha-radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.mecha-product-trigger:hover {
    background: rgba(96, 23, 177, 0.1);
}

.mecha-product-trigger svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
}

/* ========================================
   GOOGLE MAPS AUTOCOMPLETE FIX
   ======================================== */
/* El contenedor de sugerencias de Google (pac-container) tiene z-index 1000 por defecto.
   El modal tiene 100000.
   Elevamos el pac-container para que sea visible SOBRE el modal.
*/
.pac-container {
    z-index: 2147483647 !important;
    /* Valor máximo de 32-bit integer */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: none;
    font-family: inherit;
}

.pac-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
}

.pac-item:hover {
    background-color: #f5f5f5;
}

.pac-item-query {
    color: #000;
    font-weight: 600;
}

/* ========================================
   LOCATION TOOLTIP (Popover)
   ======================================== */
.mecha-location-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 12px;
    width: 300px;
    background: var(--mecha-white);
    padding: 16px;
    border-radius: var(--mecha-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    border: 1px solid var(--mecha-gray-200);
    text-align: left;

    /* Animation state: Hidden by default */
    opacity: 0;
    transform: translateY(-5px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mecha-location-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Flecha superior */
.mecha-location-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: var(--mecha-white);
    transform: rotate(45deg);
    border-top: 1px solid var(--mecha-gray-200);
    border-left: 1px solid var(--mecha-gray-200);
}

.mecha-location-tooltip__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--mecha-primary);
    margin: 0 0 8px;
    line-height: 1.2;
}

.mecha-location-tooltip__description {
    font-size: 12px;
    color: var(--mecha-gray-600);
    margin: 10px 10px 12px;
    line-height: 1.4;
}

.mecha-location-tooltip__actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mecha-location-tooltip__btn {
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    transition: all 0.2s;
}

.mecha-location-tooltip__btn--primary {
    background: var(--mecha-primary);
    color: var(--mecha-white);
    padding: 8px 16px;
    border-radius: var(--mecha-radius-sm);
}

.mecha-location-tooltip__btn--primary:hover {
    background: var(--mecha-primary-hover);
}

.mecha-location-tooltip__btn--secondary {
    color: var(--mecha-gray-500);
    padding: 4px 8px;
}

.mecha-location-tooltip__btn--secondary:hover {
    color: var(--mecha-gray-700);
    text-decoration: underline;
}

/* ========================================
   ERROR DE VALIDACIÓN DE DIRECCIÓN
   ======================================== */
.mecha-address-validation-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--mecha-radius);
    padding: 12px 16px;
    margin: 12px 0;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.4;
    animation: mechaShakeError 0.5s ease;
}

.mecha-address-validation-error svg {
    flex-shrink: 0;
    color: #dc2626;
    margin-top: 1px;
}

.mecha-address-validation-error span {
    flex: 1;
}

@keyframes mechaShakeError {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

/* ========================================
   CONFIRM DIALOG
   ======================================== */
.mecha-confirm-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100001;
    /* Encima del modal */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--mecha-transition), visibility var(--mecha-transition);
}

.mecha-confirm-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.mecha-confirm-box {
    background: var(--mecha-white);
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 360px;
    box-shadow: var(--mecha-shadow);
    text-align: center;
    transform: translateY(10px);
    transition: transform var(--mecha-transition);
}

.mecha-confirm-overlay.is-visible .mecha-confirm-box {
    transform: translateY(0);
}

.mecha-confirm-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--mecha-gray-800);
}

.mecha-confirm-message {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--mecha-gray-600);
    line-height: 1.5;
}

.mecha-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mecha-btn-cancel,
.mecha-btn-confirm {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--mecha-transition);
}

.mecha-btn-cancel {
    border: 1px solid var(--mecha-gray-300);
    background: var(--mecha-white);
    color: var(--mecha-gray-700);
}

.mecha-btn-cancel:hover {
    background: var(--mecha-gray-50);
}

.mecha-btn-confirm {
    border: none;
    background: var(--mecha-primary);
    color: var(--mecha-white);
    box-shadow: 0 2px 4px rgba(96, 23, 177, 0.2);
}

.mecha-btn-confirm:hover {
    background: var(--mecha-primary-hover);
}

/* ========================================
   LINK "MÁS DETALLES" EN PRODUCTO
   ======================================== */
.mecha-product-link {
    background: none;
    border: none;
    padding: 0;
    margin-top: 8px;
    display: inline-block;

    /* Tipografía */
    font-size: 13px;
    /* Tamaño coherente con el contexto "Llega..." */
    font-weight: 600;
    color: var(--mecha-primary) !important;
    /* Morado forzado */
    text-transform: none !important;
    /* No mayúsculas forzado */
    text-decoration: underline;
    cursor: pointer;
}

.mecha-product-link:hover {
    color: var(--mecha-primary-hover) !important;
    text-decoration: none;
}

/* ========================================
   WIDGET PRODUCTO (AJUSTES FINOS)
   ======================================== */
.mecha-product-eta {
    margin-top: 5px;
    /* Reducido para compactar */
    margin-bottom: 0px;
    /* Pegado al link de abajo, el link ya tiene margin-top */
    line-height: 1.3;
}

.mecha-product-eta__text {
    font-size: 14px !important;
    /* Reducido de tamaño base */
    color: #333;
}

/* Ajustar margen de la barra de envío gratis para juntarlo todo */
#mecha-product-freeship-bar.mecha-freeship {
    margin-bottom: 8px !important;
}

/* Ajustar el link (modificación previa) para asegurar espaciado correcto */
.mecha-product-link {
    margin-top: 4px !important;
    /* Reducir separación vertical con ETA */
}

/* ========================================
   ESTILOS ADICIONALES MI CUENTA
   ======================================== */

/* Hacer notoria la opción de editar facturación nativa */
.woocommerce-Address-title .edit,
.u-column1 .title .edit,
.woocommerce-account .addresses .title .edit {
    display: inline-block;
    background-color: #f0f0f0;
    color: #333 !important;
    padding: 5px 12px;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: 600;
    border: 1px solid #ddd;
    margin-top: 5px;
    transition: all 0.2s ease;
}

.woocommerce-Address-title .edit:hover,
.u-column1 .title .edit:hover,
.woocommerce-account .addresses .title .edit:hover {
    background-color: #6017b1;
    color: #fff !important;
    border-color: #6017b1;
}

/* Ocultar botón Editar de la dirección de envío nativa */
.woocommerce-Address-title .edit[href*="shipping"],
.u-column2 .title .edit,
.col-2 .title .edit {
    display: none !important;
}