/* ==========================================================
   Changuito (carrito) + botones para agregar piezas
   ========================================================== */

/* --- botón flotante --- */
.changuitoBoton {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1040;
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 50%;
    background-color: #0B9E57;
    color: #FFFFFF;
    font-size: 28px;
    line-height: 62px;
    box-shadow: 0 8px 22px rgba(42, 38, 34, .28);
    cursor: pointer;
    transition: background-color .2s, transform .2s;
}
.changuitoBoton:hover { background-color: #08864A; transform: translateY(-2px); }

.changuitoCantidad {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border: 2px solid #FFFFFF;
    border-radius: 999px;
    background-color: #2A2622;
    color: #FFFFFF;
    font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    font-size: 12px;
    font-weight: bold;
    line-height: 20px;
}
.changuitoCantidad[hidden] { display: none; }

@keyframes changuitoSalto {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.18); }
    70% { transform: scale(.95); }
}
.changuitoSalto { animation: changuitoSalto .45s ease; }

/* --- panel lateral --- */
.changuitoFondo {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background-color: rgba(42, 38, 34, .45);
}
.changuitoPanel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    background-color: #FFFFFF;
    box-shadow: -10px 0 30px rgba(42, 38, 34, .2);
    font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    text-align: left;
}
.changuitoFondo[hidden], .changuitoPanel[hidden], .changuitoAviso[hidden], .changuitoPie[hidden] { display: none; }
body.changuitoAbierto { overflow: hidden; }

.changuitoCabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background-color: #F7F2EB;
}
.changuitoCabecera h3 { margin: 0; font-size: 2.2rem; font-variant: small-caps; color: #2A2622; }
.changuitoCerrar {
    border: 0;
    background: none;
    font-size: 30px;
    line-height: 1;
    color: #7B7068;
    cursor: pointer;
}
.changuitoCerrar:hover { color: #2A2622; }

.changuitoLista { flex: 1; overflow-y: auto; padding: 8px 20px; }

.changuitoVacio { padding: 40px 0; text-align: center; color: #7B7068; font-size: 1.6rem; }
.changuitoVacio a { color: #0B9E57; }

.changuitoItem {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #EFE6DA;
}
.changuitoItem img {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    background-color: #EFE6DA;
}
.changuitoItemInfo { flex: 1; min-width: 0; }
.changuitoItemInfo a {
    display: block;
    color: #2A2622;
    font-size: 1.6rem;
    font-weight: bold;
    font-variant: small-caps;
    line-height: 1.25;
    text-decoration: none;
}
.changuitoItemInfo a:hover { color: #0B9E57; }
.changuitoItemInfo > span { display: block; margin: 2px 0 8px; color: #0B9E57; font-size: 1.4rem; font-weight: bold; }

.changuitoCantidades { display: flex; align-items: center; gap: 8px; }
.changuitoCantidades button {
    width: 30px;
    height: 30px;
    border: 2px solid #E4D9CB;
    border-radius: 50%;
    background-color: #FFFFFF;
    color: #2A2622;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.changuitoCantidades button:hover { border-color: #0B9E57; color: #0B9E57; }
.changuitoCantidades b { min-width: 18px; text-align: center; font-size: 1.5rem; }
.changuitoCantidades .changuitoQuitar {
    width: auto;
    height: auto;
    margin-left: auto;
    border: 0;
    border-radius: 0;
    color: #A0958C;
    font-size: 1.3rem;
    text-decoration: underline;
}

.changuitoPie { padding: 16px 20px 20px; border-top: 1px solid #EFE6DA; background-color: #FFFFFF; }
.changuitoTotal {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 1.9rem;
    font-variant: small-caps;
    color: #2A2622;
}
.changuitoTotal strong { color: #0B9E57; font-variant: normal; }
.changuitoFinalizar { width: 100%; border: 0; font-size: 1.7rem; padding: 14px; }
.changuitoNota { margin: 10px 0 0; color: #9A9088; font-size: 1.25rem; text-align: center; }

/* --- aviso "agregado" --- */
.changuitoAviso {
    position: fixed;
    right: 20px;
    bottom: 94px;
    z-index: 1040;
    max-width: 280px;
    padding: 10px 16px;
    border-radius: 14px;
    background-color: #2A2622;
    color: #FFFFFF;
    font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    font-size: 1.4rem;
    box-shadow: 0 6px 18px rgba(42, 38, 34, .25);
}

/* --- botones para agregar --- */
.agregarRapido {
    margin-top: 8px;
    padding: 6px 14px;
    border: 2px solid #0B9E57;
    border-radius: 999px;
    background-color: #FFFFFF;
    color: #0B9E57;
    font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    font-size: 1.4rem;
    font-weight: bold;
    font-variant: small-caps;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}
.agregarRapido:hover { background-color: #0B9E57; color: #FFFFFF; }

.detalleInfo button.botonNuevo { cursor: pointer; }

.botonSecundario {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 24px;
    border: 2px solid #E4D9CB;
    border-radius: 999px;
    color: #2A2622;
    font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    font-size: 1.5rem;
    font-variant: small-caps;
    text-decoration: none;
}
.botonSecundario:hover { border-color: #0B9E57; color: #0B9E57; text-decoration: none; }

/* la tarjeta del listado ahora es un div con el link adentro + el botón */
.tarjetaProducto > a { display: block; color: inherit; text-decoration: none; }
.tarjetaProducto > a:hover, .tarjetaProducto > a:focus { color: inherit; text-decoration: none; }

@media screen and (max-width: 480px) {
    .changuitoBoton { right: 14px; bottom: 14px; width: 56px; height: 56px; line-height: 56px; font-size: 24px; }
    .changuitoAviso { right: 14px; bottom: 82px; }
    .agregarRapido { padding: 5px 10px; font-size: 1.25rem; }
}
