/* Ambientaza · el pedido y la cotización, con el lenguaje de una app de teléfono: tipografía
   del sistema, celdas blancas agrupadas, campos grandes, un control de dos opciones para la
   entrega, botones a todo el ancho y una barra inferior que acompaña en el teléfono. */
:root { --ios: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif; }

.producto__agregado { margin-top: .9rem; padding: .75rem .95rem; background: #EEF2DD; border-radius: 12px; font: 500 .95rem/1.35 var(--ios); }
.producto__agregado a { margin-left: .35rem; font-weight: 600; text-underline-offset: 3px; }

.pedido { margin-top: clamp(2rem, 5vh, 3.4rem); padding: clamp(.9rem, 2.2vw, 1.6rem); background: #ECEAE2; border-radius: 24px; font-family: var(--ios); color: #141A13; scroll-margin-top: 16px; }
.pedido__cab { display: flex; align-items: baseline; gap: .7rem; padding: .25rem .35rem .9rem; }
.pedido__cab h3 { font: 700 clamp(1.6rem, 1.2vw + 1.25rem, 2rem)/1.1 var(--ios); letter-spacing: -.025em; }
.pedido__cab p { color: #6B7068; font-size: .95rem; }
.pedido__vaciar { margin-left: auto; padding: .4rem .2rem; background: none; border: 0; color: #2F6B3A; font: 500 1rem var(--ios); cursor: pointer; }
.pedido__vacio { padding: 1.15rem 1.2rem; background: #fff; border-radius: 18px; color: #4A524A; font-size: 1rem; line-height: 1.4; }
.pedido__lineas { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 18px; overflow: hidden; }
.pedido__lineas:empty { display: none; }

.linea { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto 30px; grid-template-areas: "foto que que quitar" "foto cu cu cu" "cant cant sub sub"; align-items: center; gap: .3rem .9rem; padding: 1rem; border-bottom: 1px solid #ECEAE3; }
.linea:last-child { border-bottom: 0; }
.linea .mono { display: none; }
.linea__foto { grid-area: foto; align-self: start; width: 72px; height: 72px; border-radius: 14px; background: #F4F0E7; object-fit: cover; }
.linea__que { grid-area: que; min-width: 0; }
.linea__que b { display: block; font: 600 1.06rem/1.25 var(--ios); letter-spacing: -.012em; }
.linea__que span { display: block; margin-top: .1rem; color: #6B7068; font-size: .9rem; line-height: 1.3; }
.linea small { display: block; margin-top: .18rem; font-size: .8rem; line-height: 1.3; color: #8A9088; }
.linea small i { font-style: normal; font-weight: 600; color: #2F6B3A; }
.linea__cu { grid-area: cu; min-width: 0; }
.linea__cu b { font: 500 .95rem var(--ios); color: #3F483D; }
.linea__cu em { font-style: normal; font-weight: 400; color: #8A9088; }
.linea__sub { grid-area: sub; text-align: right; }
.linea__sub b { font: 700 1.16rem var(--ios); letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.linea__quitar { grid-area: quitar; align-self: start; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #F0EEE8; color: #6B7068; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.linea__quitar:hover { background: #141A13; color: #fff; }
.linea .contador { grid-area: cant; justify-self: start; display: inline-grid; grid-template-columns: 42px 46px 42px; height: 40px; margin-top: .45rem; border: 0; border-radius: 999px; background: #F0EEE8; overflow: hidden; }
.linea .contador button { background: none; border: 0; font: 400 1.3rem/1 var(--ios); color: #141A13; cursor: pointer; }
.linea .contador button:hover { background: #E3E0D8; color: #141A13; }
.linea .contador input { width: 100%; min-width: 0; padding: 0; border: 0; background: none; text-align: center; font: 600 1rem var(--ios); color: #141A13; -moz-appearance: textfield; appearance: textfield; }

.pedido__pie { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem; margin-top: .9rem; }
.pedido__caja { scroll-margin-top: calc(var(--barra, 64px) + 10px); display: grid; align-content: start; gap: .9rem; min-width: 0; padding: 1.1rem; background: #fff; border-radius: 18px; }
.pedido__titulo { margin: 0; display: flex; align-items: center; gap: .6rem; font: 600 1.14rem/1.2 var(--ios); letter-spacing: -.015em; }
.pedido__titulo span { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #141A13; color: #fff; font: 600 .84rem var(--ios); }

/* la entrega: un control de dos opciones */
.segmento { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: #EEECE6; border-radius: 13px; }
.segmento label { position: relative; display: block; }
.segmento input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.segmento span { display: grid; place-items: center; min-height: 46px; padding: .4rem .5rem; border-radius: 10px; text-align: center; white-space: nowrap; font: 500 .95rem/1.2 var(--ios); color: #4A524A; transition: background .2s, color .2s, box-shadow .2s; }
.segmento input:checked + span { background: #fff; color: #141A13; font-weight: 600; box-shadow: 0 1px 4px rgba(20, 26, 19, .16); }
.segmento input:focus-visible + span { outline: 2px solid #2F6B3A; outline-offset: 1px; }
.pedido__obra { display: grid; gap: .8rem; }
.pedido__lienzo { height: 250px; margin-top: .6rem; border-radius: 14px; overflow: hidden; background: #F0EEE8; }
.pedido__ruta { margin-top: .6rem; font-size: .95rem; line-height: 1.35; color: #4A524A; }
.pedido__ruta b { color: #141A13; font-weight: 600; }
.pedido__mapa-botones { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }

.campo-ios { display: grid; gap: .35rem; }
.campo-ios > span { font: 500 .88rem var(--ios); color: #4A524A; }
.campo-ios i { font-style: normal; font-weight: 400; color: #8A9088; }
.campo-ios input { width: 100%; min-height: 50px; padding: .7rem .9rem; border: 1px solid #E3E0D8; border-radius: 12px; background: #FAF9F6; font: 400 17px var(--ios); color: #141A13; }
.campo-ios input::placeholder { color: #A8ADA5; }
.campo-ios input:focus { outline: none; border-color: #2F6B3A; background: #fff; box-shadow: 0 0 0 3px rgba(47, 107, 58, .16); }
.boton-ios { display: flex; align-items: center; justify-content: center; gap: .55rem; width: 100%; min-height: 54px; padding: .8rem 1.2rem; border: 0; border-radius: 14px; background: #141A13; color: #fff; font: 600 1.06rem var(--ios); letter-spacing: -.01em; text-decoration: none; cursor: pointer; transition: transform .15s, background .2s; }
.boton-ios:active { transform: scale(.985); }
.boton-ios:disabled { opacity: .6; }
.boton-ios svg { width: 1.3em; height: 1.3em; flex: none; }
.boton-ios--wa { background: #1FA855; }
.pastilla { display: inline-flex; align-items: center; min-height: 40px; padding: .45rem .95rem; border: 0; border-radius: 999px; background: #EEECE6; color: #141A13; font: 500 .92rem var(--ios); text-decoration: none; cursor: pointer; }
.pastilla:hover { background: #E3E0D8; }

.pedido__totales { margin: 0; }
.pedido__totales > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .62rem 0; border-bottom: 1px solid #ECEAE3; font-size: .98rem; }
.pedido__totales dt { color: #4A524A; }
.pedido__totales dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.pedido__totales #pd-ahorro { color: #2F6B3A; }
.pedido__totales .pedido__total { border-bottom: 0; padding-top: .9rem; }
.pedido__total dt { color: #141A13; font-weight: 600; }
.pedido__total dt small { display: block; white-space: nowrap; margin-top: .1rem; font: 400 .78rem/1.2 var(--ios); color: #8A9088; }
#pd-buscador { border: 1px solid #E3E0D8; border-radius: 12px; background-color: #FAF9F6; font-size: 17px; }
.pedido__total dd { font: 700 clamp(1.7rem, 1.2vw + 1.3rem, 2.1rem)/1.05 var(--ios); letter-spacing: -.03em; }
.pedido .nota { font: 400 .84rem/1.4 var(--ios); color: #8A9088; }
.pedido .error { font: 500 .92rem var(--ios); color: #B3261E; }
.info { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; margin-left: .3rem; padding: 0; border: 1px solid #A8ADA5; border-radius: 50%; background: none; color: #4A524A; font: italic 600 .78rem/1 Georgia, serif; cursor: pointer; vertical-align: 1px; }
.info:hover, .info[aria-expanded="true"] { background: #141A13; border-color: #141A13; color: #fff; }
.pedido__info { margin: 0; padding: .75rem .9rem; background: #EEF2DD; border-radius: 12px; font-size: .9rem; line-height: 1.4; color: #3F483D; }

.pedido__datos, .pedido__lista { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem; align-content: start; }
.pedido__hecho { font: 600 1.1rem/1.3 var(--ios); letter-spacing: -.01em; }
.pedido__hecho b { display: block; margin-bottom: .2rem; font: 500 .82rem var(--ios); color: #2F6B3A; letter-spacing: .02em; }
.pedido__vista { display: block; width: min(100%, 230px); margin-inline: auto; }
.pedido__vista img { display: block; width: 100%; height: auto; background: #fff; border-radius: 8px; box-shadow: 0 14px 40px rgba(20, 26, 19, .2), 0 0 0 1px rgba(20, 26, 19, .06); }
.pedido__otros { display: flex; flex-wrap: wrap; gap: .5rem; }
.flotante.flotante--pedido svg { display: none; }

/* la barra de abajo en el teléfono: agregar la pieza o ver el pedido */
.barra-movil { position: fixed; z-index: 45; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: none; align-items: center; gap: .8rem; padding: .5rem .5rem .5rem 1.05rem; border-radius: 20px; background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: saturate(1.7) blur(18px); backdrop-filter: saturate(1.7) blur(18px); box-shadow: 0 12px 36px rgba(20, 26, 19, .24), 0 0 0 1px rgba(20, 26, 19, .06); font-family: var(--ios); color: #141A13; }
.barra-movil p { flex: 1; min-width: 0; font: 700 1.02rem/1.15 var(--ios); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-movil .bm-ok { display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; margin-right: .35rem; border-radius: 50%; background: #1FA855; color: #fff; font-size: .72rem; line-height: 1; vertical-align: .08em; }
.barra-movil small { display: block; margin-top: .12rem; font: 400 .8rem/1.2 var(--ios); color: #6B7068; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-movil .boton-ios { width: auto; flex: none; min-height: 46px; padding-inline: 1.15rem; font-size: .98rem; white-space: nowrap; }

@media (max-width: 899px) {
  .barra-movil:not([hidden]) { display: flex; }
  .flotante { display: none !important; }   /* en el teléfono no va la barra de WhatsApp */
  /* En el teléfono el pedido no va en la página: sube como una hoja a pantalla completa. */
  #cesta { display: none; }
  #pedido { position: fixed; inset: 0; z-index: 70; margin: 0; padding: 0 .75rem calc(1.6rem + env(safe-area-inset-bottom)); border-radius: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; visibility: hidden; transform: translateY(100%); transition: transform .42s cubic-bezier(.2, .9, .25, 1), visibility 0s .42s; }
  #pedido.es-abierto { visibility: visible; transform: none; transition: transform .42s cubic-bezier(.2, .9, .25, 1); }
  #pedido .pedido__cab { position: sticky; top: 0; z-index: 3; align-items: center; margin: 0 -.75rem .75rem; padding: calc(.7rem + env(safe-area-inset-top)) .9rem .7rem 1.05rem; background: rgba(236, 234, 226, .86); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid rgba(20, 26, 19, .07); }
  #pedido .pedido__cab h3 { font-size: 1.4rem; white-space: nowrap; }
  #pedido .pedido__cab p { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #pedido .pedido__cerrar { display: grid; }
  #pedido .pedido__vaciar[hidden] + .pedido__cerrar { margin-left: auto; }
  #pedido:not(.pedido--con) .pedido__elegir { display: inline-flex; margin-top: .8rem; background: #141A13; color: #fff; }
  html.con-hoja, html.con-hoja body { overflow: hidden; }
}
@media (min-width: 900px) {
  .linea { grid-template-columns: 76px minmax(0, 1.7fr) minmax(0, 1.1fr) auto minmax(7.4rem, .7fr) 30px; grid-template-areas: "foto que cu cant sub quitar"; gap: .8rem 1.3rem; padding: 1.05rem 1.3rem; }
  .linea__foto { width: 76px; height: 76px; align-self: center; }
  .linea .contador { margin-top: 0; }
  .linea__quitar { align-self: center; }
  .pedido__pie { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .pedido__flotante { position: fixed; right: 22px; bottom: 22px; }
}
/* con piezas en el pedido, el botón de la barra abre la miniatura: el flotante sobra */
.flotante.flotante--pedido { display: none; }

/* ═══════════ Ver el pedido sin bajar la página ═══════════ */
.pedido__cerrar { flex: none; display: none; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: #DDDAD0; color: #3F483D; cursor: pointer; }
.pedido__cerrar svg { width: 12px; height: 12px; }
.pedido__cerrar:hover { background: #141A13; color: #fff; }
.pedido__elegir { display: none; }
/* Web: el pedido en miniatura, bajo el botón «Mi pedido» de la barra */
.cesta { position: fixed; z-index: 60; top: calc(var(--barra, 64px) + 6px); right: var(--margen, 22px); width: min(430px, calc(100vw - 24px)); max-height: calc(100vh - var(--barra, 64px) - 26px); display: flex; flex-direction: column; background: #ECEAE2; border-radius: 24px; box-shadow: 0 30px 80px rgba(20, 26, 19, .3), 0 0 0 1px rgba(20, 26, 19, .07); font-family: var(--ios); color: #141A13; opacity: 0; visibility: hidden; transform: translateY(-10px) scale(.97); transform-origin: calc(100% - 70px) 0; transition: opacity .18s, transform .28s cubic-bezier(.2, .9, .25, 1), visibility 0s .28s; }
.cesta.es-abierto { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .28s cubic-bezier(.2, .9, .25, 1); }
.cesta:focus { outline: none; }
.cesta__cab { flex: none; display: flex; align-items: baseline; gap: .6rem; padding: 1.05rem 1rem .8rem 1.25rem; }
.cesta__cab h2 { margin: 0; max-width: none; font: 700 1.35rem/1.1 var(--ios); font-stretch: normal; letter-spacing: -.025em; text-transform: none; color: #141A13; }
.cesta__cab p { margin: 0; color: #6B7068; font-size: .92rem; }
.cesta__cab .pedido__cerrar { display: grid; margin-left: auto; align-self: center; }
.cesta__vacio { margin: 0 1.25rem 1.3rem; color: #4A524A; font-size: .98rem; line-height: 1.4; }
.cesta__lineas { position: relative; flex: 1 1 auto; min-height: 0; margin: 0 .75rem; overflow-y: auto; overscroll-behavior: contain; }
.cesta__lineas .linea { grid-template-columns: 60px minmax(0, 1fr) auto 30px; grid-template-areas: "foto que que quitar" "foto cu cu cu" "cant cant sub sub"; gap: .25rem .8rem; padding: .85rem .9rem; }
.cesta__lineas .linea__foto { width: 60px; height: 60px; border-radius: 12px; align-self: start; }
.cesta__lineas .linea__que b { font-size: 1rem; }
.cesta__lineas .linea small { display: none; }
.cesta__lineas .linea .contador { grid-template-columns: 38px 42px 38px; height: 36px; margin-top: .4rem; }
.cesta__lineas .linea__sub b { font-size: 1.08rem; }
.cesta__lineas .linea__quitar { align-self: start; }
.cesta__pie { flex: none; display: grid; gap: .7rem; padding: .95rem 1.25rem 1.15rem; }
.cesta__total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0; font-weight: 600; }
.cesta__total small { display: block; font: 400 .78rem/1.2 var(--ios); color: #8A9088; }
.cesta__total b { font: 700 1.6rem/1.05 var(--ios); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cesta .nota { margin: 0; text-align: center; font: 400 .82rem/1.35 var(--ios); color: #8A9088; }
.linea--nueva { animation: linea-nueva 1.8s ease-out; }
@keyframes linea-nueva { from { background: #E1ECC6; } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .cesta, .cesta.es-abierto, #pedido, #pedido.es-abierto { transition: none; } .linea--nueva { animation: none; } }

/* ═══════════ cotizacion.html: la cotización que llega en un enlace ═══════════ */
.hoja-cot { max-width: 880px; margin: 0 auto; padding: clamp(1.2rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 4rem; }
.hoja-cot__cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--tinta); }
.hoja-cot__cab h1 { font-size: clamp(1.5rem, 2.4vw + 1rem, 2.4rem); font-weight: 660; font-stretch: 108%; line-height: 1.05; margin-top: .5rem; }
.hoja-cot__para { margin: 1.3rem 0 1.5rem; line-height: 1.45; }
.hoja-cot .pedido { margin: 0; }
.hoja-cot .linea { grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "foto que que" "foto cu cu" "cant cant sub"; }
.hoja-cot__cant { grid-area: cant; font: 600 1rem var(--ios); }
.hoja-cot__cant::before { content: "Cantidad: "; font-weight: 400; color: #6B7068; }
.hoja-cot .pedido__pie { grid-template-columns: minmax(0, 1fr); background: #fff; border-radius: 18px; padding: 1.1rem; }
.hoja-cot .acciones { margin-top: 1.5rem; }

/* teléfonos angostos (360 px): el encabezado del pedido y la barra de abajo caben en una línea */
@media (max-width: 380px) {
  .pedido__cab h3 { white-space: nowrap; }
  .pedido__cab p { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .84rem; }
  .barra-movil { gap: .5rem; padding-left: .85rem; }
  .barra-movil p { font-size: .96rem; }
  .barra-movil small { font-size: .74rem; }
  .barra-movil .boton-ios { padding-inline: .85rem; font-size: .92rem; }
}
