* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f4f6;
    color: #303744;
}

button { 
    font-family: inherit;
}

.contenedor-proforma {
    width: min(1450px, 96%);
    min-height: 650px;
    margin: 40px auto;
    display:grid;
    grid-template-columns:220px 1fr;
    gap:20px;
}

/* MENÚ IZQUIERDO */

.menu-familias {
    background: #ffffff;
    border: 1px solid #e0e4e8;
    border-radius: 12px;
    overflow: hidden;
    align-self: start;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);
    grid-column:1;
}

.menu-titulo {
    padding: 20px;
    background: #10b96e;
    color: #ffffff;
    font-size: 19px;
    font-weight: bold;
}

.menu-familias nav {
    padding: 10px;
}

.familia {
    width: 100%;
    min-height: 54px;
    margin-bottom: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #657084;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: 0.2s ease;
}

.familia:hover {
    background: #ecfff7;
    color: #079c5b;
    transform: translateX(3px);
}

.familia.activa {
    background: #e5fff3;
    color: #079c5b;
}

.familia-icono {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #edf0f3;
    color: #687284;
    font-size: 12px;
    font-weight: bold;
}

.familia:hover .familia-icono,
.familia.activa .familia-icono {
    background: #10b96e;
    color: #ffffff;
}

/* CONTENIDO DERECHO */

.contenido-productos {
    min-width: 0;
    grid-column:2;
}

.cabecera-productos {
    min-height: 95px;
    margin-bottom: 20px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #e0e4e8;
    border-radius: 12px;
}

.subtitulo {
    color: #10b96e;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1.5px;
}

.cabecera-productos h1 {
    margin: 6px 0 0;
    font-size: 27px;
}

.contador {
    padding: 12px 16px;
    background: #f5f7f8;
    border-radius: 8px;
    color: #687284;
    font-size: 14px;
}

.contador strong {
    margin-left: 5px;
    color: #10b96e;
    font-size: 18px;
}

.productos-grid {
    min-height: 500px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e0e4e8;
    border-radius: 12px;
}

.mensaje-inicial {
    min-height: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #7a8493;
    text-align: center;
}

.mensaje-icono {
    margin-bottom: 12px;
    font-size: 60px;
}

.mensaje-inicial h2 {
    margin: 0 0 10px;
    color: #444d5a;
}

.mensaje-inicial p {
    max-width: 430px;
    margin: 0;
    line-height: 1.6;
}

/* RESPONSIVE */

@media (max-width: 900px) {

    .contenedor-proforma {
        grid-template-columns: 1fr;
        margin-top: 15px;
    }

    .menu-familias nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .familia {
        margin: 0;
    }
}

@media (max-width: 600px) {

    .contenedor-proforma {
        width: 94%;
    }

    .menu-familias nav {
        grid-template-columns: 1fr;
    }

    .cabecera-productos {
        align-items: flex-start;
        flex-direction: column;
    }

    .contador {
        width: 100%;
    }

    .productos-grid {
        padding: 15px;
    }
}

.lista-productos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.tarjeta-producto {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tarjeta-producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.09);
}

.producto-imagen {
    width: 100%;
    height: 210px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f8f9;
}

.producto-imagen img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.producto-info {
    padding: 18px;
}

.producto-info h3 {
    min-height: 48px;
    margin: 0 0 16px;
    color: #394150;
    font-size: 16px;
    line-height: 1.5;
}

.producto-datos {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.producto-precio {
    color: #079c5b;
    font-size: 21px;
    font-weight: 700;
}

.producto-stock {
    padding: 6px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.producto-stock.disponible {
    background: #e8fff3;
    color: #079c5b;
}

.producto-stock.poco-stock {
    background: #fff4db;
    color: #c47b00;
}

.producto-stock.agotado {
    background: #ffe7e7;
    color: #cf3434;
}

.btn-seleccionar {
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 8px;
    background: #b91010;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-seleccionar:hover {
    background: #079c5b;
}

.btn-seleccionar:disabled {
    background: #c6cbd1;
    cursor: not-allowed;
}

.tarjeta-producto.sin-stock {
    opacity: 0.72;
}

/* TABLET */

@media (max-width: 1100px) {

    .lista-productos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

/* CELULAR */

@media (max-width: 600px) {

    .lista-productos {
        grid-template-columns: 1fr;
    }

    .producto-imagen {
        height: 230px;
    }

}
.resumen-proforma{
    width:100%;
    box-sizing:border-box;

    background:#fff;

    border:1px solid #e5e5e5;
    border-radius:12px;

    padding:18px 20px;
    margin-bottom:25px;
    grid-column:1 / -1;
}


.proforma-cabecera{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
}


.proforma-subtitulo{
    font-size:12px;
    color:#888;
    font-weight:600;
}


.proforma-cabecera h2{
    margin:3px 0 0;
    font-size:20px;
}


.proforma-total{
    white-space:nowrap;
    font-size:16px;
}


.proforma-total strong{
    font-size:22px;
    margin-left:8px;
}


.proforma-productos{
    margin-top:15px;
}


.proforma-vacia{
    padding:15px;

    background:#f7f7f7;
    border-radius:8px;

    color:#777;
    text-align:center;

    font-size:14px;
}
@media(max-width:600px){

    .resumen-proforma{
        padding:15px;
    }

    .proforma-cabecera{
        display:block;
    }

    .proforma-total{
        margin-top:12px;

        display:flex;
        justify-content:space-between;
        align-items:center;

        border-top:1px solid #eee;
        padding-top:12px;
    }

    .proforma-total strong{
        font-size:20px;
    }

}
.proforma-item{
    display:grid;
    grid-template-columns:1fr auto auto;
    gap:15px;
    align-items:center;

    padding:12px 0;
    border-bottom:1px solid #eee;
}

.proforma-item:last-child{
    border-bottom:0;
}

.proforma-item-info{
    display:flex;
    flex-direction:column;
    gap:3px;
}

.proforma-item-familia{
    font-size:11px;
    color:#888;
    text-transform:uppercase;
}

.proforma-item-precio{
    font-weight:bold;
    white-space:nowrap;
}

.btn-quitar-proforma{
    border:0;
    background:#f1f1f1;
    width:30px;
    height:30px;
    border-radius:6px;
    cursor:pointer;
}

.btn-quitar-proforma:hover{
    background:#ddd;
}

@media(max-width:600px){

    .proforma-item{
        grid-template-columns:1fr auto;
    }

    .btn-quitar-proforma{
        grid-column:2;
    }

}
@media(max-width:700px){

    .contenedor-proforma{
        display:flex;
        flex-direction:column;
    }

    .resumen-proforma{
        order:1;
    }

    .menu-familias{
        order:2;
        width: 95%;
    }

    .contenido-productos{
        order:3;
    }

}