:root {

    --primary: #2563eb;

    --secondary: #1e293b;

    --accent: #2dd802;

    --white: #ffffff;

    --bg-light: #f8fafc;

    --text-main: #1e293b;

    --text-muted: #64748b;

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

}



* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }



body { background-color: var(--bg-light); color: var(--text-main); line-height: 1.6; }



.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }



/* --- Header --- */

header {

    background: var(--white); padding: 1rem 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05);

    position: sticky; top: 0; z-index: 100;

}

header .container { display: flex; justify-content: space-between; align-items: center; }

.logo a { text-decoration: none; color: var(--secondary); font-weight: 800; font-size: 1.5rem; display: flex; align-items: center;  }

.logo span { color: var(--primary); }

.logo img {width: 30px;}

nav a { text-decoration: none; color: var(--text-main); margin-left: 20px; font-weight: 600; }



nav a:hover { color: var(--primary); }



/* --- Hero Section --- */

.hero {

    background: linear-gradient(135deg, var(--secondary) 0%, #334155 100%);

    color: var(--white);

    text-align: center;

    padding: 6rem 20px;

}



.hero h1 {

    font-size: 2.8rem;

    margin-bottom: 1rem;

    letter-spacing: -1px;

}



.hero p {

    font-size: 1.2rem;

    opacity: 0.9;

    margin-bottom: 2rem;

}



.btn-primary {

    background-color: var(--accent);

    color: var(--white);

    padding: 14px 35px;

    border-radius: 50px;

    text-decoration: none;

    font-weight: 600;

    display: inline-block;

    transition: all 0.3s ease;

}



.btn-primary:hover {

    transform: translateY(-2px);

    background-color: #28c202; /* Un verde un poco más oscuro al pasar el mouse */

}

.calculator-header { text-align: center; margin: 40px 0; }

/* --- Stats Bar --- */

.stats-overview {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

    gap: 20px;

    background: var(--white);

    padding: 30px;

    border-radius: 16px;

    margin: -50px auto 40px;

    box-shadow: var(--shadow);

    text-align: center;

}



.stat-item h4 { color: var(--primary); font-size: 2rem; }



/* --- Buscador --- */

.section-header {

    display: flex;

    flex-wrap: wrap;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 2rem;

    gap: 15px;

}



.search-box {

    position: relative;

    width: 100%;

    max-width: 350px;

}



.search-box input {

    width: 100%;

    padding: 12px 12px 12px 45px;

    border: 1px solid #cbd5e1;

    border-radius: 12px;

    outline: none;

    font-size: 1rem;

    transition: border-color 0.3s;

}



.search-box input:focus {

    border-color: var(--primary);

}



.search-box i {

    position: absolute;

    left: 15px;

    top: 50%;

    transform: translateY(-50%);

    color: #94a3b8;

}



/* --- Grid de Tarjetas --- */

.grid-container {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));

    gap: 24px;

    margin-bottom: 50px;

}

.grid-container a{

    text-decoration: none;

}

.card {

    position: relative;

    overflow: hidden;

    background: var(--white); border-radius: 20px; padding: 30px;

    border: 1px solid #f1f5f9; box-shadow: var(--shadow);

    width: 100%;

    display: flex;

    flex-direction: column;

}

.card h3 {

    text-decoration: none !important; /* Quita el subrayado */

    color: var(--text-main);                  /* Hace que el link no sea azul ni violeta, sino del color del texto del padre */

}



/* Para asegurar que al hacer clic o haberlo visitado no cambie */

.card a:visited,

.card a:hover,

.card a:active {

    text-decoration: none;

    color: inherit;

}

.calc-form, .calc-results {

    flex: 1; /* Ocupan 50% cada uno en desktop */

    min-width: 320px;

}

.card:hover {

    transform: translateY(-10px);

    box-shadow: var(--shadow-hover);

    border-color: var(--primary);

}



/* Badge de "MÁS USADA" */

.card.popular::before {

    content: "POPULAR";

    position: absolute;

    top: 18px;

    right: -32px;

    background: #fbbf24;

    color: #78350f;

    font-size: 0.65rem;

    font-weight: 800;

    padding: 5px 35px;

    transform: rotate(45deg);

    z-index: 10; /* Asegura que esté por encima del contenido */

    box-shadow: 0 2px 4px rgba(0,0,0,0.1);

    pointer-events: none; /* Para que no interfiera con el click en la tarjeta */

}



.icon-box {

    width: 55px;

    height: 55px;

    border-radius: 12px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 1.6rem;

    margin-bottom: 20px;

}



.card h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; }

.card p { font-size: 0.95rem; color: var(--text-muted); flex-grow: 1; margin-bottom: 20px; }

.link-text { font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }



/* Próximamente */

.coming-soon {

    background: #f1f5f9;

    border: 2px dashed #cbd5e1;

    opacity: 0.8;

}



/* --- Calculadoras Internas --- */

.calculator-wrapper {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 30px;

    width: 100%;

    max-width: 550px; /* Ancho cuando está solo el form */

    margin: 0 auto 50px;

    transition: all 0.4s ease-in-out;

}



/* Cuando aparece el resultado, se expande a los lados */

.calculator-wrapper:has(#resultados:not(.hidden)) {

    max-width: 1100px;

    flex-direction: row;

    align-items: stretch; /* Misma altura para ambos */

}



/* --- Inputs y Resultados --- */

.input-group { margin-bottom: 1.5rem; }

.input-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--secondary); }

.input-group input {

    width: 100%; padding: 14px; border: 2px solid #e2e8f0;

    border-radius: 12px; font-size: 1rem; outline: none; transition: 0.3s;

    text-align: center;

}

.input-group input:focus { border-color: var(--primary); background: #fff; }







.result-total .text-danger {

    display: block; font-size: 2.2rem; color: #ef4444; font-weight: 800; margin: 10px 0;

}



/* --- SEO y Publicidad --- */

.seo-content {

    background: var(--white); padding: 50px;

    border-radius: 20px; border: 1px solid #e2e8f0; margin-bottom: 50px;

}

.ad-container {

    background: #f1f5f9; border-radius: 12px; min-height: 100px;

    display: flex; align-items: center; justify-content: center; margin: 25px 0;

}



/* --- Footer --- */

footer { background: var(--secondary); color: #cbd5e1; padding: 45px 0; text-align: center; }

.footer-links { margin-top: 15px; }

.footer-links a { color: var(--white); text-decoration: none; margin: 0 12px; font-size: 0.9rem; opacity: 0.8; }

.footer-links a:hover { opacity: 1; }



.btn-primary {

    background-color: var(--accent); color: var(--secondary); padding: 16px;

    border-radius: 12px; border: none; font-weight: 700; font-size: 1rem;

    cursor: pointer; width: 100%; transition: 0.3s;

}

.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }

.btn-primary.empezar{

width: 15%;

}



.result-row { display: flex; justify-content: space-between; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }

.result-total { text-align: center; margin: 20px 0; padding: 15px; background: #fffcf0; border-radius: 12px; }

.result-total strong { font-size: 2rem; color: #ef4444; display: block; }



.impact-box { display: flex; align-items: center; gap: 15px; padding: 15px; border-radius: 12px; margin-top: 15px; text-align: left; }

.impact-box i { font-size: 1.5rem; }



.hidden { display: none !important; }



/* Opcional: una pequeña animación para que aparezca suavemente */

.calc-results {

    animation: fadeIn 0.5s ease-in-out;

}



@keyframes fadeIn {

    from { opacity: 0; transform: translateY(10px); }

    to { opacity: 1; transform: translateY(0); }

}

/* --- Responsive --- */

@media (max-width: 850px) {

    .calculator-wrapper:has(#resultados:not(.hidden)) {

        flex-direction: column;

        max-width: 550px;

    }

}

/* --- Responsive --- */

@media (max-width: 900px) {

    .calculator-wrapper { grid-template-columns: 1fr; }

}



@media (max-width: 768px) {

    .hero h1 { font-size: 2.2rem; }

    .section-header { flex-direction: column; align-items: stretch; }

    .search-box { max-width: 100%; }

    header .container { flex-direction: column; gap: 15px; }

    nav a { margin: 0 10px; }

    .calculator-wrapper:has(#resultados:not(.hidden)) {

        flex-direction: row;

        align-items: start;

        max-width: 1000px;

    }

   

    .calc-form, .calc-results {

        flex: 1; /* Ambos ocupan el mismo ancho */

        width: 100%;

    }

}