/* Piezas reutilizables: botones, formularios, tarjetas, estados, tablas y avisos. */

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 22px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font-family: var(--font-body); font-size: 15px; font-weight: 600; letter-spacing: -0.006em; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.3s, transform 0.3s var(--ease-out); }
.btn:hover { background: #000; color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active { box-shadow: none; transform: none; }
.btn.red { border-color: var(--red); background: var(--red); }
.btn.red:hover { border-color: var(--red-dark); background: var(--red-dark); }
.btn.yellow { border-color: var(--yellow); background: var(--yellow); color: var(--ink); }
.btn.yellow:hover { border-color: #ffe35a; background: #ffe35a; color: var(--ink); }
.btn.ghost { border-color: var(--line-strong); background: var(--paper); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); background: var(--paper); color: var(--ink); box-shadow: none; }
.btn.outline-light { border-color: rgba(255, 255, 255, 0.5); background: transparent; color: #fff; }
.btn.outline-light:hover { border-color: #fff; background: #fff; color: var(--ink); }
.btn.small { min-height: 36px; padding: 7px 14px; font-size: 13.5px; }
.btn.big { min-height: 52px; padding: 14px 28px; font-size: 16px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }

/* WhatsApp */
.btn.wa { border-color: #0e7c41; background: #0e7c41; color: #fff; }
.btn.wa:hover { border-color: #0b6a37; background: #0b6a37; color: #fff; }
.wa-ico { display: inline-grid; flex: none; width: 20px; height: 20px; }
.wa-ico svg { width: 100%; height: 100%; }
.btn.wa.small .wa-ico { width: 17px; height: 17px; }
.btn.wa-float { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 30; padding: 13px 18px; border-radius: 999px; box-shadow: var(--shadow-md); transition: opacity 0.3s, transform 0.4s var(--ease-out), visibility 0s, background 0.18s; }
.btn.wa-float.is-out { opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity 0.3s, transform 0.4s var(--ease-out), visibility 0s linear 0.4s; }
.big-order { margin-top: 2px; }
.hint-line { font-size: 14.5px; color: var(--muted); }
.custom-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; margin-top: clamp(36px, 4vw, 56px); padding: 22px 26px; border-radius: var(--r-lg); background: var(--wash); }
.custom-band h3 { font-family: var(--serif); font-size: 23px; font-weight: 400; letter-spacing: -0.016em; }
.custom-band p { max-width: 62ch; margin-top: 3px; color: var(--muted); font-size: 15px; }
@media (max-width: 600px) { .btn.wa-float { padding: 13px; font-size: 0; gap: 0; } .btn.wa-float .wa-ico { width: 27px; height: 27px; } }

/* Formularios */
.field { display: grid; gap: 6px; align-content: start; }
.field label, .field .label { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 13.5px; color: var(--muted); }
.field .error-text { font-size: 14px; color: var(--red-dark); font-weight: 600; }
.input, .select, .textarea { width: 100%; min-width: 0; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--paper); transition: border-color 0.18s, box-shadow 0.18s; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 23, 26, 0.08); }
.input[disabled] { color: var(--muted); background: var(--wash); }
.textarea { min-height: 96px; resize: vertical; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea, .field.invalid .drop { border-color: var(--red); background: #fff8f7; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ink); flex: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Contraseña: mostrar/ocultar, fuerza y coincidencia */
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 76px; }
.pass-wrap .input::-ms-reveal, .pass-wrap .input::-ms-clear { display: none; }
.pass-toggle { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); padding: 5px 9px; border: 0; border-radius: var(--r); background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.pass-toggle:hover { background: var(--wash); color: var(--ink); }
.meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 2px; }
.meter i { height: 4px; border-radius: 2px; background: var(--line); transition: background 0.25s; }
.meter[data-level="1"] i:nth-child(-n+1) { background: var(--red); }
.meter[data-level="2"] i:nth-child(-n+2) { background: var(--yellow-deep); }
.meter[data-level="3"] i { background: var(--green); }
.hint.good { color: var(--green); font-weight: 600; }

/* Tarjetas */
.card { position: relative; min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-sm); }
.card.pad-lg { padding: 30px; }
.card h2 { font-size: 22px; letter-spacing: -0.016em; }
.card h3 { font-size: 16.5px; }

/* Catálogo: la prenda sobre un fondo suave, con su sombra y mucho aire */
.product-card { position: relative; display: flex; flex-direction: column; padding: 0; overflow: visible; border: 0; border-radius: 0; background: none; box-shadow: none; }
.product-card .art { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1.14; overflow: hidden; border-radius: var(--r-lg); background: linear-gradient(170deg, #f8f5ef 0%, #efe9de 100%); }
.product-card .art > svg { width: 62%; height: 78%; filter: drop-shadow(0 12px 14px rgba(22, 23, 26, 0.15)); transition: transform 0.9s var(--ease-out); }
.product-card .art .photos { position: absolute; inset: 8% 9%; display: grid; place-items: center; filter: drop-shadow(0 12px 14px rgba(22, 23, 26, 0.17)); transition: transform 0.9s var(--ease-out); }
.product-card .art .photos img, .product-card .art .photos canvas, .product-card .art .photos svg { grid-area: 1 / 1; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.product-card:hover .art .photos, .product-card:hover .art > svg { transform: scale(1.05); }
.product-card .art .photos.cover { inset: 0; filter: none; display: block; }
.product-card .art .photos.cover img { width: 100%; height: 100%; max-height: none; max-width: none; object-fit: cover; }
.product-card .promo-tag { position: absolute; z-index: 1; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 600; }
.product-card .promo-tag.calm { background: rgba(255, 255, 255, 0.92); color: var(--ink); box-shadow: var(--shadow-sm); }
.product-card .promo-tag + .promo-tag { top: 38px; }
/* La imagen de cada tarjeta abre la vista de cerca */
.art-open { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--r-lg); background: none; color: inherit; cursor: zoom-in; }
.art-open:focus-visible { outline-offset: 2px; }
.product-card .body { display: flex; flex: 1; flex-direction: column; gap: 3px; padding: 13px 2px 0; }
.product-card h3 { font-size: 16px; line-height: 1.3; }
.product-card .body > p { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 14px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; line-height: 1.15; }
.price small { color: var(--muted); font-size: 13px; }
.price b { font-size: 16.5px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.filter-bar { margin-bottom: 22px; }

/* Vista de cerca */
.quick { width: min(1000px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; border: 0; border-radius: var(--r-xl); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg); }
.quick[open] { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); animation: pop 0.35s var(--ease-out); }
.quick::backdrop { background: rgba(22, 23, 26, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.quick-photo { display: grid; align-content: center; gap: 4px; min-height: 340px; padding: 0 0 14px; background: radial-gradient(ellipse 70% 70% at 62% 16%, rgba(255, 255, 255, 0.54), transparent 76%), var(--yellow); }
.quick-main { display: grid; place-items: center; padding: 30px 34px; }
.quick-main img, .quick-main canvas, .quick-main svg { width: 100%; max-height: 500px; object-fit: contain; filter: drop-shadow(10px 16px 16px rgba(110, 76, 0, 0.3)); }
.quick-main svg { max-height: 380px; }
.quick-main.cover { padding: 26px 26px 12px; }
.quick-main.cover img { border-radius: var(--r); filter: none; object-fit: cover; }
.quick-thumbs { display: flex; justify-content: center; gap: 6px; }
.quick-thumbs button { width: 54px; height: 54px; padding: 4px; border: 0; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.72); cursor: pointer; transition: background 0.2s; }
.quick-thumbs button:hover { background: #fff; }
.quick-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.quick-info { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; padding: clamp(24px, 3vw, 38px); }
.quick-info h2 { font-size: clamp(27px, 2.5vw, 34px); }
.quick-info > p { font-size: 15px; }
.quick-info > .eyebrow { font-size: 12px; }
.quick-info > .quick-price { color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.quick-info .btn { width: 100%; }
.quick-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0 0 2px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 20px; font-weight: 300; line-height: 1; cursor: pointer; transition: border-color 0.2s; }
.quick-close:hover { border-color: var(--ink); }
.quick-note { padding: 8px 12px; border-radius: var(--r-sm); background: var(--wash); font-size: 14px; }
@media (max-width: 680px) { .quick[open] { grid-template-columns: minmax(0, 1fr); } .quick-photo { min-height: 0; padding: 0 0 10px; } .quick-main { padding: 22px 26px; } .quick-main img, .quick-main canvas, .quick-main svg { max-height: 250px; } .quick-info { padding: 20px; } }

/* Selector de prenda en "Nuevo pedido" */
.step-title { display: flex; align-items: center; gap: 11px; }
.step-title i { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-style: normal; font-weight: 600; font-size: 13px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.choice .face { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); transition: border-color 0.2s, box-shadow 0.2s; }
.choice:hover .face { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.choice .face svg, .choice .face img { width: 64px; height: 64px; object-fit: contain; }
.choice .face svg.fan { overflow: hidden; }
.choice input:checked + .face { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.choice input:focus-visible + .face { outline: 3px solid var(--ink); outline-offset: 2px; }
.choice input:disabled + .face { opacity: 0.55; }
.choice .face b { display: block; font-size: 16px; font-weight: 600; line-height: 1.2; }
.choice .face small { display: block; font-size: 14px; color: var(--muted); }

/* Cantidad */
.qty { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qty-box { display: inline-grid; grid-template-columns: 46px 96px 46px; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.qty-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 23, 26, 0.08); }
.qty-box button { border: 0; background: var(--wash); font-size: 22px; font-weight: 700; cursor: pointer; transition: background 0.15s; }
.qty-box button:hover { background: var(--sand); }
.qty-box input { width: 100%; border: 0; text-align: center; font-weight: 700; font-size: 18px; padding: 10px 4px; outline: 0; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.qty-box input::-webkit-outer-spin-button, .qty-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.chip { padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); font-weight: 500; font-size: 14px; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Interruptor de bordado */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: var(--r); background: var(--wash); cursor: pointer; }
.switch-row b { display: block; font-size: 16px; }
.switch-row small { color: var(--muted); font-size: 14px; }
.toggle { position: relative; flex: none; width: 54px; height: 31px; }
.toggle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background 0.2s; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 25px; height: 25px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); transition: transform 0.28s var(--ease-spring); }
.toggle input:checked + span { background: var(--ink); }
.toggle input:checked + span::after { transform: translateX(23px); }
.toggle input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

.field > .btn.small { justify-self: start; }
.logo-warning { margin-bottom: 18px; }

/* Vista previa del bordado sobre la prenda */
.emb-box { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; align-items: start; }
.emb-preview { padding: 10px; border-radius: var(--r); background: var(--wash); }
.emb-preview svg { width: 100%; height: auto; display: block; }
.emb-spot { fill: var(--red); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.3); transition: opacity 0.2s, transform 0.35s var(--ease-spring); }
.emb-spot.on { opacity: 1; transform: scale(1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) { .emb-box { grid-template-columns: minmax(0, 1fr); } .emb-preview { max-width: 170px; } }

/* Resumen de pedido y de pago */
.summary { display: grid; gap: 9px; }
.summary h2 { font-size: 20px; margin-bottom: 4px; }
.summary .line { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; align-items: baseline; }
.summary .line > span:first-child { color: var(--muted); }
.summary .line > span:last-child { text-align: right; }
.summary .total { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.summary .total > span:first-child { color: var(--ink); font-size: 15px; font-weight: 500; letter-spacing: 0; }
.summary-back { margin-top: 6px; font-size: 15px; }

/* Estados */
.badge { display: inline-block; padding: 3px 10px; border: 0; border-radius: 999px; background: var(--wash); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge.warn { background: var(--amber-soft); color: #6b4e00; }
.badge.info { background: var(--blue-soft); color: #23427a; }
.badge.ok { background: var(--green-soft); color: #0b5a2f; }
.badge.bad { background: var(--red-soft); color: var(--red-dark); }

.order-list { display: grid; gap: 16px; }
.order { display: grid; gap: 11px; overflow: hidden; transition: box-shadow 0.25s, transform 0.25s var(--ease-out); }
.order:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.order .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: center; }
.order .top h2 { font-size: 21px; }
.order .meta { color: var(--muted); font-size: 14.5px; }
.order .total-line { font-weight: 700; }
.order .actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Seguimiento del pedido */
.track { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin: 6px 0 2px; }
.track li { position: relative; display: grid; justify-items: center; gap: 5px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.track li::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; border-top: 1px solid var(--line-strong); }
.track li:first-child::before { display: none; }
.track li.done::before, .track li.now::before { border-top-color: var(--red); }
.track .dot { position: relative; z-index: 1; width: 21px; height: 21px; border-radius: 50%; background: var(--paper); border: 3px solid var(--line); }
.track li.done .dot { background: var(--red); border-color: var(--red); }
.track li.now { color: var(--ink); font-weight: 700; }
.track li.now .dot { border-color: var(--red); background: var(--yellow); animation: pulse-dot 1.8s ease-out infinite; }

/* Pasos del pago */
.pay-steps { list-style: none; display: flex; margin-bottom: 22px; font-weight: 600; font-size: 14.5px; color: var(--muted); }
.pay-steps li { display: flex; flex: 1; align-items: center; gap: 8px; }
.pay-steps li:last-child { flex: none; }
.pay-steps li:not(:last-child)::after { content: ""; flex: 1; height: 1px; margin-inline: 6px 10px; background: var(--line-strong); }
.pay-steps li.done:not(:last-child)::after { background: var(--green); }
.pay-steps i { display: grid; flex: none; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); font-style: normal; font-size: 12.5px; }
.pay-steps .done i { background: var(--green); color: #fff; }
.pay-steps .now { color: var(--ink); }
.pay-steps .now i { background: var(--ink); color: #fff; }
@media (max-width: 620px) { .pay-steps li:not(.now) span { display: none; } }

/* Avisos */
.alert { padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--wash); font-size: 15px; }
.alert.error { background: var(--red-soft); border-color: #f1b3ad; color: #6e0b06; }
.alert.ok { background: var(--green-soft); border-color: #a9d9bb; color: #0b5a2f; }
.alert.warn { background: var(--amber-soft); border-color: #ecd38a; color: #5c4300; }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 44px 22px; color: var(--muted); }
.empty svg, .empty img { width: 110px; height: 110px; object-fit: cover; border-radius: var(--r); margin-bottom: 6px; }
.empty h2, .empty h3 { color: var(--ink); font-size: 25px; }
.empty .btn { margin-top: 10px; }

/* Métodos de pago */
.method-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.method-tabs button { display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); font-weight: 500; cursor: pointer; text-align: center; transition: border-color 0.2s, box-shadow 0.2s; }
.method-tabs button:hover:not([disabled]) { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.method-tabs button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.method-tabs button[disabled] { opacity: 0.5; cursor: not-allowed; }
.method-tabs .mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.pay-data { display: grid; padding: 4px 16px; border-radius: var(--r); background: var(--wash); }
.pay-data .item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: center; padding: 10px 0; }
.pay-data .item + .item { border-top: 1px solid var(--line); }
.pay-data .item .k { color: var(--muted); font-size: 14px; }
.pay-data .item .v { font-family: var(--font-mono); font-weight: 600; overflow-wrap: anywhere; }
.amount-due { font-family: var(--serif); font-size: clamp(34px, 3.4vw, 44px); letter-spacing: -0.02em; line-height: 1.05; }

/* Tablas del panel admin */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
table.data th { padding: 12px 16px; border-bottom: 1px solid var(--line); background: none; color: var(--muted); font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tbody tr { transition: background 0.15s; }
table.data tbody tr:hover { background: var(--cream); }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td { border-top: 1px solid var(--line); border-bottom: 0; background: var(--cream); font-weight: 700; }
.table-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-input { width: 130px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: var(--r); }
.product-edit { display: grid; grid-template-columns: 1.2fr repeat(3, 0.7fr) auto; gap: 12px; align-items: end; }
@media (max-width: 800px) { .product-edit { grid-template-columns: 1fr 1fr; } }

/* Mensaje flotante */
.toast-area { position: fixed; right: 16px; bottom: 84px; z-index: 50; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow-lg); }
.toast.error { background: var(--red-dark); }

/* Reparto por tallas */
.sizes { border: 1px solid var(--line); border-radius: var(--r); background: var(--cream); }
.sizes[open] { padding-bottom: 14px; }
.sizes summary { padding: 12px 14px; font-weight: 700; cursor: pointer; }
.sizes .hint, .size-group { margin-inline: 14px; }
.size-group { margin-top: 12px; }
.size-group > b { display: block; margin-bottom: 6px; font-size: 14px; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.size { display: grid; gap: 3px; text-align: center; font-size: 13.5px; font-weight: 700; }
.size input { width: 100%; padding: 8px 2px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--paper); text-align: center; }
.size input:focus { border-color: var(--ink); outline: none; }
.size-line { font-size: 14.5px; color: var(--muted); overflow-wrap: anywhere; }
.repeat-note { grid-column: 1 / -1; }

/* Olvidé mi contraseña */
.switch.forgot { margin-top: 6px; }
.switch.forgot a { display: inline-flex; align-items: center; gap: 6px; }

/* Panel: resumen, notas del pedido y clientes */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { display: grid; gap: 4px; padding: 15px 17px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color 0.2s, box-shadow 0.3s, transform 0.4s var(--ease-out); }
a.stat:hover { border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat b { font-family: var(--serif); font-size: 31px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; }
.stat span { color: var(--muted); font-size: 13.5px; line-height: 1.25; }
.stat.alert-on { border-color: #f1dc8c; background: var(--yellow-soft); }
.stat.alert-on span { color: var(--ink); }
.order-note { max-width: 340px; margin-top: 4px; font-size: 13.5px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.table-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.table-tools .input { flex: 1 1 220px; max-width: 400px; }
.table-tools .select, .row.between > .select { flex: 0 1 auto; width: auto; }
.temp-pass { display: grid; gap: 6px; }
.temp-pass code { padding: 4px 8px; border-radius: var(--r); background: var(--wash); font-family: var(--font-mono); font-size: 15px; width: fit-content; }
.link-wa { color: #0b6a37; font-weight: 700; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .stats { display: flex; gap: 8px; margin-inline: -18px; padding: 2px 18px 6px; overflow-x: auto; scrollbar-width: none; }
  .stats::-webkit-scrollbar { display: none; }
  .stat { flex: 0 0 136px; padding: 11px 13px; }
  .stat b { font-size: 25px; }
  .table-wrap { overflow: visible; border: 0; border-radius: 0; background: none; box-shadow: none; }
  table.data { display: block; min-width: 0; }
  table.data thead { display: none; }
  table.data tbody { display: grid; gap: 10px; }
  table.data tbody tr { display: block; padding: 6px 15px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-sm); }
  table.data tbody tr:hover { background: var(--paper); }
  table.data td { position: relative; display: block; min-height: 38px; padding: 8px 0 8px 96px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
  table.data tbody td:last-child { border-bottom: 0; }
  table.data td[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 8px; width: 88px; color: var(--muted); font-size: 13px; }
  table.data td:not([data-label]) { padding-left: 0; }
  table.data .num { text-align: left; }
  table.data tfoot { display: block; margin-top: 10px; border-radius: var(--r-lg); background: var(--wash); }
  table.data tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding: 10px 15px; }
  table.data tfoot td { min-height: 0; padding: 0; border: 0; background: none; }
}
@media (max-width: 600px) {
  .track li { font-size: 10.5px; letter-spacing: -0.01em; }
  .size-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Opciones de una línea y enlaces en forma de botón */
.radio-line { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-weight: 600; cursor: pointer; }
.radio-line input { width: 18px; height: 18px; accent-color: var(--ink); }
.link-btn { padding: 0; border: 0; background: none; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.price-strip { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.price-strip li { display: grid; gap: 1px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); text-align: center; }
.price-strip b { font-size: 19px; font-weight: 700; }
.price-strip span { color: var(--muted); font-size: 13px; line-height: 1.2; }
@media (max-width: 560px) { .price-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Chat */
.chat-root { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; }
.chat-launcher { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px 12px 16px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), var(--shadow-lg); transition: background 0.18s, transform 0.3s var(--ease-out); }
.chat-launcher:hover { transform: translateY(-1px); }
.chat-launcher:hover { background: #000; }
.chat-launcher:focus-visible { outline-color: var(--ink); }
.chat-ico { display: inline-grid; width: 24px; height: 24px; }
.chat-ico svg { width: 100%; height: 100%; }
.chat-badge { position: absolute; top: -8px; right: -6px; min-width: 24px; padding: 1px 6px; border: 2px solid #fff; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; text-align: center; }
.chat-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 110px)); overflow: hidden; border-radius: var(--r-lg); background: var(--cream); box-shadow: var(--shadow-lg); }
.chat-head { position: relative; display: flex; align-items: center; gap: 11px; padding: 12px 14px; background: var(--ink); color: #fff; }
.chat-head img { flex: none; border-radius: 50%; background: #fff; }
.chat-head div { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.chat-head b { font-size: 16px; font-weight: 600; }
.chat-head small { color: var(--on-dark); font-size: 13px; }
.chat-head small.on::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--yellow); }
.chat-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.chat-close:hover { background: rgba(255, 255, 255, 0.3); }
.chat-close:focus-visible { outline-color: #fff; }
.chat-list { display: flex; flex-direction: column; gap: 8px; padding: 14px; overflow-y: auto; overscroll-behavior: contain; }
.chat-msg { max-width: 84%; padding: 8px 12px 5px; border-radius: 15px; font-size: 15.5px; line-height: 1.38; }
.chat-msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg time { display: block; margin-top: 1px; font-size: 11.5px; text-align: right; }
.chat-msg.theirs { align-self: flex-start; border-bottom-left-radius: 4px; background: var(--paper); box-shadow: var(--shadow-sm); }
.chat-msg.mine { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--ink); color: #fff; }
.chat-msg.company { border-left: 3px solid var(--red); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.chat-msg.bot { background: var(--wash); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.chat-bot-tag { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.chat-image { display: block; margin: 2px 0 4px; }
.chat-image img { display: block; max-width: 100%; max-height: 220px; border-radius: var(--r); }
.chat-file-link { display: inline-block; margin: 2px 0 4px; color: inherit; font-weight: 700; text-decoration: underline; }
.chat-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chat-attach { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer; }
.chat-attach:hover { background: var(--wash); }
.chat-picked { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; overflow-wrap: anywhere; color: var(--muted); font-size: 14px; }
.chat-picked[hidden] { display: none; }
.chat-admin-form .chat-picked { flex: 1 0 100%; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; }
.chat-quick:empty { display: none; }
.chat-quick button { padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.chat-quick button:hover { background: var(--wash); }
.chat-form { display: grid; gap: 7px; padding: 10px 12px; background: var(--cream); }
.chat-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-input, .chat-name { width: 100%; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--paper); font-size: 16px; resize: none; }
.chat-input { max-height: 110px; line-height: 1.3; }
.chat-input:focus, .chat-name:focus { border-color: var(--ink); outline: none; }
.chat-send { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer; }
.chat-send:hover { background: #000; }
.chat-send:disabled { opacity: 0.6; }
.chat-notice { color: var(--red-dark); font-size: 14px; font-weight: 600; }
@media (max-width: 600px) {
  html.chat-open { overflow: hidden; }
  .chat-launcher { padding: 13px; }
  .chat-launcher-text { display: none; }
  .chat-root:has(.chat-panel:not([hidden])) { inset: 0; }
  .chat-panel { width: 100%; height: 100%; height: 100dvh; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* Chat en el panel */
.chat-admin { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 600px; overflow: hidden; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow-sm); }
.chat-admin-list { display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--line); }
.chat-admin-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.chat-admin-item:hover { background: var(--wash); }
.chat-admin-item[aria-current="true"] { background: var(--cream); box-shadow: inset 4px 0 0 var(--red); }
.chat-admin-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-admin-item small { grid-column: 1 / -1; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.chat-admin-waiting { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
.chat-admin-count { min-width: 24px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; text-align: center; }
.chat-admin-thread { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; background: var(--cream); }
.chat-admin-head { display: grid; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--paper); }
.chat-admin-form { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 10px 12px; }
.chat-admin-form .chat-input { flex: 1 1 200px; width: auto; }
.chat-admin-empty { padding: 20px; }
@media (max-width: 760px) {
  .chat-admin { grid-template-columns: minmax(0, 1fr); grid-template-rows: 190px minmax(0, 1fr); height: 720px; }
  .chat-admin-list { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* Precios por talla en el pedido */
.sizes summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.sizes summary b { color: var(--red-dark); font-size: 15px; }
.sizes .size-grid { margin: 2px 14px 0; }
.size.single { max-width: 110px; margin: 2px 14px 0; }
.summary-name { font-weight: 700; }
.quick-prices { list-style: none; display: grid; gap: 4px; margin: 8px 0; padding: 10px 12px; max-height: 210px; overflow-y: auto; border-radius: var(--r); background: var(--cream); }
.quick-prices li { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.quick-prices b { white-space: nowrap; }

/* Logos de pago y bancos */
.mark-logo { width: 40px; height: 40px; border-radius: var(--r); object-fit: contain; }
.bank-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.bank { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--paper); cursor: pointer; }
.bank:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bank input { accent-color: var(--red); }
.bank span { display: grid; line-height: 1.2; }
.bank small { color: var(--muted); }
.pay-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-weight: 500; font-size: 15px; }
.pay-logos img { border-radius: var(--r); background: #fff; }
.pay-logos b { padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: var(--ink); font-weight: 600; }

/* Precios en el panel */
.variant-list { display: grid; gap: 8px; }
.variant-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .variant-row { grid-template-columns: minmax(0, 1fr); } }

/* Zona para subir archivos */
.drop { position: relative; display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--paper); transition: border-color 0.18s, background 0.18s; }
.drop::before { content: ""; flex: none; width: 40px; height: 40px; border-radius: var(--r); background: var(--wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316171a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V5M7.5 9.5 12 5l4.500 4.500M5 19h14'/%3E%3C/svg%3E") center / 22px no-repeat; }
.drop:has(img:not([hidden]))::before { display: none; }
.drop:hover, .drop:focus-within { border-color: var(--ink); background: var(--cream); }
.drop.picked { border-style: solid; border-color: var(--green); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop img { flex: none; width: 56px; height: 56px; object-fit: contain; border-radius: var(--r); background: var(--wash); }
.drop-text { min-width: 0; }
.drop-text b { display: block; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.drop-text small { display: block; color: var(--muted); font-size: 13.5px; }

/* Detalle del pago */
.pay-entry { display: grid; gap: 12px; }
.pay-entry + .pay-entry { padding-top: 18px; border-top: 1px solid var(--line); }
.pay-entry h3 { font-size: 16px; }
.detail-list { margin: 0; border-bottom: 1px solid var(--line); }
.detail-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.detail-row dt { color: var(--muted); }
.detail-row dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
.proof-tile { display: flex; align-items: center; gap: 14px; }
.proof-thumb { flex: none; display: grid; place-items: center; width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--wash); color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.proof-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proof-tile b { display: block; font-weight: 600; font-size: 15px; }
.proof-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14.5px; }
.proof-form { padding: 16px; border-radius: var(--r); background: var(--cream); }

/* Estado del pago */
.status-panel { display: flex; align-items: center; gap: 16px; }
.status-panel > svg { flex: none; width: 52px; height: 52px; }
.status-panel > svg circle { fill: var(--green-soft); }
.status-panel > svg path { fill: none; stroke: var(--green); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.status-panel.wait > svg circle { fill: var(--amber-soft); }
.status-panel.wait > svg path { stroke: #8a6400; }
.status-panel h2 { font-size: 20px; }
.status-panel p { font-size: 15px; margin-top: 2px; }
.order-links { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.sw { width: 26px; height: 26px; padding: 0; border: 1px solid rgba(22, 23, 26, 0.16); border-radius: 50%; background: var(--sw); cursor: pointer; transition: transform 0.18s var(--ease-out); }
.sw:hover { transform: scale(1.16); }
.sw[aria-pressed="true"] { outline: 1.5px solid var(--ink); outline-offset: 2px; }

/* Colores y colegios en el catálogo */
.card-colors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card-colors .sw { width: 17px; height: 17px; }
.school-tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.school-tabs::-webkit-scrollbar { display: none; }
.school-tabs button { flex: none; display: grid; padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); color: var(--ink); text-align: left; cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.school-tabs button:hover { border-color: var(--line-strong); }
.school-tabs b { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.school-tabs small { color: var(--muted); font-size: 12.5px; }
.school-tabs [aria-selected="true"], .school-tabs [aria-selected="true"]:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.school-tabs [aria-selected="true"] small { color: var(--on-dark); }
.school-panel { display: grid; gap: 14px; animation: rise 0.45s var(--ease-out) both; }
.school-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 18px; padding: 12px 18px; border-radius: var(--r); background: var(--wash); font-size: 15px; }

/* Por cortar y existencias */
.catalog-prices { max-width: 620px; margin-bottom: 20px; }
.cut-alert { display: grid; gap: 6px; margin-bottom: 14px; padding: 14px 18px; border: 1px solid var(--red); border-left-width: 4px; border-radius: var(--r); background: var(--red-soft); }
.cut-alert h3 { font-size: 17px; }
.cut-alert ul { list-style: none; display: grid; gap: 2px; font-size: 15px; }
.cut-line { display: grid; justify-items: start; gap: 4px; margin: 4px 0; }
.stock-group summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; cursor: pointer; font-size: 17px; }
.stock-group[open] summary { margin-bottom: 12px; }
.stock-model { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.stock-name { font-size: 15.5px; font-weight: 700; }
.stock-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.stock-size { display: grid; gap: 2px; text-align: center; font-size: 13px; font-weight: 600; }
.stock-input { width: 100%; padding: 7px 2px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--paper); text-align: center; font-weight: 700; }
.stock-input.empty { color: var(--faint); font-weight: 500; }
