/* ======================================================================
   SISTEMA DE GARANTÍAS Y DEVOLUCIONES - ESTILOS
   Global Pacific S.A.S.
   ====================================================================== */

/* Contenedor Principal */
.gp-warranty-form-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Header del Formulario */
.gp-form-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #0073aa;
}

.gp-form-header h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
}

.gp-form-header p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

.required {
    color: #d9534f;
    font-weight: bold;
}

/* Formulario */
.gp-form {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Secciones del Formulario */
.gp-form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.gp-form-section:last-of-type {
    border-bottom: none;
}

.gp-section-title {
    font-size: 22px;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.gp-section-icon {
    font-size: 28px;
    margin-right: 12px;
}

/* Filas y Columnas */
.gp-form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.gp-form-group {
    padding: 0 10px;
    margin-bottom: 20px;
}

.gp-col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.gp-col-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

@media (max-width: 768px) {
    .gp-col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Labels */
.gp-form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Inputs y Textareas */
.gp-form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.gp-form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.gp-form-control::placeholder {
    color: #999;
}

textarea.gp-form-control {
    resize: vertical;
    min-height: 120px;
}

/* File Input */
.gp-form-control-file {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gp-form-control-file:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

/* Help Text */
.gp-help-text {
    font-size: 13px;
    color: #666;
    margin: 5px 0 10px 0;
    font-style: italic;
}

/* Búsqueda de Productos */
.gp-product-search-wrapper {
    position: relative;
}

.gp-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #0073aa;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: none;
}

.gp-search-results.active {
    display: block;
}

.gp-search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s ease;
}

.gp-search-result-item:hover {
    background: #f0f8ff;
}

.gp-search-result-item:last-child {
    border-bottom: none;
}

.gp-search-result-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    border: 1px solid #ddd;
}

.gp-search-result-info {
    flex: 1;
}

.gp-search-result-info h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
    color: #333;
}

.gp-search-result-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.gp-search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.gp-search-loading {
    padding: 20px;
    text-align: center;
    color: #0073aa;
}

/* Producto Seleccionado */
.gp-selected-product {
    margin-top: 20px;
}

.gp-product-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f0f8ff;
    border: 2px solid #0073aa;
    border-radius: 5px;
    position: relative;
}

.gp-product-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
    border: 1px solid #ddd;
}

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

.gp-product-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.gp-product-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.gp-btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #d9534f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.3s ease;
}

.gp-btn-remove:hover {
    background: #c9302c;
    transform: scale(1.1);
}

/* Preview de Archivos */
.gp-file-preview {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gp-file-preview-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.gp-file-preview-item span {
    margin-right: 8px;
}

.gp-file-preview-remove {
    background: none;
    border: none;
    color: #d9534f;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin-left: 8px;
}

/* Botones */
.gp-form-actions {
    text-align: center;
    margin-top: 30px;
}

.gp-btn {
    display: inline-block;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.gp-btn-primary {
    background: #0073aa;
    color: white;
}

.gp-btn-primary:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.gp-btn-primary:active {
    transform: translateY(0);
}

.gp-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.gp-btn-loader {
    display: none;
}

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

.gp-btn.loading .gp-btn-loader {
    display: inline-block;
}

/* Spinner */
.gp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: gp-spin 0.8s linear infinite;
}

@keyframes gp-spin {
    to { transform: rotate(360deg); }
}

/* Mensajes */
.gp-form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    font-size: 15px;
    line-height: 1.6;
}

.gp-form-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.gp-form-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.gp-form-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Responsive */
@media (max-width: 768px) {
    .gp-form {
        padding: 25px 20px;
    }
    
    .gp-form-header h2 {
        font-size: 24px;
    }
    
    .gp-section-title {
        font-size: 18px;
    }
    
    .gp-product-card {
        flex-direction: column;
        text-align: center;
    }
    
    .gp-product-card img {
        margin: 0 0 15px 0;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gp-search-results.active {
    animation: fadeIn 0.3s ease;
}

.gp-selected-product {
    animation: fadeIn 0.3s ease;
}

/* Estados de Validación */
.gp-form-control.error {
    border-color: #d9534f;
}

.gp-form-control.success {
    border-color: #5cb85c;
}

.gp-error-message {
    color: #d9534f;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.gp-error-message.active {
    display: block;
}

/* ======================================================================
   LOADING / SPINNER
   ====================================================================== */

/* Overlay de loading */
.gp-form-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.gp-form-loading-overlay.active {
    display: flex;
}

/* Contenedor del spinner */
.gp-loading-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 300px;
}

/* Spinner animado */
.gp-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Texto del loading */
.gp-loading-text {
    font-size: 18px;
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
}

.gp-loading-subtext {
    font-size: 14px;
    color: #666;
}

/* Botón en estado loading */
.gp-submit-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
    opacity: 0.7;
}

.gp-submit-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Deshabilitar formulario durante envío */
.gp-form.submitting {
    pointer-events: none;
    opacity: 0.6;
}

.gp-form.submitting .gp-form-control {
    background-color: #f5f5f5;
}
