/* =======================================================
   ESTILO GENERAL – APP MODERNA / PANEL
======================================================= */

body {
    background: #f3f4f6;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111827;
}

.container-producto {
    max-width: 1100px;
}

/* TITULOS Y CABECERA */

.header-producto h2 {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #111827;
}

.header-producto .texto-secundario {
    font-size: 0.95rem;
    color: #6b7280;
}

/* CARD PRINCIPAL */

.card-modern {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 20px 24px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
    border: 1px solid #e5e7eb;
}

/* SUB-CARDS (steps) */

.card-modern-sub {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 16px 18px;
    border: 1px solid #e5e7eb;
    margin-bottom: 18px;
}

/* SUB-HEADER */

.sub-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sub-header .step-title {
    font-weight: 600;
    color: #111827;
}

.sub-header-warning {
    border-left: 4px solid #facc15;
    padding-left: 8px;
}

.sub-header-info {
    border-left: 4px solid #3b82f6;
    padding-left: 8px;
}

.sub-header-success {
    border-left: 4px solid #22c55e;
    padding-left: 8px;
}

/* STEP BADGES */

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.step-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.step-badge.info {
    background: #dbeafe;
    color: #1d4ed8;
}

.step-badge.info {
    background: #dbeafe;
    color: #1d4ed8;
}

/* RONDA */

.step-round {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: #111827;
    color: #f9fafb;
}

/* CAMPOS FORMULARIO */

.campo {
    margin-bottom: 14px;
}

.etiqueta {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #111827;
}

.input-modern,
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 0.93rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-modern:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}

textarea {
    resize: vertical;
}

/* DISABLED */

input[disabled],
textarea[disabled],
select[disabled] {
    background: #f9fafb;
    color: #6b7280;
}

/* AYUDA / ERRORES */

.ayuda-campo {
    display: block;
    margin-top: 3px;
    font-size: 0.78rem;
    color: #6b7280;
}

.error-campo {
    font-size: 0.78rem;
    color: #b91c1c;
    margin-bottom: 4px;
}

/* BADGE AUTOCOMPLETADO IA */

.badge-auto {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #15803d;
    font-size: 0.7rem;
    font-weight: 600;
}

/* BOTONES */

.btn-main,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-main {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.35);
}

.btn-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(79, 70, 229, 0.4);
}

.btn-main:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: #6b7280;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Botón chico */

.btn-sm {
    padding: 7px 14px;
    font-size: 0.8rem;
}

/* Botón flotante móvil (si lo activás) */

.btn-floating-preview {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1050;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.4);
    font-size: 20px;
}

/* EDICIÓN DE IMAGEN – BOTONES */

.btn-edicion {
    width: 100%;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.18s ease;
}

.btn-edicion:hover {
    background: #eef2ff;
    border-color: #4f46e5;
    color: #312e81;
}

.btn-edicion-active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(79, 70, 229, 0.35);
}

/* PREVIEW */

.preview-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px 14px 16px;
    border: 1px solid #e5e7eb;
    margin-bottom: 14px;
}

.preview-title-header {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.preview-wrapper {
    border-radius: 12px;
    background: linear-gradient(135deg, #eef2ff, #e5e7eb);
    padding: 10px;
    text-align: center;
    margin-bottom: 8px;
}

.preview-wrapper img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    object-fit: contain;
}

.preview-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.preview-price {
    font-size: 1rem;
    font-weight: 700;
    color: #16a34a;
    margin-bottom: 4px;
}

.preview-zona {
    font-size: 0.8rem;
    color: #6b7280;
}

.preview-meta {
    margin: 4px 0 6px;
}

.preview-meta span {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #eef2ff;
    color: #4f46e5;
    margin-right: 4px;
}

.preview-description {
    font-size: 0.82rem;
    color: #374151;
    white-space: pre-line;
}

/* MENSAJES GLOBALES */

.alert-modern-success {
    background: #ecfdf3;
    border-left: 4px solid #16a34a;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.alert-modern-error {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.alert-modern-info {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

/* IA – LOADING, PREGUNTA, OPCIONES */

.ia-loading {
    text-align: center;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6b7280;
}

.spinner {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 3px solid #e5e7eb;
    border-top-color: #f59e0b;
    margin: 0 auto 6px;
    animation: spin 0.6s linear infinite;
}

.spinner.small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ia-question {
    background: #fffbeb;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.85rem;
    margin-top: 8px;
}

.ia-question-title {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 2px;
}

.ia-question-text {
    color: #92400e;
    margin-bottom: 6px;
}

.ia-input-group {
    display: flex;
    gap: 6px;
}

.ia-input-group .input-modern {
    flex: 1;
}

.ia-options {
    margin-top: 10px;
    font-size: 0.85rem;
}

.ia-options-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.badge-emoji {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #15803d;
}

.ia-option-card {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    background: #f9fafb;
    cursor: pointer;
    transition: 0.18s ease;
    height: 100%;
}

.ia-option-card:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.18);
    background: #ffffff;
}

.ia-option-card-selected {
    border-color: #22c55e;
    box-shadow: 0 8px 22px rgba(34, 197, 94, 0.28);
    background: #f0fdf4;
}

.ia-option-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.ia-option-badge {
    font-size: 0.7rem;
    background: #22c55e;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 999px;
}

.ia-option-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.ia-option-text {
    font-size: 0.8rem;
    color: #4b5563;
}

.ia-footnote {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 4px;
}

/* FOOTER ACCIONES */

.acciones-formulario {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

/* ANIMACIONES */

.fade-in {
    animation: fadeIn 0.25s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */

@media (max-width: 768px) {
    .card-modern {
        padding: 16px 14px 18px;
    }

    .acciones-formulario {
        flex-direction: column-reverse;
    }

    .acciones-formulario .btn-main,
    .acciones-formulario .btn-secondary {
        width: 100%;
    }
}