/**
 * Formulario de Pedidos Personalizados - Premium Design v4.0
 * Diseño minimalista estilo Apple
 */

/* Reset y configuración base */
.fp-formulario-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.fp-formulario-container {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    padding: 30px 0;
    background: #fafafa;
}

.fp-form-wrapper {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    max-width: 920px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Header del formulario */
.fp-form-header {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    color: #1d1d1f;
    padding: 48px 40px 40px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.fp-form-header h1 {
    font-size: 32px;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.fp-form-header p {
    font-size: 15px;
    color: #6e6e73;
    font-weight: 400;
    letter-spacing: -0.1px;
}

/* Barra de progreso */
.fp-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    position: relative;
    max-width: 520px;
    padding: 32px 40px 28px;
}

.fp-progress-step {
    flex: 0 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.fp-step-number {
    width: 48px;
    height: 48px;
    background: #f5f5f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 17px;
    color: #86868b;
    margin: 0 auto 10px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.fp-step-number.with-check {
    background: #007AFF;
    color: white;
    border-color: #007AFF;
}

.fp-progress-step.active .fp-step-number {
    background: #007AFF;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    transform: scale(1.05);
    border-color: #007AFF;
}

.fp-progress-step.completed .fp-step-number {
    background: #34c759;
    color: white;
    border-color: #34c759;
}

.fp-progress-step-label {
    display: block;
    font-size: 13px;
    color: #86868b;
    font-weight: 500;
    letter-spacing: -0.1px;
}

.fp-progress-step.active .fp-progress-step-label {
    color: #1d1d1f;
    font-weight: 600;
}

/* Línea de progreso */
.fp-progress-line {
    flex: 1;
    height: 2px;
    background: #e5e5e7;
    margin: 0 -10px;
    margin-bottom: 38px;
    position: relative;
    z-index: 1;
    transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.fp-progress-step.completed + .fp-progress-line {
    background: #34c759;
}

/* Contenido del formulario */
.fp-form-content {
    padding: 48px 40px;
}

.fp-step {
    display: none;
}

.fp-step.active {
    display: block;
    animation: fpFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fpFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(16px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.fp-step h2 {
    color: #1d1d1f;
    margin-bottom: 28px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.fp-step h2 + .fp-step2-instruccion {
    margin-top: -18px;
}

.fp-step2-instruccion {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ================================================================
   TARJETAS PREMIUM — Imagen de fondo completa + Badge flotante
   Aplica a: Categorías (paso 1), Productos (paso 2), Tamaños (paso 2)
   ================================================================ */

/* Grid de categorías */
.fp-categories-grid {
    display: grid;
    grid-template-columns: repeat(var(--fp-cat-desktop-cols, 4), 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

/* ================================================================
   TARJETAS REDISEÑADAS — Badge por FUERA de la imagen (debajo)
   ================================================================ */

/* Base compartida para los tres tipos de tarjeta */
.fp-category-card {
    border: 2px solid transparent;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    position: relative;
    padding: 4px 4px 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: 0;
    box-sizing: border-box;
    width: 100%;
}

.fp-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
    border-color: #007AFF;
}

.fp-category-card.selected {
    border-color: #007AFF;
    box-shadow: 0 6px 28px rgba(0, 122, 255, 0.22);
}

/* ---- Wrapper de la imagen (overflow:hidden + aspect-ratio) ---- */
.fp-card-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 13px;
    background: #ebebf0;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fp-category-card:hover .fp-card-image-wrap {
    transform: scale(1.02);
}

/* ---- Imagen que llena el wrapper ---- */
.fp-card-image-fill {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
}

.fp-card-image-fill img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.fp-category-card:hover .fp-card-image-fill img {
    transform: scale(1.06);
}

/* Placeholder emoji cuando no hay imagen real */
.fp-card-emoji-bg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    background: linear-gradient(145deg, #f0f0f5 0%, #e4e4ec 100%);
    transition: transform 0.35s ease;
}

.fp-category-card:hover .fp-card-emoji-bg {
    transform: scale(1.06);
}

/* Sin gradiente oscuro — el badge está fuera */
.fp-card-image-fill::after { display: none; }

/* ---- Badge por FUERA (debajo de la imagen) ---- */
.fp-category-name {
    display: block;
    width: calc(100% - 4px);
    margin: 7px 2px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #1d1d1f;
    padding: 5px 8px;
    background: #f0f0f5;
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.22s, color 0.22s, box-shadow 0.22s;
    letter-spacing: -0.1px;
    pointer-events: none;
    position: static;
    transform: none;
    left: auto;
    bottom: auto;
    box-shadow: none;
}

.fp-category-card.selected .fp-category-name {
    background: rgba(0, 122, 255, 0.12);
    color: #007AFF;
}

.fp-category-card:hover:not(.selected) .fp-category-name {
    background: #e4e4ec;
}

/* Custom upload card */
.fp-custom-upload-card {
    border-color: rgba(0, 122, 255, 0.4);
}

.fp-custom-upload-card .fp-card-emoji-bg {
    background: linear-gradient(145deg, #e8f2ff 0%, #d4e8ff 100%);
    color: #007AFF;
}

/* Sección de productos */
.fp-products-section {
    margin-bottom: 32px;
}

/* Grid de productos */
.fp-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--fp-prod-desktop-cols, 4), 1fr);
    gap: 14px;
}

/* Tarjetas de producto — badge por FUERA */
.fp-product-card {
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 4px 4px 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: 0;
    box-sizing: border-box;
    width: 100%;
}

.fp-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
    border-color: #007AFF;
}

.fp-product-card.selected {
    border-color: #007AFF;
    box-shadow: 0 6px 28px rgba(0, 122, 255, 0.22);
}

.fp-product-card:hover .fp-card-image-wrap {
    transform: scale(1.02);
}

.fp-product-card:hover .fp-card-image-fill img {
    transform: scale(1.06);
}

.fp-product-card:hover .fp-card-emoji-bg {
    transform: scale(1.06);
}

.fp-product-card.custom {
    border-color: rgba(0, 122, 255, 0.3);
}

.fp-product-card.custom .fp-card-emoji-bg {
    background: linear-gradient(145deg, #e8f2ff 0%, #d4e8ff 100%);
    color: #007AFF;
}

/* Badge de nombre — debajo de la imagen */
.fp-product-name {
    display: block;
    width: calc(100% - 4px);
    margin: 7px 2px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #1d1d1f;
    padding: 5px 8px;
    background: #f0f0f5;
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.22s, color 0.22s;
    letter-spacing: -0.1px;
    pointer-events: none;
    position: static;
    transform: none;
    left: auto;
    bottom: auto;
    box-shadow: none;
}

.fp-product-card.selected .fp-product-name {
    background: rgba(0, 122, 255, 0.12);
    color: #007AFF;
}

.fp-product-card:hover:not(.selected) .fp-product-name {
    background: #e4e4ec;
}

/* ── Product check badge (igual que size-check) ── */
.fp-product-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #007AFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.35);
    z-index: 4;
}
.fp-product-card.selected .fp-product-check {
    opacity: 1;
    transform: scale(1);
}

/* ── Skeleton loading cards ── */
.fp-skeleton-card {
    pointer-events: none;
    cursor: default;
}
.fp-skeleton-pulse {
    background: linear-gradient(90deg, #f0f0f5 25%, #e4e4ec 50%, #f0f0f5 75%);
    background-size: 200% 100%;
    animation: fpSkeletonShimmer 1.4s infinite;
    border-radius: inherit;
}
.fp-skeleton-card .fp-card-image-fill {
    background: none;
}
.fp-skeleton-text {
    height: 28px;
    border-radius: 10px;
    margin: 7px 4px 4px;
    width: calc(100% - 8px);
}
@keyframes fpSkeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── "Ver más" card ── */
.fp-load-more-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 36px rgba(99, 102, 241, 0.22);
    border-color: #6366f1;
}
.fp-load-more-card .fp-card-image-fill {
    border-radius: 14px;
}

.fp-custom-icon {
    font-size: 40px;
    color: #007AFF;
}

/* Vista de detalles moderna */
.fp-detail-view {
    display: none;
    background: #fafafa;
    padding: 28px;
    border-radius: 16px;
    margin-top: 24px;
    border: 1px solid #d2d2d7;
}

.fp-detail-view.active {
    display: block;
}

.fp-detail-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 28px;
    align-items: flex-start;
}

.fp-detail-image {
    width: 100%;
}

.fp-detail-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.fp-detail-image-emoji {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 200px;
    background: #f5f5f7;
    border-radius: 14px;
}

.fp-detail-info {
    flex: 1;
}

.fp-detail-info h4 {
    font-size: 22px;
    margin-bottom: 16px;
    color: #1d1d1f;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Zona de carga de archivos moderna */
.fp-upload-zone {
    border: 2px dashed #007AFF;
    border-radius: 14px;
    padding: 64px 32px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fp-upload-zone:hover {
    background: #f5f9ff;
    border-color: #0051d5;
    transform: scale(1.01);
}

.fp-upload-zone.dragover {
    background: #e8f2ff;
    border-color: #0051d5;
    transform: scale(1.02);
}

.fp-upload-icon {
    font-size: 64px;
    color: #007AFF;
    margin-bottom: 16px;
}

.fp-upload-icon i {
    font-size: 64px;
}

.fp-upload-text {
    font-size: 17px;
    color: #1d1d1f;
    margin-bottom: 10px;
    font-weight: 500;
}

.fp-upload-hint {
    font-size: 14px;
    color: #86868b;
}

/* Campos de formulario premium */
.fp-form-group {
    margin-bottom: 22px;
}

.fp-form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #1d1d1f;
    font-size: 15px;
    letter-spacing: -0.1px;
}

.fp-form-group textarea,
.fp-form-group input[type="text"],
.fp-form-group input[type="email"] {
    width: 100%;
    padding: 16px 14px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #ffffff;
    transition: all 0.2s ease;
    color: #1d1d1f;
}

.fp-form-group textarea {
    min-height: 130px;
    resize: vertical;
    margin-top: 10px;
}

.fp-form-group input:focus,
.fp-form-group textarea:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

/* Botones premium estilo Apple */
.fp-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 32px;
    gap: 12px;
}

.fp-btn-primary,
.fp-btn-secondary {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    gap: 8px;
    width: auto;
    letter-spacing: -0.2px;
}

.fp-btn-primary {
    background: #007AFF;
    color: #ffffff;
    margin-left: auto;
    display: inline-flex;
}

.fp-btn-primary:hover:not(:disabled) {
    background: #0051d5;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}

.fp-btn-primary:disabled {
    background: #d2d2d7;
    color: #86868b;
    cursor: not-allowed;
}

.fp-btn-secondary {
    background: #f5f5f7;
    color: #1d1d1f;
    display: none;
}

.fp-btn-secondary:hover {
    background: #e8e8ed;
    transform: translateY(-1px);
}

/* Botones de cambio/eliminación de foto */
.fp-btn-change-photo {
    padding: 12px 24px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.1px;
}

.fp-btn-change-photo:hover {
    background: #0051d5;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.25);
}

.fp-btn-change-photo i {
    font-size: 15px;
}

/* Mensaje de éxito premium */
.fp-success-message {
    text-align: center;
    padding: 48px;
}

.fp-success-icon {
    font-size: 88px;
    color: #34c759;
    margin-bottom: 24px;
}

/* RESUMEN DEL PEDIDO MODERNO */
.fp-order-summary {
    background: #fafafa;
    padding: 28px;
    border-radius: 14px;
    margin: 24px 0 32px;
    border: 1px solid #d2d2d7;
}

.fp-order-summary h3 {
    margin-bottom: 22px;
    font-size: 19px;
    color: #1d1d1f;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.fp-summary-item {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 22px;
    padding: 22px;
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid #d2d2d7;
}

.fp-summary-image {
    width: 130px;
    height: 130px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-summary-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fp-summary-image-emoji {
    font-size: 64px;
}

.fp-summary-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fp-summary-category {
    font-size: 12px;
    color: #007AFF;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.fp-summary-title {
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 10px;
    letter-spacing: -0.2px;
}

.fp-summary-description {
    font-size: 15px;
    color: #6e6e73;
    line-height: 1.5;
    letter-spacing: -0.1px;
}

/* Preview de archivos moderno */
.fp-file-preview {
    margin-top: 18px;
    padding: 18px;
    background: white;
    border-radius: 10px;
    border: 1px solid #d2d2d7;
    display: none;
}

.fp-file-preview.active {
    display: block;
}

.fp-file-preview img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 10px;
    margin-top: 12px;
}

/* ========================================
   Loading Spinner premium
   ======================================== */

.fp-upload-loading {
    text-align: center;
    padding: 48px 24px;
}

.fp-upload-loading p {
    margin: 12px 0;
    color: #6e6e73;
    font-size: 15px;
    font-weight: 500;
}

.fp-spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 24px;
    border: 4px solid #f5f5f7;
    border-top: 4px solid #007AFF;
    border-radius: 50%;
    animation: fp-spin 0.8s linear infinite;
}

@keyframes fp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mensajes de error premium */
.fp-upload-error {
    padding: 24px;
    background: #fff5f5;
    border-radius: 12px;
    border: 2px solid #ff3b30;
    text-align: center;
}

.fp-upload-error p {
    margin: 12px 0;
    color: #1d1d1f;
    font-size: 15px;
}

.fp-upload-error button {
    margin-top: 18px;
    padding: 12px 24px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fp-upload-error button:hover {
    background: #0051d5;
    transform: translateY(-2px);
}

/* ========================================
   Sistema de notificaciones premium tipo Apple
   ======================================== */

.fp-notification {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(28, 28, 30, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    color: white;
    padding: 18px 28px;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    min-width: 320px;
    max-width: 520px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 15px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 14px;
    letter-spacing: -0.1px;
}

.fp-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.fp-notification.error {
    background: rgba(255, 59, 48, 0.95);
}

.fp-notification.success {
    background: rgba(52, 199, 89, 0.95);
}

.fp-notification.warning {
    background: rgba(255, 149, 0, 0.95);
}

.fp-notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.fp-notification-text {
    flex: 1;
    font-weight: 500;
}

.fp-notification-close {
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-notification-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.fp-notification-close i {
    font-size: 17px;
}

/* Icono de check para categorías seleccionadas */
.fp-category-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: #34c759;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.35);
    z-index: 4;
}

.fp-category-card.selected .fp-category-check {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* ── Tablet (769px – 1024px): 4 cards visibles + borde del 5º ── */
@media (max-width: 1024px) {
    .fp-categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* El skeleton sigue siendo grid (no scroll) */
    #fp-products-skeleton.fp-products-grid {
        grid-template-columns: repeat(var(--fp-prod-tablet-cols, 3), 1fr);
    }

    /* ── Categorías paso 1: grid en tablet (sin carrusel) ── */
    .fp-categories-grid {
        grid-template-columns: repeat(var(--fp-cat-tablet-cols, 3), 1fr);
    }

    /* ── Productos paso 2: grid en tablet sin carrusel ── */
    .fp-products-grid-wrap:not(.fp-carousel-active) .fp-products-grid {
        grid-template-columns: repeat(var(--fp-prod-tablet-cols, 3), 1fr);
    }

    /* Wrapper del carrusel */
    .fp-products-grid-wrap.fp-carousel-active {
        overflow-x: scroll;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-right: 20px;
        margin-right: -20px;
        cursor: grab;
    }

    .fp-products-grid-wrap.fp-carousel-active::-webkit-scrollbar {
        display: none;
    }

    .fp-products-grid-wrap.fp-carousel-active:active {
        cursor: grabbing;
    }

    /* El grid interior se convierte en fila flex */
    .fp-products-grid-wrap.fp-carousel-active .fp-products-grid {
        display: flex !important;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 12px;
        width: max-content;
        padding-bottom: 4px;
    }

    /* Ancho de cada card en el carrusel de tablet */
    .fp-products-grid-wrap.fp-carousel-active .fp-products-grid .fp-product-card,
    .fp-products-grid-wrap.fp-carousel-active .fp-products-grid .fp-woo-card {
        flex: 0 0 calc((100vw - 160px) / (var(--fp-prod-tablet-cols, 4) + 0.3));
        min-width: 110px;
        max-width: 240px;
        scroll-snap-align: start;
    }

    /* ── CARRUSEL DE CATEGORÍAS ── */
    .fp-categories-grid-wrap {
        /* por defecto no hace scroll — se activa con fp-carousel-active */
    }

    .fp-categories-grid-wrap.fp-carousel-active {
        overflow-x: scroll;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-right: 20px;
        margin-right: -20px;
        cursor: grab;
    }

    .fp-categories-grid-wrap.fp-carousel-active::-webkit-scrollbar { display: none; }
    .fp-categories-grid-wrap.fp-carousel-active:active { cursor: grabbing; }

    .fp-categories-grid-wrap.fp-carousel-active .fp-categories-grid {
        display: flex !important;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 12px;
        width: max-content;
        padding-bottom: 4px;
        margin-bottom: 0;
    }

    .fp-categories-grid-wrap.fp-carousel-active .fp-categories-grid .fp-category-card {
        flex: 0 0 calc((100vw - 160px) / (var(--fp-cat-tablet-cols, 3) + 0.3));
        min-width: 100px;
        max-width: 220px;
        scroll-snap-align: start;
    }

    /* Sentinel invisible para infinite scroll */
    .fp-carousel-sentinel {
        flex: 0 0 1px;
        width: 1px;
        height: 1px;
        visibility: hidden;
    }
}

/* ── Móvil (≤ 768px): card width según columnas configuradas ── */
@media (max-width: 768px) {
    /* Grid sin carrusel en móvil */
    .fp-categories-grid {
        grid-template-columns: repeat(var(--fp-cat-mobile-cols, 2), 1fr);
    }
    .fp-products-grid-wrap:not(.fp-carousel-active) .fp-products-grid {
        grid-template-columns: repeat(var(--fp-prod-mobile-cols, 2), 1fr);
    }

    .fp-products-grid-wrap.fp-carousel-active .fp-products-grid .fp-product-card,
    .fp-products-grid-wrap.fp-carousel-active .fp-products-grid .fp-woo-card {
        flex: 0 0 calc((100vw - 60px) / (var(--fp-prod-mobile-cols, 2) + 0.25));
        min-width: 100px;
        max-width: 280px;
    }

    .fp-products-grid-wrap.fp-carousel-active {
        margin-right: -24px;
        padding-right: 24px;
    }

    .fp-categories-grid-wrap.fp-carousel-active .fp-categories-grid .fp-category-card {
        flex: 0 0 calc((100vw - 60px) / (var(--fp-cat-mobile-cols, 2) + 0.25));
        min-width: 90px;
        max-width: 220px;
    }

    .fp-categories-grid-wrap.fp-carousel-active {
        margin-right: -24px;
        padding-right: 24px;
    }
}

/* ── Pantallas muy pequeñas (≤ 380px) ── */
@media (max-width: 380px) {
    .fp-products-grid-wrap.fp-carousel-active .fp-products-grid .fp-product-card,
    .fp-products-grid-wrap.fp-carousel-active .fp-products-grid .fp-woo-card {
        flex: 0 0 calc((100vw - 48px) / (var(--fp-prod-mobile-cols, 2) + 0.2));
    }
}

/* Indicador visual de carrusel: fade lateral */
@media (max-width: 1024px) {
    .fp-products-section {
        position: relative;
    }
    .fp-carousel-fade-hint {
        position: absolute;
        top: 0;
        right: 0;
        width: 56px;
        height: 100%;
        background: linear-gradient(to right, transparent, rgba(255,255,255,0.85));
        pointer-events: none;
        z-index: 2;
        border-radius: 0 18px 18px 0;
        transition: opacity 0.3s ease;
    }
    .fp-carousel-fade-hint.hidden {
        opacity: 0;
    }
}

/* Indicador de carga del carrusel */
.fp-carousel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 80px;
    min-width: 80px;
    opacity: 0.6;
}
.fp-carousel-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
    animation: fpCarouselDotPulse 0.8s ease-in-out infinite alternate;
    margin: 0 3px;
}
.fp-carousel-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.fp-carousel-loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes fpCarouselDotPulse {
    from { opacity: 0.3; transform: scale(0.8); }
    to   { opacity: 1;   transform: scale(1.1); }
}

/* Mobile y tablets pequeñas (máx 768px) */
@media (max-width: 768px) {
    .fp-formulario-container {
        padding: 20px 0;
    }

    .fp-form-content {
        padding: 32px 24px;
    }

    .fp-form-header {
        padding: 36px 24px 32px;
    }

    .fp-form-header h1 {
        font-size: 26px;
    }

    .fp-form-header p {
        font-size: 14px;
    }

    .fp-categories-grid {
        grid-template-columns: repeat(var(--fp-cat-mobile-cols, 2), 1fr);
        gap: 12px;
    }

    /* El skeleton de productos sigue en grid usando la var de mobile */
    #fp-products-skeleton.fp-products-grid {
        grid-template-columns: repeat(var(--fp-prod-mobile-cols, 2), 1fr);
        gap: 12px;
    }

    /* El grid-wrap en móvil ya tiene carousel CSS del bloque anterior */

    .fp-sizes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .fp-detail-content {
        grid-template-columns: 1fr;
    }

    .fp-summary-item {
        grid-template-columns: 110px 1fr;
        gap: 18px;
    }

    .fp-summary-image {
        width: 110px;
        height: 110px;
    }

    .fp-buttons {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
    }

    .fp-btn-primary,
    .fp-btn-secondary {
        width: auto;
        flex: 0 0 auto;
        padding: 12px 24px;
        font-size: 15px;
    }

    .fp-progress-bar {
        max-width: 100%;
    }

    .fp-step-number {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .fp-step h2 {
        font-size: 24px;
    }
}

/* Móviles pequeños (máx 480px) */
@media (max-width: 480px) {
    .fp-form-header h1 {
        font-size: 22px;
    }

    .fp-form-header p {
        font-size: 13px;
    }

    .fp-progress-step-label {
        font-size: 11px;
    }

    .fp-step-number {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .fp-step h2 {
        font-size: 22px;
    }

    .fp-summary-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .fp-summary-image {
        width: 100%;
        height: 220px;
        margin: 0 auto;
    }

    .fp-categories-grid,
    .fp-sizes-grid {
        grid-template-columns: repeat(var(--fp-cat-mobile-cols, 2), 1fr);
        gap: 10px;
    }

    #fp-products-skeleton.fp-products-grid {
        grid-template-columns: repeat(var(--fp-prod-mobile-cols, 2), 1fr);
        gap: 10px;
    }

    .fp-upload-zone {
        padding: 48px 24px;
    }
}

/* Responsivo para notificaciones */
@media (max-width: 768px) {
    .fp-notification {
        min-width: auto;
        max-width: calc(100% - 40px);
        bottom: 20px;
    }
}


/* ========================================
   Paso final (Gracias) - UI mejorada
======================================== */
/* ── Step 4 Success card ── */
#fp-step4 .fp-success-card{
    max-width: 820px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 22px;
    padding: 34px 28px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Partículas flotantes */
.fp-success-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.fp-particle {
    position: absolute;
    font-size: 22px;
    animation: fp-particle-float 4s ease-in-out infinite;
    opacity: 0;
}
.fp-p1 { left: 8%;  top: 15%; animation-delay: 0s;    animation-duration: 3.8s; }
.fp-p2 { left: 20%; top: 70%; animation-delay: 0.6s;  animation-duration: 4.2s; font-size:26px; }
.fp-p3 { left: 80%; top: 20%; animation-delay: 1.1s;  animation-duration: 3.5s; }
.fp-p4 { left: 65%; top: 75%; animation-delay: 0.3s;  animation-duration: 4.5s; }
.fp-p5 { left: 50%; top: 10%; animation-delay: 1.8s;  animation-duration: 3.9s; }
.fp-p6 { left: 88%; top: 55%; animation-delay: 0.9s;  animation-duration: 4.1s; font-size:18px; }
.fp-p7 { left: 5%;  top: 50%; animation-delay: 2.2s;  animation-duration: 3.6s; font-size:19px; }
.fp-p8 { left: 40%; top: 82%; animation-delay: 1.4s;  animation-duration: 4.3s; font-size:18px; }

@keyframes fp-particle-float {
    0%   { opacity: 0;   transform: translateY(12px) scale(0.7) rotate(-8deg); }
    25%  { opacity: 0.85; transform: translateY(-10px) scale(1.05) rotate(4deg); }
    60%  { opacity: 0.9;  transform: translateY(-22px) scale(1) rotate(-3deg); }
    100% { opacity: 0;   transform: translateY(-38px) scale(0.75) rotate(6deg); }
}

/* Badge animado */
#fp-step4 .fp-success-badge{
    width: 84px;
    height: 84px;
    border-radius: 999px;
    margin: 0 auto 16px;
    background: rgba(0,122,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    animation: fp-badge-pop 0.55s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes fp-badge-pop {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Check animado — se "dibuja" */
.fp-check-animate {
    animation: fp-check-draw 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.25s both;
}
@keyframes fp-check-draw {
    0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
    70%  { transform: scale(1.18) rotate(6deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

#fp-step4 .fp-success-badge{
    width: 84px;
    height: 84px;
    border-radius: 999px;
    margin: 0 auto 16px;
    background: rgba(0,122,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#fp-step4 .fp-success-check{
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: #007AFF;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 12px 30px rgba(0,122,255,0.35);
    position: relative;
    z-index: 1;
}

#fp-step4 .fp-success-title{
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 8px 0 10px;
    color: #0B1220;
    position: relative;
    z-index: 1;
}

#fp-step4 .fp-success-subtitle{
    color: rgba(11,18,32,0.72);
    font-size: 16px;
    line-height: 1.6;
    margin: 0 auto 18px;
    max-width: 640px;
    position: relative;
    z-index: 1;
}

#fp-step4 .fp-success-summary{
    margin-top: 18px;
}

#fp-step4 .fp-success-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    text-align: left;
    margin: 0 auto;
}

#fp-step4 .fp-success-item{
    background: #F7F8FB;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 14px 14px;
}

#fp-step4 .fp-success-label{
    font-size: 12px;
    color: rgba(11,18,32,0.55);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

#fp-step4 .fp-success-value{
    font-size: 15px;
    font-weight: 700;
    color: #0B1220;
    line-height: 1.35;
}

#fp-step4 .fp-success-image-wrap{
    margin: 14px auto 0;
    max-width: 560px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    background: #fff;
}

#fp-step4 .fp-success-image-wrap img{
    display: block;
    width: 100%;
    height: auto;
}

#fp-step4 .fp-success-actions{
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#fp-step4 .fp-btn-link{
    display: inline-block;
    font-weight: 600;
    color: rgba(0,122,255,0.95);
    text-decoration: none;
}

#fp-step4 .fp-btn-link:hover{
    text-decoration: underline;
}

#fp-step4 .fp-success-note{
    margin-top: 16px;
    font-size: 13px;
    color: rgba(11,18,32,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    #fp-step4 .fp-success-title{ font-size: 28px; }
    #fp-step4 .fp-success-grid{ grid-template-columns: 1fr; }
}


/* === Paso final (Gracias) - resumen compacto (FIX5) === */
.fp-success-summary-title{
  font-weight: 700;
  font-size: 16px;
  margin: 18px 0 10px;
  color: #0f172a;
}
.fp-success-summary-col{
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.fp-success-thumb img{
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  display: block;
}
.fp-success-lines{
  width: 100%;
}
.fp-success-line{
  font-size: 14px;
  line-height: 1.35;
  margin: 6px 0;
  color: #334155;
}
.fp-success-line .k{
  font-weight: 600;
  color: #0f172a;
}
.fp-success-line .v{
  font-weight: 500;
}

/* =============================================
   PASO 2 — Selector de Tamaño (image-fill + badge)
   ============================================= */

.fp-size-label {
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

.fp-sizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}

@media (max-width: 520px) {
    .fp-sizes-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
}

/* Tarjeta de tamaño — badge por FUERA */
.fp-size-card {
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 4px 4px 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.fp-size-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
    border-color: #007AFF;
}

.fp-size-card.selected {
    border-color: #007AFF;
    box-shadow: 0 6px 28px rgba(0, 122, 255, 0.22);
}

.fp-size-card:hover .fp-card-image-wrap {
    transform: scale(1.02);
}

.fp-size-card:hover .fp-card-image-fill img {
    transform: scale(1.06);
}

.fp-size-card:hover .fp-card-emoji-bg {
    transform: scale(1.06);
}

/* Badge del tamaño — debajo de la imagen */
.fp-size-badge {
    display: block;
    width: calc(100% - 4px);
    margin: 7px 2px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #1d1d1f;
    padding: 5px 8px 4px;
    background: #f0f0f5;
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.22s, color 0.22s;
    letter-spacing: -0.1px;
    pointer-events: none;
    position: static;
    transform: none;
    left: auto;
    bottom: auto;
    box-shadow: none;
    line-height: 1.3;
}

.fp-size-badge-desc {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.72;
    display: block;
    margin-top: 2px;
}

.fp-size-card.selected .fp-size-badge {
    background: rgba(0, 122, 255, 0.12);
    color: #007AFF;
}

.fp-size-card:hover:not(.selected) .fp-size-badge {
    background: #e4e4ec;
}

/* Check mark — dentro del fp-card-image-wrap */
.fp-size-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #007AFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.35);
    z-index: 4;
}

.fp-size-card.selected .fp-size-check {
    opacity: 1;
    transform: scale(1);
}
/* ── Fixed size card (informativo, no clickeable) ─────────────────── */
.fp-size-card.fp-size-card-fixed {
    border-color: #9ca3af !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.9;
}
.fp-size-card.fp-size-card-fixed .fp-card-image-wrap {
    transform: none !important;
}
.fp-size-card.fp-size-card-fixed .fp-size-badge {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
}
.fp-size-card.fp-size-card-fixed .fp-size-check {
    opacity: 1 !important;
    transform: scale(1) !important;
    background: #9ca3af !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12) !important;
    font-size: 11px;
}
/* Hint visible bajo la tarjeta fija */
.fp-size-fixed-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #4b5563;
    font-weight: 500;
    line-height: 1.4;
}
.fp-size-fixed-hint i {
    color: #9ca3af;
    flex-shrink: 0;
    font-size: 14px;
}


/* SVG spinner animation */
.fp-spin {
    animation: fp-spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* Button icon alignment */
.fp-btn-primary svg,
.fp-btn-secondary svg,
.fp-btn-change-photo svg,
.fp-notification svg {
    vertical-align: middle;
    display: inline-block;
}

/* Required field indicator */
.fp-required {
    color: #ff3b30;
    font-weight: 600;
    margin-left: 2px;
}

/* === Word counter === */
.fp-textarea-wrap {
    position: relative;
}
.fp-textarea-wrap textarea {
    width: 100%;
    padding-bottom: 28px;
}
.fp-char-counter {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 11px;
    color: #9ca3af;
    pointer-events: none;
    user-select: none;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s;
}
.fp-char-counter.fp-char-limit-reached {
    color: #ef4444;
    font-weight: 600;
}

/* === Progress bar (without form-header wrapper) === */
.fp-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 24px 20px 20px;
}

/* === Reference image layout (Step 2 frase + dedicatoria) === */
.fp-reference-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: flex-start;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.fp-reference-image-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-reference-img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
}

.fp-reference-fields-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fp-reference-fields-solo {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

/* Hidden label — only visible to screen-readers */
.fp-label-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Upload required badge */
.fp-upload-required-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
}

/* Summary extras */
.fp-summary-extra {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .fp-reference-layout {
        grid-template-columns: 1fr;
    }
    .fp-reference-image-col {
        order: -1;
    }
}

/* ===== Field error states ===== */
.fp-field-error label {
    color: #dc2626;
}
.fp-field-error input[type="text"],
.fp-field-error input[type="email"],
.fp-field-error textarea {
    border-color: #dc2626;
    background-color: #fff8f8;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.fp-field-error input:focus,
.fp-field-error textarea:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}
.fp-field-error-msg {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 13px;
    color: #dc2626;
    font-weight: 500;
    line-height: 1.4;
    animation: fp-error-in 0.2s ease;
}
.fp-field-error-msg svg {
    flex-shrink: 0;
}
@keyframes fp-error-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Grid-based error containers (category, size, product) */
.fp-grid-error-wrap {
    position: relative;
}
.fp-grid-error-wrap.fp-field-error .fp-categories-grid,
.fp-grid-error-wrap.fp-field-error .fp-sizes-grid,
.fp-grid-error-wrap.fp-field-error .fp-products-grid {
    border: 1.5px solid #dc2626;
    border-radius: 14px;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    padding: 8px;
}
.fp-grid-error-wrap .fp-grid-error-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d1d1f;
    font-size: 15px;
}
.fp-grid-error-wrap.fp-field-error .fp-grid-error-label {
    color: #dc2626;
}

/* Upload zone error */
.fp-upload-zone.fp-field-error {
    border-color: #dc2626;
    background: #fff8f8;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.fp-upload-error-wrap .fp-field-error-msg {
    margin-top: 8px;
}


/* ================================================================
   PANEL DE DETALLE DE PRODUCTO (Mejora 3 — Step 2)
   ================================================================ */

.fp-product-detail-panel {
    display: none;
    margin-top: 20px;
    background: #f7f8fb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    animation: fpFadeIn 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.fp-product-detail-panel.active {
    display: block;
}

.fp-product-detail-inner {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    align-items: flex-start;
}

.fp-detail-img-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.fp-detail-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: #ebebf0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(0,0,0,.09);
}

.fp-detail-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fp-detail-emoji-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.fp-detail-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #ffffff;
    border: 1.5px solid #d2d2d7;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fp-detail-expand-btn:hover {
    background: #f5f5f7;
    border-color: #007AFF;
    color: #007AFF;
}

.fp-detail-fields-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.fp-detail-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 6px;
}

.fp-optional {
    font-size: 13px;
    font-weight: 400;
    color: #86868b;
}

@media (max-width: 640px) {
    .fp-product-detail-inner {
        grid-template-columns: 1fr;
    }
    .fp-detail-img-col {
        flex-direction: row;
        align-items: center;
    }
    .fp-detail-img-wrap {
        width: 100px;
        aspect-ratio: 1/1;
        flex-shrink: 0;
    }
    .fp-detail-expand-btn {
        flex-shrink: 0;
    }
}

/* ================================================================
   REFERENCE BLOCK — Título "Personaliza tu cajita"
   ================================================================ */

.fp-reference-block-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.3px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

/* ================================================================
   LIGHTBOX — Vista previa de imagen ampliada
   ================================================================ */

.fp-img-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.fp-img-lightbox.active {
    display: flex;
}

.fp-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.fp-lightbox-box {
    position: relative;
    z-index: 1;
    max-width: min(96vw, 1400px);
    max-height: 96vh;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 40px 100px rgba(0,0,0,.8);
    animation: fpFadeIn 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-lightbox-box img {
    display: block;
    max-width: 96vw;
    max-height: 96vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.fp-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,.70);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    z-index: 2;
}

.fp-lightbox-close:hover {
    background: rgba(0,0,0,.90);
    transform: scale(1.08);
}

/* ================================================================
   TÍTULOS DE SECCIÓN — Paso 2 (consistentes, ~22px)
   ================================================================ */

/* "¿Qué tamaño deseas?" — reemplaza fp-size-label */
.fp-size-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 18px;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

/* Override antiguo fp-size-label si aún aparece */
.fp-size-label {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 18px;
    letter-spacing: -0.4px;
}

/* "Personaliza tu cajita" */
.fp-reference-block-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1d1d1f !important;
    letter-spacing: -0.4px !important;
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* "¿Qué te gustaría personalizar?" — dentro del detail panel */
.fp-detail-label {
    display: block;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1d1d1f !important;
    letter-spacing: -0.4px !important;
    margin-bottom: 12px !important;
    line-height: 1.2 !important;
}

.fp-detail-label .fp-optional {
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #86868b !important;
}

/* ================================================================
   TEXTAREA dentro del panel de detalle — igualar al resto de fields
   ================================================================ */

.fp-product-detail-panel textarea,
.fp-detail-fields-col textarea {
    width: 100%;
    padding: 16px 14px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    transition: all 0.2s ease;
    color: #1d1d1f;
    min-height: 130px;
    resize: vertical;
    box-sizing: border-box;
    padding-bottom: 32px; /* espacio para counter */
}

.fp-product-detail-panel textarea:focus,
.fp-detail-fields-col textarea:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.10);
}

/* Asegurar que el textarea-wrap funcione bien dentro del panel */
.fp-detail-fields-col .fp-textarea-wrap {
    position: relative;
}

.fp-detail-fields-col .fp-char-counter {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 11px;
    color: #9ca3af;
    pointer-events: none;
    user-select: none;
}

/* ===== Reveal secuencial paso 2 (estilo Apple) ===== */
.fp-section-hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.fp-section-revealed {
    display: block;
    opacity: 1;
    pointer-events: auto;
    animation: fpReveal 0.45s cubic-bezier(0.25,0.46,0.45,0.94) both;
}

@keyframes fpReveal {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RGPD Privacy Checkbox */
.fp-privacy-group {
    margin-top: 18px;
    margin-bottom: 6px;
}
.fp-privacy-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    transition: background 0.15s, border-color 0.15s;
}
.fp-privacy-label:hover {
    background: #f0f4ff;
    border-color: #a5b4fc;
}
.fp-privacy-text a {
    color: #6366f1;
    text-decoration: underline;
}
.fp-privacy-text a:hover {
    color: #4f46e5;
}
#fp-privacy-error {
    margin-top: 6px;
    padding: 0 4px;
}

.fp-summary-fixed-sizes {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f5;
}
.fp-summary-fixed-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #aeaeb2;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 6px;
}
.fp-summary-size-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.fp-summary-size-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -.01em;
}
.fp-summary-size-pill-desc {
    font-weight: 400;
    color: #8e8e93;
}
