/*
 * Fenixars Domain Finder
 * Estilos del buscador frontend.
 *
 * @package FenixarsDomainFinder
 */

/* =========================================
   CONTENEDOR PRINCIPAL
========================================= */

.fdf-container {
    --fdf-primary: #2563eb;
    --fdf-primary-dark: #1d4ed8;
    --fdf-success: #15803d;
    --fdf-danger: #dc2626;
    --fdf-warning: #b45309;
    --fdf-text: #1e293b;
    --fdf-muted: #64748b;
    --fdf-border: #e2e8f0;
    --fdf-background: #ffffff;

    width: 100%;
    max-width: 1050px;
    margin: 30px auto;
    color: var(--fdf-text);
    font-family: inherit;
    box-sizing: border-box;
}

.fdf-container *,
.fdf-container *::before,
.fdf-container *::after {
    box-sizing: border-box;
}

/* =========================================
   ENCABEZADO
========================================= */

.fdf-header {
    margin-bottom: 25px;
    text-align: center;
}

.fdf-header h2 {
    margin: 0 0 12px;
    color: var(--fdf-text);
    font-size: clamp(25px, 4vw, 36px);
    font-weight: 750;
    line-height: 1.2;
}

.fdf-header p {
    max-width: 650px;
    margin: 0 auto;
    color: var(--fdf-muted);
    font-size: 16px;
    line-height: 1.6;
}

/* =========================================
   PANEL DE BÚSQUEDA
========================================= */

.fdf-search-panel {
    padding: 30px;
    background: var(--fdf-background);
    border: 1px solid var(--fdf-border);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.fdf-search-panel > label {
    display: block;
    margin-bottom: 10px;
    color: var(--fdf-text);
    font-size: 15px;
    font-weight: 700;
}

/* =========================================
   CAMPO DE DOMINIOS
========================================= */

.fdf-domain-input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 105px;
    padding: 15px 17px;
    resize: vertical;
    color: var(--fdf-text);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fdf-domain-input::placeholder {
    color: #94a3b8;
}

.fdf-domain-input:focus {
    border-color: var(--fdf-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.fdf-help {
    margin: 8px 0 20px;
    color: var(--fdf-muted);
    font-size: 13px;
}

/* =========================================
   SELECCIÓN DE EXTENSIONES
========================================= */

.fdf-tld-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 20px 0 25px;
}

.fdf-tld-title {
    margin-right: 5px;
    color: var(--fdf-text);
    font-size: 14px;
    font-weight: 700;
}

.fdf-tld-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    color: #334155;
    background: #f8fafc;
    border: 1px solid var(--fdf-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.fdf-tld-option:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.fdf-tld-option input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--fdf-primary);
    cursor: pointer;
}

.fdf-tld-option:focus-within {
    outline: 2px solid rgba(37, 99, 235, .35);
    outline-offset: 2px;
}

/* =========================================
   BOTÓN DE BÚSQUEDA
========================================= */

.fdf-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    min-height: 48px;
    padding: 12px 25px;
    color: #fff;
    background: var(--fdf-primary);
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
}

.fdf-search-button:hover {
    color: #fff;
    background: var(--fdf-primary-dark);
    transform: translateY(-1px);
}

.fdf-search-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.3);
    outline-offset: 3px;
}

.fdf-search-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* =========================================
   MENSAJES DE ESTADO
========================================= */

.fdf-status {
    display: none;
    margin-top: 18px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.fdf-status:not(:empty) {
    display: block;
}

.fdf-status.fdf-loading {
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.fdf-status.fdf-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.fdf-status.fdf-success {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

/* =========================================
   CONTENEDOR DE RESULTADOS
========================================= */

.fdf-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.fdf-results:empty {
    display: none;
}

/* Cuadrícula interna de tarjetas */

.fdf-results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    grid-column: 1 / -1;
}

/* =========================================
   TARJETAS DE RESULTADOS
========================================= */

.fdf-result-card {
    min-width: 0;
    padding: 20px;
    overflow-wrap: anywhere;
    background: #fff;
    border: 1px solid var(--fdf-border);
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.035);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fdf-result-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
}

/* =========================================
   ENCABEZADO DE TARJETA
   Dominio + botón Comprar
========================================= */

.fdf-result-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.fdf-result-heading-row .fdf-result-domain {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.fdf-result-domain {
    margin: 0 0 12px;
    color: var(--fdf-text);
    font-size: 19px;
    font-weight: 750;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* =========================================
   BOTÓN COMPRAR
========================================= */

.fdf-buy-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 16px;
    color: #fff;
    background: var(--fdf-primary);
    border: 1px solid var(--fdf-primary);
    border-radius: 7px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.fdf-buy-button:hover {
    color: #fff;
    background: var(--fdf-primary-dark);
    border-color: var(--fdf-primary-dark);
    transform: translateY(-1px);
}

.fdf-buy-button:focus-visible {
    outline: 2px solid var(--fdf-primary);
    outline-offset: 3px;
}

/* =========================================
   ESTADO DEL DOMINIO
========================================= */

.fdf-result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.fdf-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.fdf-badge-available {
    color: #166534;
    background: #dcfce7;
}

.fdf-badge-unavailable {
    color: #991b1b;
    background: #fee2e2;
}

.fdf-badge-unknown {
    color: #475569;
    background: #e2e8f0;
}

.fdf-badge-premium {
    color: #92400e;
    background: #fef3c7;
}

/* =========================================
   INFORMACIÓN DE PRECIOS PREMIUM
========================================= */

.fdf-result-price {
    margin: 12px 0;
    color: var(--fdf-text);
    font-size: 14px;
    line-height: 1.6;
}

.fdf-result-price strong {
    font-size: 16px;
    font-weight: 750;
}

.fdf-result-note {
    margin: 8px 0 0;
    color: var(--fdf-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* =========================================
   BARRA DE RESULTADOS
========================================= */

.fdf-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: 20px 0;
}

.fdf-toolbar-title {
    color: var(--fdf-text);
    font-size: 16px;
    font-weight: 700;
}

.fdf-empty-message {
    grid-column: 1 / -1;
    padding: 25px;
    color: var(--fdf-muted);
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
}

/* =========================================
   ACCESIBILIDAD
========================================= */

.fdf-container button:focus-visible,
.fdf-container input:focus-visible,
.fdf-container textarea:focus-visible,
.fdf-container a:focus-visible {
    outline: 2px solid var(--fdf-primary);
    outline-offset: 2px;
}

.fdf-container [aria-live] {
    overflow-wrap: anywhere;
}

/* =========================================
   TABLET
========================================= */

@media (max-width: 768px) {

    .fdf-container {
        margin: 20px auto;
    }

    .fdf-search-panel {
        padding: 22px;
    }

    .fdf-results {
        grid-template-columns: 1fr;
    }

    .fdf-results-grid {
        grid-template-columns: 1fr;
    }

    .fdf-header h2 {
        font-size: 28px;
    }

}

/* =========================================
   MÓVILES
========================================= */

@media (max-width: 480px) {

    .fdf-container {
        margin: 15px auto;
    }

    .fdf-search-panel {
        padding: 17px;
        border-radius: 12px;
    }

    .fdf-header {
        margin-bottom: 20px;
    }

    .fdf-header h2 {
        font-size: 25px;
    }

    .fdf-header p {
        font-size: 14px;
    }

    .fdf-tld-section {
        gap: 8px;
    }

    .fdf-tld-title {
        width: 100%;
    }

    .fdf-tld-option {
        padding: 7px 10px;
        font-size: 13px;
    }

    .fdf-search-button {
        width: 100%;
    }

    .fdf-result-card {
        padding: 16px;
    }

    .fdf-result-domain {
        font-size: 17px;
    }

    .fdf-result-heading-row {
        align-items: center;
    }

    .fdf-buy-button {
        min-height: 34px;
        padding: 7px 12px;
    }

}

/* =========================================
   AJUSTES RESPONSIVE EXTRA
========================================= */

@media (max-width: 600px) {

    .fdf-search-panel {
        padding: 18px;
    }

    .fdf-search-button {
        width: 100%;
    }

}