/*
 * NovaSoap Docs — standalone web pages (quote, lists, gate, signature).
 * Matches the "Plantillas web" page in Figma (NSD - Prints).
 */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.nsd-page {
	min-height: 100vh;
	background: var(--nsd-surface);
	color: var(--nsd-text);
	font-family: 'Lexend Giga', Verdana, sans-serif;
	font-size: 14px;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--nsd-secondary); }
.nsd-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

/* Top bar */
.nsd-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 80px; background: var(--nsd-white); border-bottom: 1px solid var(--nsd-border); position: sticky; top: 0; z-index: 10; }
.nsd-bar__logo img { display: block; width: 130px; height: auto; }
.nsd-bar__summary { text-align: center; min-width: 0; }
.nsd-bar__title { font-size: 14px; font-weight: 600; color: var(--nsd-secondary); }
.nsd-bar__detail { font-size: 12px; color: var(--nsd-text-secondary); margin-top: 2px; }
.nsd-bar__actions { display: flex; gap: 12px; flex-shrink: 0; }

/* Buttons (DS: Label/button — Lexend Giga Medium 12 / +1.5 / uppercase) */
.nsd-btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 12px 20px; border-radius: 5px; border: 1px solid transparent; font: 500 12px/1 'Lexend Giga', Verdana, sans-serif; letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.nsd-btn--primary { background: var(--nsd-secondary); color: var(--nsd-white); }
.nsd-btn--primary:hover { background: #123546; }
.nsd-btn--outline { background: transparent; color: var(--nsd-secondary); border-color: var(--nsd-secondary); }
.nsd-btn--outline:hover { background: var(--nsd-secondary); color: var(--nsd-white); }
.nsd-btn--block { width: 100%; }

/* Document "paper" */
.nsd-main { padding: 40px 16px 56px; }
.nsd-paper { width: 816px; max-width: 100%; margin: 0 auto; background: var(--nsd-white); box-shadow: 0 8px 32px rgba(8, 23, 30, .10); }
.nsd-doc__head { position: relative; height: 112px; background-color: var(--nsd-secondary); background-repeat: no-repeat; background-size: 816px 112px; background-position: left top; }
.nsd-doc__title { position: absolute; right: 200px; top: 50%; transform: translateY(-50%); text-align: right; color: var(--nsd-white); }
.nsd-doc__title-main { font-size: 20px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }
.nsd-doc__title-detail { font-size: 9px; letter-spacing: .7px; margin-top: 4px; }
.nsd-doc__body { padding: 24px 48px 40px; }
.nsd-doc__foot { margin: 0 48px; padding: 14px 0 20px; border-top: 2px solid var(--nsd-primary); font-size: 10px; color: var(--nsd-text-secondary); }
.nsd-footnote { max-width: 816px; margin: 24px auto 0; text-align: center; font-size: 11px; font-weight: 300; color: var(--nsd-text-secondary); }

/* Gate */
.nsd-page--centered .nsd-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.nsd-gate { width: 440px; max-width: 100%; padding: 40px; background: var(--nsd-white); border-radius: 12px; box-shadow: 0 8px 32px rgba(8, 23, 30, .10); text-align: center; }
.nsd-gate__logo { display: block; width: 140px; height: auto; margin: 0 auto 20px; }
.nsd-gate__icon { width: 48px; height: 48px; margin: 0 auto 20px; border-radius: 50%; background: var(--nsd-primary-100); display: flex; align-items: center; justify-content: center; }
.nsd-gate__title { margin: 0 0 8px; font-size: 22px; font-weight: 600; color: var(--nsd-secondary); }
.nsd-gate__text { margin: 0 0 20px; font-size: 13px; font-weight: 300; line-height: 1.6; }
.nsd-gate__form { text-align: left; }
.nsd-field { display: block; margin-bottom: 20px; }
.nsd-field__label { display: block; font-size: 13px; margin-bottom: 8px; }
.nsd-field__input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--nsd-border); border-radius: 5px; font: 400 14px 'Lexend Giga', Verdana, sans-serif; color: var(--nsd-text); }
.nsd-field__input:focus { outline: none; border-color: var(--nsd-secondary); box-shadow: 0 0 0 3px rgba(22, 66, 87, .15); }
.nsd-field__input.is-error { border-color: #C0362D; }
.nsd-field__error { display: block; margin-top: 6px; font-size: 12px; color: #C0362D; }
.nsd-gate__help { margin: 20px 0 0; font-size: 11px; color: var(--nsd-text-secondary); }

/* Signature page */
.nsd-sig { width: 760px; max-width: 100%; margin: 0 auto; }
.nsd-sig__title { margin: 0 0 6px; font-size: 22px; font-weight: 600; color: var(--nsd-secondary); }
.nsd-sig__text { margin: 0 0 20px; font-size: 13px; font-weight: 300; color: var(--nsd-text-secondary); }
.nsd-card { background: var(--nsd-white); border-radius: 12px; box-shadow: 0 6px 24px rgba(8, 23, 30, .08); }
.nsd-sig__mail { padding: 32px 40px; overflow-x: auto; }
.nsd-sig__msg { font-size: 13px; font-weight: 300; line-height: 1.65; margin: 12px 0 18px; }
.nsd-sig__actions { display: flex; gap: 12px; margin: 20px 0; }
.nsd-sig__tips { padding: 16px 20px; }
.nsd-sig__tips p { margin: 8px 0 0; font-size: 12px; font-weight: 300; line-height: 1.6; }

@media (max-width: 900px) {
	.nsd-bar { flex-wrap: wrap; padding: 12px 16px; }
	.nsd-bar__summary { order: 3; width: 100%; text-align: left; }
	.nsd-doc__title { right: calc(100% - 616px); } /* Same spot as desktop: left of the green planes. */
	.nsd-doc__body { padding: 20px 16px 28px; }
	.nsd-doc__foot { margin: 0 16px; }
	.nsd-paper { overflow-x: auto; }
	.nsd-sig__mail { padding: 20px; }
	.nsd-sig__actions { flex-direction: column; }
}

/*
 * Phones. Only the web view loads this file, so the PDF keeps the desktop
 * layout. The document tables are re-flowed with grid/flex here.
 */
@media (max-width: 640px) {
	/* Bar: logo, summary and stacked buttons, all centered; scrolls away. */
	.nsd-bar { position: static; flex-direction: column; align-items: center; gap: 12px; padding: 16px; text-align: center; }
	.nsd-bar__logo img { width: 112px; }
	.nsd-bar__summary { order: 2; text-align: center; }
	.nsd-bar__actions { order: 3; flex-direction: column; gap: 8px; width: 100%; max-width: 320px; }
	.nsd-bar__actions .nsd-btn { width: 100%; height: 44px; }
	.nsd-main { padding: 16px 12px 32px; }

	/* Brand band: logo stays in the image; the title drops below it. */
	.nsd-doc__head { height: auto; padding: 78px 20px 18px; background-size: 612px 84px; }
	.nsd-doc__title { position: static; transform: none; text-align: left; }
	.nsd-doc__title-main { font-size: 17px; }
	.nsd-doc__body { padding: 20px 16px 24px; }

	/* Quote: meta 2×2, client/delivery stacked. */
	.nsd-meta tr { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
	.nsd-meta td { width: auto; padding: 0; }
	.nsd-rule { margin: 16px 0 18px; }
	.nsd-boxes tr { display: flex; flex-direction: column; gap: 8px; }
	td.nsd-box { width: auto; }
	td.nsd-gap { display: none; }

	/* Quote items as cards: name / presentation / "qty × price   amount". */
	.nsd-items thead { display: none; }
	.nsd-items tbody tr { display: grid; grid-template-columns: 22px auto 1fr auto; column-gap: 6px; row-gap: 3px; padding: 12px; }
	.nsd-items tbody tr:first-child { border-top: 2px solid var(--nsd-secondary); }
	.nsd-items tr.is-alt { background: var(--nsd-surface); }
	.nsd-items tbody td { padding: 0; background: none !important; }
	.nsd-items td.nsd-items__num { grid-row: 1 / 4; width: auto; }
	.nsd-items td:nth-child(2) { grid-column: 2 / 5; font-size: 12px; }
	.nsd-items td:nth-child(3) { grid-column: 2 / 5; color: var(--nsd-muted); }
	.nsd-items td:nth-child(4) { grid-column: 2; }
	.nsd-items td:nth-child(4)::after { content: ' ×'; }
	.nsd-items td:nth-child(5) { grid-column: 3; text-align: left; color: var(--nsd-muted); }
	.nsd-items td:nth-child(6) { grid-column: 4; font-size: 12px; }
	.nsd-items tr.nsd-items__end { display: block; padding: 0; }
	.nsd-items tr.nsd-items__end td { display: block; }

	/* Totals first, then conditions. */
	.nsd-bottom > tbody > tr, .nsd-bottom > tr { display: flex; flex-direction: column-reverse; gap: 20px; }
	td.nsd-conds { padding-right: 0; }
	td.nsd-totals-cell { width: auto; }

	/* Catalog: one product per row. */
	.nsd-grid tr { display: flex; flex-direction: column; }
	td.nsd-grid__cell { width: auto; padding: 7px 0 7px 14px; text-indent: -14px; }
	.nsd-pres { padding-left: 0; text-indent: 0; }
	td.nsd-grid__cell:empty, td.nsd-grid__gap { display: none; }
	td.nsd-line__name { font-size: 15px; }

	/* Price list: tighter cells so three or four price columns fit. */
	.nsd-prices th, .nsd-prices td { padding: 6px 5px; }
	.nsd-prices th:first-child, .nsd-prices td:first-child { padding-left: 8px; }
	.nsd-prices th:last-child, .nsd-prices td:last-child { padding-right: 8px; }
	td.nsd-prices__col { font-size: 10px; }

	.nsd-gate { padding: 28px 20px; }
	.nsd-footnote { padding: 0 8px; }
}
