/* Convertidor de Peso - Estilos Minimalistas */

/* Ocultar header y footer del tema */
.site-header,
.site-footer,
.wp-block-template-part {
    display: none !important;
}

body.page-template-default {
    margin: 0;
    padding: 0;
}

/* === HEADER CON LOGO Y BUSCADOR === */
.header-principal {
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo-convertidor {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.3rem;
    color: #1a1a1a;
    white-space: nowrap;
    transition: transform 0.2s ease;
}

.logo-convertidor:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text-main {
    font-size: 1.1rem;
}

.logo-text-sub {
    font-size: 0.65rem;
    color: #666;
    font-weight: 500;
}

/* Buscador */
.buscador-wrapper {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.buscador-input {
    width: 100%;
    padding: 12px 45px 12px 40px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
}

.buscador-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.buscador-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.buscador-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    display: none;
}

.buscador-clear:hover {
    color: #333;
}

.buscador-input:not(:placeholder-shown) + .buscador-icon + .buscador-clear {
    display: block;
}

.buscador-resultados {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.buscador-resultados.visible {
    display: block;
}

.resultado-categoria {
    padding: 10px 20px;
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}

.resultado-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resultado-item:last-child {
    border-bottom: none;
}

.resultado-item:hover {
    background: #f8f9fa;
}

.resultado-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.resultado-item.disabled:hover {
    background: white;
}

.resultado-principal {
    font-weight: 600;
    color: #1a1a1a;
}

.resultado-secundario {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

.resultado-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.resultado-badge.disponible {
    background: #4caf50;
}

/* === MENÚ DE NAVEGACIÓN === */
.menu-convertidores {
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
    padding: 0;
    margin: 0 0 40px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.menu-convertidores-scroll {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 20px;
    gap: 10px;
}

.menu-item {
    padding: 12px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    border-radius: 8px;
    background: #f8f9fa;
}

.menu-item:hover {
    color: #4a90e2;
    background: #e8f0fe;
    transform: translateY(-2px);
}

.menu-item.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.menu-item.disabled {
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.menu-item.disabled:hover {
    background: #f8f9fa;
    transform: none;
}

/* === GRID DE CONVERTIDORES (INDEX) === */
.grid-convertidores-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    min-height: 100vh;
}

.grid-header {
    text-align: center;
    margin-bottom: 50px;
}

.grid-header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
    margin-top: 0;
}

.grid-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin: 0;
}

.grid-convertidores {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.grid-item {
    background: #fff;
    border-radius: 16px;
    padding: 35px 25px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #4a90e2;
}

.grid-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.grid-item.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #e0e0e0;
}

.grid-item-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.grid-item h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.grid-item p {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.proximamente-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* === ESTILOS CONVERTIDOR === */

.convertidor-peso-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
}

/* Header */
.convertidor-header {
    text-align: center;
    margin-bottom: 40px;
}

.convertidor-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    margin-top: 0;
}

.subtitulo {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* Ocultar título duplicado de WordPress */
.entry-title,
.page-title {
    display: none !important;
}

/* Caja del convertidor */
.convertidor-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
    margin-bottom: 50px;
}

/* Input Group - FIJO PARA DESKTOP */
.input-group {
    display: grid;
    grid-template-columns: 2fr auto 2fr;
    gap: 20px;
    align-items: end;
    margin-bottom: 30px;
}

.input-wrapper,
.select-wrapper {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Importante para evitar overflow */
}

.input-wrapper label,
.select-wrapper label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}

#cantidad-input,
#unidad-desde,
#unidad-hacia {
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

#cantidad-input:focus,
#unidad-desde:focus,
#unidad-hacia:focus {
    border-color: #4a90e2;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

#unidad-desde,
#unidad-hacia {
    cursor: pointer;
}

/* Botón de intercambio */
.swap-button-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

#swap-button {
    background: #4a90e2;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#swap-button:hover {
    background: #357abd;
    transform: rotate(180deg);
}

#swap-button:active {
    transform: rotate(180deg) scale(0.95);
}

/* Resultado */
.resultado-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: white;
}

.resultado-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
    font-weight: 500;
}

.resultado-valor {
    font-size: 2.5rem;
    font-weight: 700;
    word-break: break-all;
}

.resultado-unidad {
    font-size: 1.5rem;
    margin-left: 10px;
    opacity: 0.9;
}

/* Contenido SEO */
.contenido-seo {
    margin-top: 60px;
}

.contenido-seo h2 {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 20px;
    font-weight: 700;
}

.contenido-seo h3 {
    font-size: 1.4rem;
    color: #333;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

.descripcion-conversion,
.info-unidades {
    margin-bottom: 40px;
}

.descripcion-conversion p,
.info-unidades p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 15px;
}

/* Tabla de conversiones */
.tabla-conversiones {
    margin: 40px 0;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

.tabla-conversiones h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.tabla-conversiones table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tabla-conversiones thead {
    background: #4a90e2;
    color: white;
}

.tabla-conversiones th,
.tabla-conversiones td {
    padding: 14px 20px;
    text-align: left;
}

.tabla-conversiones th {
    font-weight: 600;
    font-size: 0.95rem;
}

.tabla-conversiones tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.tabla-conversiones tbody tr:last-child {
    border-bottom: none;
}

.tabla-conversiones tbody tr:hover {
    background: #f8f9fa;
}

.tabla-conversiones td {
    color: #333;
    font-size: 0.95rem;
}

/* FAQs */
.faqs {
    margin-top: 50px;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
}

.faqs h2 {
    margin-top: 0;
    margin-bottom: 30px;
}

.faq-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item h3 {
    font-size: 1.15rem;
    color: #1a1a1a;
    margin-top: 0;
    margin-bottom: 12px;
}

.faq-item p {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    /* Header responsive */
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }

    .logo-convertidor {
        font-size: 1.1rem;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }

    .buscador-wrapper {
        width: 100%;
        max-width: 100%;
        order: 3;
    }

    .buscador-input {
        padding: 10px 40px 10px 35px;
        font-size: 0.9rem;
    }

    /* Menú responsive */
    .menu-convertidores-scroll {
        padding: 10px;
        gap: 8px;
    }

    .menu-item {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    /* Grid responsive */
    .grid-header h1 {
        font-size: 2.2rem;
    }

    .grid-subtitle {
        font-size: 1rem;
    }

    .grid-convertidores {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .grid-item {
        padding: 30px 20px;
    }

    .grid-item-icon {
        font-size: 3rem;
    }

    .grid-item h3 {
        font-size: 1.2rem;
    }

    /* Convertidor responsive */
    .convertidor-peso-wrapper {
        padding: 20px 15px;
    }

    .convertidor-header h1 {
        font-size: 2rem;
    }
    
    .convertidor-box {
        padding: 25px;
    }
    
    .input-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .swap-button-wrapper {
        order: 3;
    }
    
    #swap-button {
        width: 100%;
        border-radius: 10px;
        height: 48px;
    }
    
    #swap-button:hover {
        transform: rotate(90deg);
    }
    
    .resultado-valor {
        font-size: 2rem;
    }
    
    .tabla-conversiones,
    .faqs {
        padding: 20px;
    }
    
    /* Tabla responsive - ARREGLO PARA MÓVIL */
    .tabla-conversiones table {
        font-size: 0.85rem;
    }

    .tabla-conversiones th,
    .tabla-conversiones td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }

    .tabla-conversiones th:first-child,
    .tabla-conversiones td:first-child {
        width: 45%;
    }

    .tabla-conversiones th:last-child,
    .tabla-conversiones td:last-child {
        width: 55%;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    /* Header móvil pequeño */
    .logo-text-sub {
        display: none;
    }

    .buscador-input {
        padding: 9px 35px 9px 32px;
        font-size: 0.85rem;
    }

    /* Menú móvil pequeño */
    .menu-item {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    /* Grid en móviles pequeños */
    .grid-header h1 {
        font-size: 1.8rem;
    }

    .grid-convertidores {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Convertidor en móviles pequeños */
    .convertidor-header h1 {
        font-size: 1.6rem;
    }
    
    .subtitulo {
        font-size: 0.95rem;
    }
    
    .resultado-valor {
        font-size: 1.5rem;
    }
    
    .resultado-unidad {
        font-size: 1.2rem;
    }

    .convertidor-box {
        padding: 20px;
    }

    /* Tabla aún más compacta en móviles pequeños */
    .tabla-conversiones {
        padding: 15px;
        overflow-x: auto;
    }

    .tabla-conversiones table {
        font-size: 0.75rem;
        min-width: 280px;
    }

    .tabla-conversiones th,
    .tabla-conversiones td {
        padding: 8px 6px;
    }
}