/**
 * APG Withdrawal for WooCommerce — Estilos Alumedida
 * Archivo: apg-withdrawal.css
 * Encolado desde: alumedida-core/includes/withdrawal.php
 * Selectores corregidos: .woocommerce.apg-withdrawal-form-wrapper (sin espacio)
 */

/* ===========================================
   1. CONTENEDOR PRINCIPAL
   =========================================== */

div.woocommerce.apg-withdrawal-form-wrapper {
    max-width: 720px;
}

/* ===========================================
   2. NOTICE DE ERROR
   =========================================== */

div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-order-error {
    background: #fff0f0;
    border: none;
    border-left: 3px solid #E24B4A;
    border-radius: 0 8px 8px 0;
    color: #A32D2D;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ===========================================
   3. NOTICE DE INFO (14 días)
   =========================================== */

div.woocommerce.apg-withdrawal-form-wrapper .woocommerce-info {
    background: #f0f7ff !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-left: 3px solid #2388CC !important;
    border-radius: 0 8px 8px 0;
    color: #172140 !important;
    padding: 12px 16px !important;
    font-size: 14px;
    margin-bottom: 20px;
}

div.woocommerce.apg-withdrawal-form-wrapper .woocommerce-info::before {
    display: none !important;
}

/* ===========================================
   4. ENLACE MODELO OFICIAL
   =========================================== */

div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-model-link {
    margin-bottom: 8px;
}

div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-model-link a,
div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-model-link span {
    color: #555;
    font-size: 14px;
}

div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-model-link a.button {
    background: transparent !important;
    color: #2388CC !important;
    border: 1px solid #2388CC !important;
    border-radius: 6px !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    margin-left: 8px;
    display: inline-block;
}

div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-model-link a.button:hover {
    background: #2388CC !important;
    color: #fff !important;
}

/* ===========================================
   5. TARJETA DEL FORMULARIO
   =========================================== */

div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-form {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 28px 32px;
    margin-top: 20px;
}

div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-form h2 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

/* ===========================================
   6. GRID DE CAMPOS
   =========================================== */

div.woocommerce.apg-withdrawal-form-wrapper .woocommerce-address-fields__field-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

/* Campos a ancho completo */
div.woocommerce.apg-withdrawal-form-wrapper #scope_field,
div.woocommerce.apg-withdrawal-form-wrapper #details_field,
div.woocommerce.apg-withdrawal-form-wrapper #products_field,
div.woocommerce.apg-withdrawal-form-wrapper #acceptance_field,
div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-checkbox,
div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-honeypot,
div.woocommerce.apg-withdrawal-form-wrapper .form-row:last-child {
    grid-column: 1 / -1;
}

/* ===========================================
   7. FILAS Y LABELS
   =========================================== */

div.woocommerce.apg-withdrawal-form-wrapper .form-row {
    margin-bottom: 16px;
    padding: 0;
}

div.woocommerce.apg-withdrawal-form-wrapper .form-row label {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #555;
    margin-bottom: 5px;
}

div.woocommerce.apg-withdrawal-form-wrapper .form-row label .required {
    color: #2388CC;
}

/* ===========================================
   8. INPUTS, SELECT, TEXTAREA
   =========================================== */

div.woocommerce.apg-withdrawal-form-wrapper input[type="text"],
div.woocommerce.apg-withdrawal-form-wrapper input[type="email"],
div.woocommerce.apg-withdrawal-form-wrapper input[type="tel"],
div.woocommerce.apg-withdrawal-form-wrapper input[type="number"],
div.woocommerce.apg-withdrawal-form-wrapper select,
div.woocommerce.apg-withdrawal-form-wrapper textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(0, 0, 0, 0.18) !important;
    border-radius: 8px !important;
    padding: 9px 12px !important;
    font-size: 14px !important;
    font-family: 'DM Sans', sans-serif !important;
    color: #1a1a1a !important;
    background: #ffffff !important;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
}

div.woocommerce.apg-withdrawal-form-wrapper input[type="text"]:focus,
div.woocommerce.apg-withdrawal-form-wrapper input[type="email"]:focus,
div.woocommerce.apg-withdrawal-form-wrapper input[type="tel"]:focus,
div.woocommerce.apg-withdrawal-form-wrapper input[type="number"]:focus,
div.woocommerce.apg-withdrawal-form-wrapper select:focus,
div.woocommerce.apg-withdrawal-form-wrapper textarea:focus {
    border-color: #2388CC !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(35, 136, 204, 0.12) !important;
}

/* Flecha personalizada en select */
div.woocommerce.apg-withdrawal-form-wrapper select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 36px !important;
}

div.woocommerce.apg-withdrawal-form-wrapper textarea {
    min-height: 100px;
    resize: vertical;
}

/* Validación inválida */
div.woocommerce.apg-withdrawal-form-wrapper .woocommerce-invalid input,
div.woocommerce.apg-withdrawal-form-wrapper .woocommerce-invalid select,
div.woocommerce.apg-withdrawal-form-wrapper .woocommerce-invalid textarea {
    border-color: #E24B4A !important;
}

/* ===========================================
   9. CHECKBOX
   =========================================== */

div.woocommerce.apg-withdrawal-form-wrapper #acceptance_field label,
div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-checkbox label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    line-height: 1.5;
}

div.woocommerce.apg-withdrawal-form-wrapper #acceptance_field input[type="checkbox"],
div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-checkbox input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    margin-top: 2px;
    accent-color: #2388CC;
    padding: 0 !important;
    box-shadow: none !important;
    flex-shrink: 0;
}

/* ===========================================
   10. BOTÓN DE ENVÍO
   =========================================== */

div.woocommerce.apg-withdrawal-form-wrapper button[type="submit"],
div.woocommerce.apg-withdrawal-form-wrapper input[type="submit"] {
    background: #2388CC !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 11px 26px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: 'DM Sans', sans-serif !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    margin-top: 4px;
    box-shadow: none !important;
}

div.woocommerce.apg-withdrawal-form-wrapper button[type="submit"]:hover,
div.woocommerce.apg-withdrawal-form-wrapper input[type="submit"]:hover {
    background: #1a6fa3 !important;
}

/* ===========================================
   11. RESPONSIVE
   =========================================== */

@media (max-width: 600px) {
    div.woocommerce.apg-withdrawal-form-wrapper .woocommerce-address-fields__field-wrapper {
        grid-template-columns: 1fr;
    }

    div.woocommerce.apg-withdrawal-form-wrapper .apg-withdrawal-form {
        padding: 20px 16px;
    }
}
