/* ========================================
   VARIABLES CSS - PALETA ROSA SAN VALENTÍN
   ======================================== */
:root {
    /* Colores principales */
    --pink-light: #FFB6C1;
    --pink-medium: #FFC0CB;
    --pink-fuchsia: #FF1493;
    --pink-deep: #DC143C;
    --white: #FFFFFF;
    --text-dark: #333333;
    --text-gray: #666666;
    
    /* Gradientes */
    --gradient-bg: linear-gradient(180deg, #FFB6C1 0%, #FFC0CB 50%, #FFB6C1 100%);
    --gradient-button: linear-gradient(135deg, #FF1493 0%, #FF69B4 100%);
    --gradient-input: rgba(255, 182, 193, 0.15);
    
    /* Sombras */
    --shadow-soft: 0 4px 15px rgba(255, 20, 147, 0.2);
    --shadow-medium: 0 6px 20px rgba(255, 20, 147, 0.3);
    --shadow-strong: 0 8px 25px rgba(255, 20, 147, 0.4);
    
    /* Transiciones */
    --transition-fast: 300ms ease-in-out;
    --transition-medium: 500ms ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f0f0f0;
    padding: 20px;
}

/* Contenedor principal del banner */
.banner-container {
    width: 300px;
    height: 600px;
    background: var(--gradient-bg);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(255, 20, 147, 0.25);
    position: relative;
    overflow: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Efecto de corazones de fondo (reemplaza estrellas) */
.banner-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 20, 147, 0.4), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 105, 180, 0.4), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 20, 147, 0.3), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 105, 180, 0.3), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 20, 147, 0.4), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(255, 105, 180, 0.3), transparent);
    background-size: 200% 200%;
    animation: twinkle 3s ease-in-out infinite;
    opacity: 0.5;
    pointer-events: none;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Header */
.banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    z-index: 10;
}

.logo {
    height: auto;
    width: 100px;
    max-height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Contador de wishlist */
.wishlist-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    font-size: 11px;
    font-weight: 600;
    color: var(--pink-fuchsia);
    transition: var(--transition-fast);
}

.wishlist-counter:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.heart-icon {
    font-size: 14px;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.counter-text {
    white-space: nowrap;
}

#wishlistCount {
    font-weight: 700;
    color: var(--pink-deep);
}

/* Personaje IA - Reyes Magos */
.ai-character {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    z-index: 10;
    transition: all 0.3s ease;
}

/* Compactar personaje cuando hay productos */
.products-container:not([style*="display: none"]) ~ * .ai-character,
.banner-container:has(.products-container:not([style*="display: none"])) .ai-character {
    margin-bottom: 8px;
}

.products-container:not([style*="display: none"]) ~ * .ai-character .reyes-magos-img,
.banner-container:has(.products-container:not([style*="display: none"])) .ai-character .reyes-magos-img {
    width: 160px;
}

.reyes-magos-img {
    width: 220px;
    height: auto;
    /* Contorno rosa romántico */
    filter: 
        drop-shadow(0 0 3px #FF1493)
        drop-shadow(0 0 6px rgba(255, 20, 147, 0.8))
        drop-shadow(0 0 12px rgba(255, 105, 180, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* Bocadillo de diálogo */
.dialogue-bubble {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    flex-shrink: 0;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
}

/* Estado compacto cuando hay productos */
.dialogue-bubble.compact {
    padding: 12px 16px;
    margin-bottom: 8px;
    font-size: 14px;
}

.dialogue-bubble.compact .greeting-text {
    font-size: 14px;
    margin-bottom: 6px;
}

.dialogue-bubble.compact .sub-text {
    font-size: 12px;
}

.dialogue-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid rgba(255, 255, 255, 0.95);
}

.greeting-text {
    color: #1a1a4d;
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.greeting-text strong {
    color: #003D7A;
}

.sub-text {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

/* CTA Section - Estilo WhatsApp */
.cta-section {
    margin-top: auto;
    z-index: 10;
    position: relative;
    flex-shrink: 0;
}

/* Cuando hay productos, ajustar CTA section */
.products-container:not([style*="display: none"]) ~ .cta-section {
    margin-top: 4px;
}

.input-container {
    display: flex;
    gap: 8px;
    background: var(--gradient-input);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    padding: 6px 6px 6px 16px;
    border: 2px solid rgba(255, 20, 147, 0.3);
    transition: var(--transition-fast);
}

.input-container:focus-within {
    border-color: rgba(255, 20, 147, 0.6);
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.3);
}

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dark);
    padding: 10px 5px;
    font-size: 15px;
    outline: none;
    min-width: 0;
}

.message-input::placeholder {
    color: rgba(102, 102, 102, 0.7);
}

/* Botón de acción (mic/enviar) estilo WhatsApp */
.action-button {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: var(--gradient-button);
    border: none;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-soft);
}

.action-button:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-medium);
}

.action-button:active {
    transform: scale(0.95);
}

/* Modo enviar - verde */
.action-button[data-mode="send"] {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.action-button[data-mode="send"]:hover {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* Modo escuchando - rojo pulsante */
.action-button.listening {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    animation: pulse 1s ease-in-out infinite;
}

.benefits-text {
    color: var(--pink-fuchsia);
    font-size: 12px;
    text-align: center;
    font-weight: 600;
    margin-top: 12px;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Animación de pulso para mic activo */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
    }
    50% { 
        transform: scale(1.15); 
        box-shadow: 0 6px 25px rgba(255, 0, 0, 0.8);
    }
}

/* Estado oculto para transición */
.hidden {
    display: none !important;
}

/* Productos flotantes decorativos */
.floating-products {
    position: absolute;
    bottom: 120px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    pointer-events: none;
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

/* Ocultar cuando hay productos */
.products-container:not([style*="display: none"]) ~ * .floating-products,
.banner-container:has(.products-container:not([style*="display: none"])) .floating-products {
    opacity: 0;
}

.product-icon {
    font-size: 24px;
    opacity: 0.3;
    animation: floatProduct 3s ease-in-out infinite;
}

.product-icon:nth-child(1) {
    animation-delay: 0s;
}

.product-icon:nth-child(2) {
    animation-delay: 0.5s;
}

.product-icon:nth-child(3) {
    animation-delay: 1s;
}

@keyframes floatProduct {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.3;
    }
    50% { 
        transform: translateY(-15px) rotate(10deg); 
        opacity: 0.6;
    }
}

/* Products Container - VERTICAL (mejor para 300px de ancho) */
.products-container {
    display: none;
    margin: 4px 0 8px 0;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
    z-index: 10;
    flex-shrink: 0;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

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

/* Product Card - VERTICAL (mejor legibilidad) */
.product-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-fast);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    min-height: 85px;
    animation: slideUp 0.4s ease-out both;
}

.product-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-strong);
    background: rgba(255, 255, 255, 1);
    z-index: 5;
}

.product-card:active {
    transform: translateY(-1px) scale(1.01);
}

.product-image {
    position: relative;
    width: 65px;
    height: 65px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--pink-light), var(--pink-medium));
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.discount-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF4444 100%);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    letter-spacing: 0.3px;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.product-name {
    color: var(--text-dark);
    font-size: 13px;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-brand {
    color: var(--text-gray);
    font-size: 11px;
    margin: 0;
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 6px 0;
}

.price-label {
    color: var(--text-gray);
    font-size: 11px;
    font-weight: 500;
}

.price-cta {
    color: var(--pink-fuchsia);
    font-size: 13px;
    font-weight: bold;
}

.product-store {
    color: var(--text-gray);
    font-size: 10px;
    margin: 0;
}

/* CTA Botón - Agregar a Wishlist */
.product-cta {
    background: var(--gradient-button);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 4px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.product-cta:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.product-cta:active {
    transform: scale(0.98);
}

.product-cta.added {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.product-cta .heart-icon-btn {
    font-size: 12px;
    transition: var(--transition-fast);
}

.product-cta:hover .heart-icon-btn {
    transform: scale(1.2);
}

/* Animación de corazón flotante al agregar */
@keyframes floatHeart {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-40px) scale(1.5);
        opacity: 0;
    }
}

.floating-heart {
    position: absolute;
    font-size: 20px;
    pointer-events: none;
    animation: floatHeart 1s ease-out forwards;
    z-index: 100;
}

/* Enviar wishlist por email button - MAYOR PROMINENCIA */
.email-wishlist-btn {
    width: 100%;
    padding: 12px;
    background: var(--gradient-button);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    margin-bottom: 0;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.email-wishlist-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.email-wishlist-btn:hover::before {
    width: 300px;
    height: 300px;
}

.email-wishlist-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-strong);
    background: linear-gradient(135deg, #FF69B4 0%, #FF1493 100%);
}

.email-wishlist-btn:active {
    transform: scale(0.98);
}

/* Scrollbar personalizado - estilo rosa */
.products-container::-webkit-scrollbar {
    width: 4px;
}

.products-container::-webkit-scrollbar-track {
    background: rgba(255, 182, 193, 0.1);
    border-radius: 2px;
}

.products-container::-webkit-scrollbar-thumb {
    background: rgba(255, 20, 147, 0.5);
    border-radius: 2px;
}

.products-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 20, 147, 0.8);
}

/* ========================================
   MODAL DE ENVÍO DE WISHLIST
   ======================================== */
.email-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.email-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.3s ease;
    z-index: 1001;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-gray);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.modal-header {
    margin-bottom: 20px;
    text-align: center;
}

.modal-header h2 {
    color: var(--pink-fuchsia);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-input,
.form-textarea {
    padding: 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--pink-fuchsia);
    box-shadow: 0 0 0 3px rgba(255, 20, 147, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.error-message {
    font-size: 12px;
    color: #ff4444;
    display: none;
}

.error-message.show {
    display: block;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--pink-fuchsia);
}

.form-checkbox label {
    font-size: 13px;
    color: var(--text-gray);
    cursor: pointer;
    margin: 0;
}

/* Preview del email */
.email-preview {
    background: linear-gradient(135deg, var(--pink-light), var(--pink-medium));
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
}

.preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--pink-deep);
    margin: 0 0 12px 0;
    text-align: center;
}

.preview-content {
    background: white;
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    max-height: 150px;
    overflow-y: auto;
}

.preview-product {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    align-items: center;
}

.preview-product:last-child {
    border-bottom: none;
}

.preview-product img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.preview-product-info {
    flex: 1;
    min-width: 0;
}

.preview-product-name {
    font-weight: 600;
    font-size: 11px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-product-brand {
    font-size: 10px;
    color: var(--text-gray);
}

/* Botones del modal */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.btn-send {
    width: 100%;
    padding: 14px;
    background: var(--gradient-button);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-send:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: var(--shadow-strong);
}

.btn-send:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-send:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
}

.btn-send.loading .btn-text {
    display: none;
}

.btn-send.loading .btn-loading {
    display: inline;
}

.btn-cancel {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-cancel:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

.btn-copy-link {
    width: 100%;
    padding: 10px;
    background: rgba(255, 20, 147, 0.1);
    border: 1px dashed var(--pink-fuchsia);
    border-radius: 8px;
    color: var(--pink-fuchsia);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-copy-link:hover {
    background: rgba(255, 20, 147, 0.15);
}

/* Modal de éxito */
.success-modal .modal-content {
    text-align: center;
    padding: 32px 24px;
}

.success-content {
    max-width: 360px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-content h2 {
    color: var(--pink-fuchsia);
    font-size: 24px;
    margin: 0 0 12px 0;
}

.success-message {
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Responsive para móviles */
@media (max-width: 320px) {
    .banner-container {
        width: 280px;
        height: 560px;
    }
    
    .modal-content {
        padding: 20px;
        max-height: 85vh;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
}

/* Responsivo - para testing en diferentes tamaños */
@media (max-width: 320px) {
    .banner-container {
        width: 280px;
        height: 560px;
    }
}
