/**
 * Gift Card LW - Estilos Frontend
 */

/* Contenedor principal de campos */
.gift-card-fields-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #f7f7f7;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.gift-card-fields-wrapper h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3em;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

/* Campos individuales */
.gift-card-field {
    margin-bottom: 20px;
}

.gift-card-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.gift-card-field label .required {
    color: #e74c3c;
    font-weight: bold;
}

.gift-card-field input[type="text"],
.gift-card-field input[type="tel"],
.gift-card-field textarea,
.gift-card-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.gift-card-field input:focus,
.gift-card-field textarea:focus,
.gift-card-field select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Campo de WhatsApp con código de país */
.whatsapp-field-group {
    display: flex;
    gap: 10px;
}

.whatsapp-field-group .country-select {
    flex: 0 0 200px;
    max-width: 200px;
}

.whatsapp-field-group input[type="tel"] {
    flex: 1;
}

/* Textarea de mensaje */
.gift-card-field textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.gift-card-field small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Contador de caracteres */
#gc_message_counter {
    font-weight: bold;
    color: #4CAF50;
}

/* Validación de campos */
.gift-card-field input:invalid,
.gift-card-field textarea:invalid {
    border-color: #e74c3c;
}

.gift-card-field input:valid,
.gift-card-field textarea:valid {
    border-color: #4CAF50;
}

/* Estilos para el carrito */
.woocommerce-cart .gift-card-info,
.woocommerce-checkout .gift-card-info {
    background: #f0f8ff;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.woocommerce-cart .gift-card-info dt,
.woocommerce-checkout .gift-card-info dt {
    font-weight: bold;
    color: #333;
}

.woocommerce-cart .gift-card-info dd,
.woocommerce-checkout .gift-card-info dd {
    margin-left: 0;
    margin-bottom: 5px;
    color: #666;
}

/* Botón de WhatsApp */
.whatsapp-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #25d366 !important;
    color: white !important;
    padding: 12px 24px !important;
    border-radius: 5px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    transition: all 0.3s ease !important;
}

.whatsapp-button:hover {
    background-color: #128c7e !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-button .dashicons {
    font-size: 20px;
}

/* Botón copiar código */
.copy-code-button {
    margin-left: 10px;
    background: #f0f0f0 !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    padding: 10px 20px !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-code-button:hover {
    background: #e0e0e0 !important;
}

/* Sección de Gift Card en página de agradecimiento */
.gift-card-whatsapp-section {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.gift-card-whatsapp-section h2 {
    color: white;
    margin-top: 0;
}

.gift-card-whatsapp-section .gift-card-item {
    background: white;
    color: #333;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.gift-card-whatsapp-section .gift-card-item h3 {
    margin-top: 0;
    color: #764ba2;
}

/* Responsive */
@media (max-width: 768px) {
    .whatsapp-field-group {
        flex-direction: column;
    }
    
    .whatsapp-field-group .country-select {
        max-width: 100%;
    }
    
    .gift-card-fields-wrapper {
        padding: 15px;
    }
    
    .whatsapp-button,
    .copy-code-button {
        display: block;
        width: 100%;
        margin: 10px 0 !important;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gift-card-fields-wrapper {
    animation: fadeIn 0.5s ease;
}

/* Loading state */
.gift-card-loading {
    opacity: 0.6;
    pointer-events: none;
}

.gift-card-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}