/* Hoja de estilos de precios */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/*Variables personalizadas CSS*/
:root {
  --main-color: #04602a;
}

body {
    min-height: 80vh;
    font-family: "Montserrat";
    background-color: #f4f3f3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
/* Header */
.main-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100px;
    width: 100%;
    padding: 5px;
    box-shadow: rgba(17, 17, 26, 0.1) 0px 1px 0px, rgba(17, 17, 26, 0.1) 0px 4px 8px, rgba(17, 17, 26, 0.1) 0px 8px 12px;
}

.header-logo {
    align-items: center;
    width: 200px;
    height: 40px;
    margin-inline: 3px;
    margin-bottom: 10px;

}

.header-logo img:hover {
    cursor: pointer;
}

.header_links {
    margin-top: 10px;
}

.header_links a {
    color:var(--main-color);
    font-weight: 600;
    margin-inline: 15px;
    text-decoration: none;
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif
}

.header_links a:hover {
    font-size: 105%;
    color: #01b34b;
    transition: all ease .10s;
}


/*MAIN*/
main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    gap: 25px;
}

/*Estado dot*/
#estado {
    font-size: .8rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}

#estado .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    transition: background .3s;
}

#estado .dot.ok {
    background: #22c55e;
}

#estado .dot.error {
    background: #ef4444;
}

#estado .dot.loading {
    background: #f59e0b;
}


/* Grid de barrios */
#grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* Card de barrio */
.barrio-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
}

.barrio-card header {
    background: var(--main-color);
    color: #fff;
    padding: 12px 16px;
    margin: 0;
    font-size: .95rem;
    font-weight: 600;
    display: block;
}

/*Tabla interna de la card*/
.lotes-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

/*Encabezado columnas tr fondo th letras*/
.lotes-tabla thead tr {
    background: #f0f4f8;
}

.lotes-tabla th {
    padding: 8px 14px;
    text-align: left;
    font-weight: 500;
    color: #555;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/*interior tabla letras*/
.lotes-tabla td {
    padding: 9px 14px;
    border-top: 1px solid #d4d4d4;
    color: #505050;
}

.lotes-tabla tr:hover td {
    background: #e3dddd;
}


/*pildoras disponibilidad*/
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 500;
}

.badge.si {
    background: #dcfce7;
    color: #166534;
}

.badge.no {
    background: #fee2e2;
    color: #991b1b;
}

.precio {
    font-weight: 500;
    color: #202021;
}

.precio.sin-precio {
    color: #aaa;
    font-weight: 400;
    
}

/* Estados de carga */
#loading,
#error-msg {
    max-width: 900px;
    margin: 60px auto;
    text-align: center;
    color: #888;
    font-size: .95rem;
}

#error-msg {
    color: #ef4444;
    display: none;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--main-color);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Highlight de precio cambiado */
@keyframes highlight {
    0% {
        background: #fdf6ac;
    }

    100% {
        background: transparent;
    }
}

.precio-cambio {
    animation: highlight 3s ease-out;
}

@media screen and (max-width: 600px) {

    #grid {
    max-width: 550px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

   .lotes-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.lotes-tabla th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 500;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}


.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .60rem;
    font-weight: 500;
}
}
