/* adchairpersonalizer — front.css — FASE 3
 * Todos los selectores bajo .adperso-front para no chocar con NextPrest.
 */

/* ---- Reset local ---- */
.adperso-front *,
.adperso-front *::before,
.adperso-front *::after {
    box-sizing: border-box;
}

/* ---- Wrapper principal ---- */
.adperso-front {
    margin: 24px 0;
    font-family: inherit;
    font-size: 14px;
    color: #333;
}

/* ---- Toggle row ---- */
.adperso-toggle-row {
    margin-bottom: 16px;
}
.adperso-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #128AA7;
    user-select: none;
}
.adperso-toggle-check {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #128AA7;
}

/* ---- Bloque personalizacion ---- */
.adperso-block {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #fafafa;
    animation: adperso-fadein 0.2s ease;
}
@keyframes adperso-fadein {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Sección tipo (radios) ---- */
.adperso-section--type {
    margin-bottom: 20px;
}
.adperso-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.adperso-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.adperso-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}
.adperso-radio input[type="radio"] {
    accent-color: #128AA7;
    width: 16px;
    height: 16px;
}

/* ---- Columnas: 2 columnas desktop, 1 mobile ---- */
.adperso-columns {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ---- Preview (izquierda) ---- */
.adperso-preview-col {
    flex: 0 0 280px;
    min-width: 200px;
}
.adperso-preview-wrap {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background-color: #E8B926;
    transition: background-color 0.25s ease;
}
.adperso-preview-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply;  /* deja pasar el color de fondo a través del PNG silueta */
}
.adperso-preview-zone {
    position: absolute;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* posicion y dimensiones se setean via JS con data de la zona */
}
.adperso-preview-text {
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
    line-height: 1.2;
    text-align: center;
}
.adperso-preview-logo {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ---- Controles (derecha) ---- */
.adperso-controls-col {
    flex: 1 1 0;
    min-width: 0;
}

/* ---- Subbloques ---- */
.adperso-subblock {
    margin-bottom: 20px;
}

/* ---- Input texto ---- */
.adperso-text-input {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    margin-bottom: 4px;
}
.adperso-text-input:focus {
    border-color: #128AA7;
    box-shadow: 0 0 0 2px rgba(18,138,167,0.15);
}
.adperso-char-counter {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}

/* ---- Fila de campos ---- */
.adperso-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.adperso-field {
    flex: 1 1 120px;
}
.adperso-sublabel {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
}
.adperso-select {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}
.adperso-select:focus {
    border-color: #128AA7;
}

/* ---- Swatches de color ---- */
.adperso-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.adperso-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
    padding: 0;
    outline: none;
}
.adperso-swatch:hover {
    transform: scale(1.15);
}
.adperso-swatch.active {
    border-color: #128AA7;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(18,138,167,0.3);
}

/* ---- Subida de logo ---- */
.adperso-file-label {
    display: inline-block;
    padding: 8px 16px;
    background: #128AA7;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
    margin-bottom: 8px;
}
.adperso-file-label:hover {
    background: #0e7a94;
}
.adperso-file-input {
    display: none;
}
.adperso-info-logo {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}
.adperso-upload-status {
    font-size: 13px;
    min-height: 18px;
    margin-top: 4px;
}
.adperso-upload-status.uploading { color: #888; }
.adperso-upload-status.ok        { color: #2e8b57; font-weight: 600; }
.adperso-upload-status.err       { color: #c0392b; }

/* ---- Sobrecoste ---- */
.adperso-surcharge {
    margin-top: 12px;
    padding: 10px 14px;
    background: #e8f7fa;
    border-left: 3px solid #128AA7;
    border-radius: 0 4px 4px 0;
    font-size: 15px;
    color: #333;
}
.adperso-surcharge strong {
    color: #128AA7;
}

/* ---- Mensaje de validación ---- */
.adperso-validation-msg {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #c0392b;
    font-size: 13px;
}

/* ========================================================
   Mobile: 1 columna (<768px)
   ======================================================== */
@media (max-width: 767px) {
    .adperso-columns {
        flex-direction: column;
    }
    .adperso-preview-col {
        flex: none;
        width: 100%;
    }
    .adperso-preview-wrap {
        max-width: 320px;
        margin: 0 auto;
    }
    .adperso-radios {
        flex-direction: column;
        gap: 8px;
    }
}
