:root {
  --blue: #0f3d91;
  --blue-dark: #092b67;
  --blue-soft: #eaf2ff;
  --text: #17243b;
  --muted: #667085;
  --line: #d5dfed;
  --green: #0e8f68;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f3f7fc; color: var(--text); font: 16px/1.5 system-ui, sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }

.cotizador { width: min(100% - 20px, 1100px); margin: auto; padding: 16px 0 50px; }
.hero, .metodos button, #vista-cotizador, #proforma, #datos-cliente, .card, .selector, #quote-summary { border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 22px #092b6710; }
.hero { padding: 22px; background: #fff; }
.hero h1 { margin: 6px 0; color: var(--blue); font-size: clamp(1.9rem, 6vw, 3.2rem); line-height: 1.05; }
.hero a, [data-back] { display: inline-flex; align-items: center; gap: 5px; min-height: 38px; padding: 7px 12px; border: 1px solid #b9cbe5; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 800; text-decoration: none; }
.hero a:hover, .hero a:focus-visible, [data-back]:hover, [data-back]:focus-visible { border-color: var(--blue); background: #dceaff; outline: none; }

#quote-summary { position: sticky; top: 8px; z-index: 30; width: 100%; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 14px; background: var(--blue-dark); color: #fff; text-align: left; }
#quote-summary span, #quote-summary strong, #quote-summary small { display: block; }
#quote-summary span { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
#quote-summary strong { font-size: 1rem; }
#quote-summary small { color: #cfe0ff; }
#quote-summary .quote-summary-total { color: #fff; font-size: 1.08rem; font-weight: 900; letter-spacing: .01em; }

.metodos, .types, .cards { display: grid; gap: 8px; }
.metodos { grid-template-columns: repeat(3, 1fr); }
.metodos button { min-height: 82px; padding: 12px; background: #fff; color: var(--blue); text-align: left; }
.metodos button:hover, .metodos button:focus-visible { border-color: var(--green); transform: translateY(-1px); }
.metodos b, .metodos span, .types span { display: block; }
.metodos span, .types span, .muted { color: var(--muted); }

#vista-cotizador { margin-top: 14px; padding: 14px; background: #edf4ff; border-color: #c7d8f1; }
#vista-cotizador > h2, #vista-cotizador > h3 { margin-top: 4px; color: var(--blue-dark); }
#proforma, #datos-cliente { display: none !important; }

.types { grid-template-columns: repeat(3, 1fr); }
.type-section { margin-top: 18px; padding-top: 12px; border-top: 2px solid var(--line); }
.type-section--glass { border-color: #9bb9ea; }
.type-section--gel { border-color: #91d2be; }
.types-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; color: var(--blue-dark); font-size: 1.08rem; letter-spacing: .06em; }
.types-heading span { font-weight: 900; }
.types-heading small { color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.types button { min-height: 74px; padding: 11px; color: var(--blue); text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.type-card b { display: block; }
.cards { grid-template-columns: repeat(2, 1fr); margin-top: 8px; }
.product-card { padding: 11px; background: #fff; }
.product-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.product-card h3 { margin: 2px 0 5px; color: var(--blue-dark); font-size: 1.08rem; }
.product-card ul { min-height: 42px; margin: 5px 0; padding-left: 18px; font-size: .88rem; }
.card-kicker { color: var(--muted); font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.reference-lockup, .family-heading, .product-ref { display: inline-flex; align-items: baseline; gap: 6px; }
.reference-lockup strong, .family-heading strong, .product-ref strong { color: var(--blue); font-size: 1.18rem; letter-spacing: .02em; }
.family-heading { margin: 2px 0 8px; }
.product-name { order: 2; }
.product-price { margin: 7px 0; color: var(--blue-dark); font-size: .98rem; font-weight: 800; }
.product-ref { margin: 0 0 3px; color: var(--muted); font-size: .78rem; }
.gel-note { display: block; margin-top: 3px; color: var(--green); font-size: .78rem; font-weight: 700; }
.pending-price { display: block; color: var(--danger); font-size: .78rem; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--blue); font-weight: 700; text-decoration: underline; }

.quick-buy { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.quantity-control { display: inline-flex; align-items: center; gap: 5px; }
.quantity-control button { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--blue-soft); color: var(--blue-dark); font-size: 1.15rem; font-weight: 800; }
.quantity-control input { width: 52px; min-height: 32px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; text-align: center; }
.quick-buy output { color: var(--blue-dark); font-size: .88rem; font-weight: 700; }
.quick-buy [data-quick-add] { grid-column: 1 / -1; min-height: 38px; border: 0; border-radius: 9px; background: var(--green); color: #fff; font-weight: 800; }

.proforma-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.line { display: grid; gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line span { color: var(--muted); }
.quote-modal { width: min(94vw, 700px); max-height: 88dvh; padding: 0; border: 0; border-radius: 16px; box-shadow: 0 18px 60px #092b6740; }
.quote-modal::backdrop, .success-modal::backdrop { background: #092b6788; }
.quote-modal__box { position: relative; display: flex; max-height: 88dvh; margin: 0; padding: 0; }
.quote-modal__close { position: absolute; top: 10px; right: 12px; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-size: 1.6rem; line-height: 1; }
.quote-modal__content { width: 100%; overflow-y: auto; padding: 22px 20px 24px; }
.quote-sheet h2 { margin: 0 42px 10px 0; color: var(--blue-dark); }
.quote-line-title { color: var(--blue-dark); font-size: 1rem; }
.quote-total { margin: 16px 0 8px; color: var(--blue-dark); font-size: 1.2rem; }
.quote-send { min-height: 44px; border: 0; border-radius: 9px; background: var(--green); color: #fff; font-weight: 800; }
.quote-empty { padding: 16px 0 10px; }
.responsible-note { margin: 12px 0; padding: 9px 11px; border-left: 3px solid var(--green); background: #eefaf5; color: #35665a; font-size: .78rem; }
.quote-client { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.quote-client h3 { margin-top: 0; color: var(--blue-dark); }
.quote-submitted { padding: 10px; border-radius: 8px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; }
.success-modal { width: min(92vw, 430px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 18px 60px #092b6740; }
.success-modal__box { display: grid; gap: 6px; margin: 0; padding: 28px 24px 24px; text-align: center; }
.success-modal__box h2 { margin: 0; color: var(--green); }
.success-modal__box p { margin: 4px 0 0; color: var(--muted); }
.success-modal__icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 4px; border-radius: 50%; background: #dff6ed; color: var(--green); font-size: 1.8rem; font-weight: 900; }
.success-modal__finish { min-height: 44px; margin-top: 12px; border: 0; border-radius: 9px; background: var(--blue-dark); color: #fff; font-weight: 900; }
form { display: grid; gap: 12px; }
form label { display: grid; gap: 4px; font-weight: 700; }
input { min-height: 42px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; }
.error { color: var(--danger); }

.modelos-modal { width: min(92vw, 620px); max-height: 85dvh; padding: 0; border: 0; border-radius: 16px; box-shadow: 0 18px 60px #092b6740; }
.modelos-modal::backdrop { background: #092b6788; }
.modelos-modal__caja { position: relative; padding: 20px; }
.modelos-modal__caja h2 { margin: 0; color: var(--blue-dark); }
.modelos-modal__cerrar { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-size: 1.6rem; line-height: 1; }
.modelos-modal__lista { display: grid; max-height: 62dvh; gap: 7px; overflow-y: auto; padding-right: 4px; }
.modelos-modal__lista div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #f7faff; }

.back-to-top { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--blue-dark); color: #fff; box-shadow: 0 8px 22px #092b6740; font-size: 1.35rem; font-weight: 900; }
.back-to-top:hover, .back-to-top:focus-visible { background: var(--blue); outline: 3px solid #b9cbe5; outline-offset: 2px; }

@media (max-width: 720px) {
  .cotizador { width: min(100% - 14px, 560px); padding-top: 10px; }
  .hero { padding: 18px; }
  .metodos, .types, .cards { grid-template-columns: 1fr; }
  .types-heading { display: block; }
  .types-heading small { display: block; margin-top: 2px; }
  #quote-summary { grid-template-columns: 1fr auto; }
  #quote-summary small { grid-column: 1 / -1; }
  .quote-modal__content { padding: 20px 15px 22px; }
}
