/* =============================================================================
   WooCommerce CyberSource – Formulario de tarjeta
   ============================================================================= */

/* --------------------------------------------------------------------------
   Contenedor principal
   -------------------------------------------------------------------------- */
.cs-card-form {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 22px 16px;
    margin-top: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

/* --------------------------------------------------------------------------
   Fila de marcas aceptadas
   -------------------------------------------------------------------------- */
.cs-brands-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
}

.cs-brands-label {
    font-size: 11px;
    color: #a0aec0;
    margin-right: 4px;
    white-space: nowrap;
}

.cs-brand-chip {
    width: 44px;
    height: 28px;
    border-radius: 4px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid rgba(0,0,0,.08);
    opacity: .3;
    transition: opacity .25s, transform .15s;
    flex-shrink: 0;
}

.cs-brand-chip.cs-active {
    opacity: 1;
    transform: scale(1.08);
}

/* Visa */
.cs-brand-chip[data-brand="visa"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 28'%3E%3Crect width='44' height='28' rx='4' fill='%231a1f71'/%3E%3Ctext x='22' y='19' text-anchor='middle' font-family='Arial%2Csans-serif' font-size='11' font-weight='bold' font-style='italic' fill='white'%3EVISA%3C/text%3E%3C/svg%3E");
}

/* Mastercard */
.cs-brand-chip[data-brand="mastercard"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 28'%3E%3Crect width='44' height='28' rx='4' fill='%23252525'/%3E%3Ccircle cx='17' cy='14' r='8' fill='%23eb001b'/%3E%3Ccircle cx='27' cy='14' r='8' fill='%23f79e1b'/%3E%3Cpath d='M22 7.5a8 8 0 0 1 0 13 8 8 0 0 1 0-13z' fill='%23ff5f00'/%3E%3C/svg%3E");
}

/* Amex */
.cs-brand-chip[data-brand="amex"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 28'%3E%3Crect width='44' height='28' rx='4' fill='%232557d6'/%3E%3Ctext x='22' y='19' text-anchor='middle' font-family='Arial%2Csans-serif' font-size='10' font-weight='bold' fill='white'%3EAMEX%3C/text%3E%3C/svg%3E");
}

/* Discover */
.cs-brand-chip[data-brand="discover"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 28'%3E%3Crect width='44' height='28' rx='4' fill='%23fff'/%3E%3Ccircle cx='30' cy='14' r='9' fill='%23f76f20'/%3E%3Ctext x='10' y='19' font-family='Arial%2Csans-serif' font-size='7' font-weight='bold' fill='%23231f20'%3EDISCOVER%3C/text%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Grupo de campo
   -------------------------------------------------------------------------- */
.cs-field-group {
    margin-bottom: 14px;
}

.cs-field-group:last-child {
    margin-bottom: 0;
}

.cs-field-group > label {
    display: flex !important;
    align-items: center;
    gap: 4px;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #4a5568 !important;
    text-transform: uppercase !important;
    letter-spacing: .4px !important;
    margin-bottom: 6px !important;
    float: none !important;
    width: auto !important;
}

.cs-field-group > label .required {
    color: #e53e3e;
    font-style: normal;
}

/* --------------------------------------------------------------------------
   Input wrapper (para el ícono interno)
   -------------------------------------------------------------------------- */
.cs-input-wrap {
    position: relative;
    display: block;
}

/* --------------------------------------------------------------------------
   Inputs – override de WooCommerce y temas
   -------------------------------------------------------------------------- */
.cs-card-form input[type="tel"] {
    display: block !important;
    width: 100% !important;
    padding: 11px 42px 11px 13px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-family: 'Courier New', Courier, monospace !important;
    color: #2d3748 !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    letter-spacing: .06em !important;
    height: auto !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

/* Expiry e inputs sin ícono derecho */
.cs-field-group.cs-no-icon input[type="tel"] {
    padding-right: 13px !important;
}

.cs-card-form input[type="tel"]:focus {
    border-color: #4299e1 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, .15) !important;
}

/* Estado válido */
.cs-card-form input[type="tel"].cs-valid {
    border-color: #48bb78 !important;
    background: #f0fff4 !important;
}

.cs-card-form input[type="tel"].cs-valid:focus {
    box-shadow: 0 0 0 3px rgba(72, 187, 120, .15) !important;
}

/* Estado error */
.cs-card-form input[type="tel"].cs-error {
    border-color: #fc8181 !important;
    background: #fff5f5 !important;
}

.cs-card-form input[type="tel"].cs-error:focus {
    box-shadow: 0 0 0 3px rgba(252, 129, 129, .15) !important;
}

/* --------------------------------------------------------------------------
   Ícono dentro del input
   -------------------------------------------------------------------------- */
.cs-input-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
}

/* Badge de marca en el campo número */
.cs-brand-badge {
    display: block;
    width: 34px;
    height: 22px;
    border-radius: 3px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image .2s;
}

/* Ícono lock para CVV */
.cs-lock-icon {
    color: #a0aec0;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   Fila de dos columnas (vencimiento + CVV)
   -------------------------------------------------------------------------- */
.cs-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   Mensaje de error inline por campo
   -------------------------------------------------------------------------- */
.cs-field-msg {
    font-size: 11px;
    margin-top: 4px;
    min-height: 16px;
    transition: opacity .2s;
}

.cs-field-msg:empty {
    opacity: 0;
}

.cs-field-msg.cs-msg-error {
    color: #e53e3e;
}

.cs-field-msg.cs-msg-ok {
    color: #38a169;
}

/* --------------------------------------------------------------------------
   Pie: indicador de seguridad
   -------------------------------------------------------------------------- */
.cs-secure-line {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f4f8;
    font-size: 11px;
    color: #a0aec0;
}

.cs-secure-line svg {
    flex-shrink: 0;
    color: #68d391;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .cs-card-form {
        padding: 14px 14px 12px;
    }

    .cs-field-row {
        gap: 8px;
    }

    .cs-card-form input[type="tel"] {
        font-size: 14px !important;
    }
}
