/* --- Contenedor Layout --- */
.container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 24px;
    padding: 30px 20px;
    min-height: calc(100vh - 80px);
}

/* --- Barra Lateral Izquierda (Marcas) --- */
.tool-box {
    background-color: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid #e1e8ed;
    border-top: 5px solid #4682b4;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    max-height: 720px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.tool {
    width: 100%;
    max-width: 130px;
    margin: 16px 0;
    text-align: center;
    transition: var(--transition);
}

.tool:hover {
    transform: translateY(-3px);
}

.tool img {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    width: 100%;
    height: auto;
    background: #fafafa;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}

.tool p {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* --- Barra Lateral Derecha (Configuración Dólar) --- */
.dolar-settings {
    background-color: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid #e1e8ed;
    border-top: 5px solid #06aa00;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 24px 16px;
    max-height: 720px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.precio-actual {
    margin-bottom: 24px;
    text-align: center;
}

.dolar-settings h2 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.precio-actual p {
    font-size: 1.8rem;
    font-weight: 800;
    color: #06aa00;
}

.precio-config {
    text-align: center;
}

#dolar-input {
    width: 100%;
    padding: 12px;
    font-size: 1.15rem;
    font-weight: 600;
    border: 2px solid #e1e8ed;
    border-radius: var(--radius-sm);
    text-align: center;
    background-color: #fafafa;
    transition: var(--transition);
}

#dolar-input:focus {
    border-color: #06aa00;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(6, 170, 0, 0.15);
    outline: none;
}

/* --- Tarjetas del Centro (Calculadoras) --- */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}

.card {
    background: #ffffff;
    padding: 32px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid #eef2f5;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.mayoreo-card {
    border-top: 6px solid var(--primary-color);
}

.price-card {
    border-top: 6px solid var(--accent-color);
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.input-group {
    margin: 20px 0;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--text-muted);
}

/* Inputs de Código */
#codigo-input, 
#input-mayoreo {
    width: 100%;
    padding: 14px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    border: 2px solid #e1e8ed;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    text-align: center;
    background-color: #fafafa;
    transition: var(--transition);
}

#codigo-input:focus {
    border-color: var(--accent-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(217, 83, 79, 0.12);
    outline: none;
}

#input-mayoreo:focus {
    border-color: #e6c600;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 223, 14, 0.22);
    outline: none;
}

/* Área de resultados */
.result-area {
    margin-top: 24px;
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid #f1f1f1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
    text-align: left;
}

.mayoreo-card .result-area {
    border-left: 5px solid var(--primary-color);
    background: rgba(255, 223, 14, 0.04);
}

.price-card .result-area {
    border-left: 5px solid var(--accent-color);
    background: rgba(217, 83, 79, 0.03);
}

.result-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

#precio-resultado, 
#precio-mayoreo {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    text-align: right;
}

#precio-resultado-dolar, 
#precio-mayoreo-dolar {
    font-size: 1.5rem;
    font-weight: 700;
    color: #555555;
    text-align: right;
}

/* --- Adaptación Responsive --- */
@media (max-width: 1100px) {
    .container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .tool-box, 
    .dolar-settings {
        max-height: none;
        flex-direction: row;
        justify-content: space-around;
        padding: 20px;
    }

    .tool-box {
        order: 2;
    }

    .tool {
        margin: 0;
        width: 100px;
    }

    .dolar-settings {
        order: 1;
        align-items: center;
        text-align: center;
    }

    .precio-actual {
        margin-bottom: 0;
    }

    .card-container {
        order: 0;
    }
}

@media (max-width: 600px) {
    .tool-box {
        flex-wrap: wrap;
        gap: 16px;
    }

    .dolar-settings {
        flex-direction: column;
        gap: 16px;
    }

    .result-area {
        grid-template-columns: 1fr;
        text-align: center;
    }

    #precio-resultado, 
    #precio-mayoreo, 
    #precio-resultado-dolar, 
    #precio-mayoreo-dolar {
        text-align: center;
    }
}