/* Estilos para el chat widget */
.iav-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.iav-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    font-size: 28px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iav-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

#iav-cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
    display: none;
    font-weight: bold;
}

.iav-chat-box {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    overflow: hidden;
    transition: all 0.3s ease;
}

.iav-chat-box.active {
    display: flex;
    flex-direction: column;
}

.iav-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.iav-chat-header .close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
}

.iav-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
}

.iav-message {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.5;
    word-wrap: break-word;
    animation: fadeInUp 0.3s ease;
    white-space: pre-wrap;
    font-size: 14px;
}

.iav-message.user {
    background: #667eea;
    color: white;
    margin-left: auto;
}

.iav-message.bot {
    background: white;
    color: #333;
    margin-right: auto;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.iav-message.typing {
    opacity: 0.7;
    font-style: italic;
}

.iav-chat-input-area {
    padding: 12px 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.iav-chat-input-area input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.iav-chat-input-area input:focus {
    border-color: #667eea;
}

.iav-chat-input-area button {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: 500;
}

.iav-chat-input-area button:hover {
    transform: scale(1.05);
}

/* Product Card */
.iav-product-card {
    display: flex;
    gap: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.iav-product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.iav-product-info {
    flex: 1;
}

.iav-product-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.iav-product-price {
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
    margin: 5px 0;
}

.iav-product-stock {
    font-size: 12px;
    color: #666;
    margin: 5px 0;
}

.iav-add-to-cart-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.iav-add-to-cart-btn:hover {
    background: #27ae60;
}

.iav-add-to-cart-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Cart Summary */
.iav-cart-summary {
    padding: 10px;
}

.iav-cart-summary h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.iav-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.iav-cart-item span:first-child {
    flex: 1;
}

.iav-remove-item {
    background: none;
    border: none;
    color: #ff4757;
    cursor: pointer;
    font-size: 14px;
    padding: 0 5px;
}

.iav-cart-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 2px solid #667eea;
    margin-top: 10px;
    font-size: 16px;
}

.iav-checkout-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
    transition: transform 0.2s;
}

.iav-checkout-btn:hover {
    transform: scale(1.02);
}

.iav-clear-cart-btn {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Checkout */
.iav-checkout-info {
    padding: 10px;
}

.iav-checkout-info h3 {
    margin: 0 0 10px 0;
    color: #333;
    text-align: center;
}

.iav-order-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.iav-order-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 2px solid #667eea;
    margin: 10px 0;
    font-size: 18px;
}

.iav-payment-method {
    background: #f0f9ff;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    border: 1px solid #b8d4f0;
}

.iav-payment-method h4 {
    margin: 0 0 8px 0;
    color: #1a56db;
}

.iav-payment-method p {
    margin: 5px 0;
    font-size: 14px;
}

.iav-customer-info {
    margin: 10px 0;
}

.iav-input-field {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
}

.iav-input-field:focus {
    border-color: #667eea;
    outline: none;
}

.iav-receipt-upload {
    margin: 10px 0;
    text-align: center;
}

.iav-file-upload {
    display: inline-block;
    padding: 10px 20px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.iav-file-upload:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.iav-file-upload input[type="file"] {
    display: none;
}

#iav-file-name {
    display: block;
    margin: 10px 0;
    font-size: 13px;
    color: #666;
}

.iav-submit-order-btn {
    width: 100%;
    padding: 12px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s;
    margin-top: 10px;
}

.iav-submit-order-btn:hover {
    background: #27ae60;
}

/* WhatsApp link styling */
.iav-message a {
    color: #25D366;
    text-decoration: none;
    font-weight: 600;
}

.iav-message a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
.iav-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.iav-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.iav-chat-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 480px) {
    .iav-chat-box {
        width: 320px;
        height: 450px;
        right: -10px;
    }
    
    .iav-product-card {
        flex-direction: column;
        align-items: center;
    }
    
    .iav-product-image {
        width: 100%;
        height: auto;
        max-height: 150px;
    }
}