.templates-hero { padding-bottom: 64px; }
.templates-hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); gap: 64px; align-items: center; }
.templates-hero-examples { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.templates-hero-examples article { min-width: 0; padding: 18px; color: var(--gyg-blue); background: #fff; border: 1px solid #577398; border-top: 4px solid var(--gyg-yellow); border-radius: 9px; }
.templates-hero-examples article:nth-child(2) { margin-top: 42px; border-top-color: var(--gyg-orange); }
.templates-hero-examples header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid #dce3ea; font-size: 11px; font-weight: 900; }
.templates-hero-examples img { width: 106px; height: 38px; object-fit: contain; object-position: left center; }
.templates-hero-examples p { margin: 17px 0 13px; color: var(--gyg-blue); font-size: 11px; font-weight: 850; }
.templates-hero-examples article > i { display: block; height: 7px; margin-top: 7px; background: #e7ecf1; border-radius: 2px; }
.templates-hero-examples article > i:nth-of-type(2) { width: 68%; }
.templates-hero-examples footer { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 13px; border-top: 2px solid var(--gyg-blue); }
.templates-hero-examples footer b { font-size: 17px; }

.template-preview-strip { padding: 24px 0; background: #f3f6f9; border-bottom: 1px solid #d5dee7; }
.template-preview-strip .container { display: grid; grid-template-columns: repeat(10, minmax(102px, 1fr)); gap: 12px; overflow-x: auto; padding-top: 5px; }
.template-preview { --preview-accent: #287db4; min-width: 102px; min-height: 132px; display: flex; flex-direction: column; padding: 10px; color: var(--gyg-blue); background: #fff; border: 1px solid #cdd8e2; border-top: 5px solid var(--preview-accent); border-radius: 5px; text-align: left; }
.template-preview:hover,
.template-preview[aria-current="true"] { border-color: var(--preview-accent); outline: 2px solid color-mix(in srgb, var(--preview-accent) 22%, transparent); outline-offset: 2px; }
.template-preview > span { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding-bottom: 8px; border-bottom: 1px solid #dfe5eb; }
.template-preview > span i { width: 21px; height: 8px; background: var(--preview-accent); }
.template-preview > span b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.template-preview > small { display: block; width: 100%; height: 5px; margin-top: 11px; background: #e1e7ed; }
.template-preview > small + small { width: 68%; margin-top: 6px; }
.template-preview > em { width: 50%; height: 18px; margin: auto 0 0 auto; background: var(--preview-accent); opacity: .88; }
.template-preview--compacta { --preview-accent: #1a2a4a; }
.template-preview--editorial { --preview-accent: #a35419; font-family: Georgia, serif; }
.template-preview--tecnica { --preview-accent: #2557d6; font-family: "Courier New", monospace; }
.template-preview--profesional { --preview-accent: #0f6dcc; }
.template-preview--oficios { --preview-accent: #137a5b; }
.template-preview--creativa { --preview-accent: #a47a42; }
.template-preview--minimal { --preview-accent: #4d5965; }
.template-preview--atlantica { --preview-accent: #1a6b4f; }
.template-preview--esencial { --preview-accent: #2f6fb2; }

.template-section-title { margin-bottom: 38px; }
.template-section-title h2 { max-width: 1120px; margin: 0; }
.template-section-title > p { max-width: 1060px; margin: 18px 0 0; font-size: 17px; line-height: 1.75; }

.template-viewer { display: grid; grid-template-columns: 180px minmax(0, 1fr); overflow: hidden; border: 1px solid #ccd7e1; border-radius: 12px; }
.template-tabs { display: grid; grid-template-columns: 1fr; align-content: start; background: var(--gyg-blue); }
.template-tabs button { min-height: 62px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; align-items: center; padding: 11px 14px; color: #dce6f2; border-bottom: 1px solid #496481; text-align: left; font-size: 13px; font-weight: 800; }
.template-tabs button span { color: #8eabc8; font-size: 10px; letter-spacing: .06em; }
.template-tabs button:last-child { border-bottom: 0; }
.template-tabs button:hover { background: #25466d; }
.template-tabs button[aria-pressed="true"] { color: #0b315d; background: #f4f7fa; box-shadow: inset 5px 0 #126783; }
.template-tabs button[aria-pressed="true"] span { color: #126783; }
.template-viewer-body { min-width: 0; display: grid; grid-template-columns: 235px minmax(0, 1fr); }
.template-description { padding: 30px; background: #f4f7fa; border-right: 1px solid #ccd7e1; }
.template-description article { position: sticky; top: 130px; }
.template-description article > span { color: var(--gyg-orange); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.template-description h3 { margin: 9px 0 0; font-size: 27px; }
.template-description article > p { margin: 14px 0 0; line-height: 1.65; }
.template-description ul { display: grid; gap: 10px; margin: 24px 0; padding: 0; list-style: none; }
.template-description li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 7px; color: #53657a; font-size: 13px; }
.template-description li i { color: #087354; }
.template-generator-link { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; color: #fff; background: var(--gyg-orange); border-radius: 7px; font-size: 13px; font-weight: 850; }
.template-generator-link:hover { color: #fff; background: #e84725; }
.template-generator-link:focus-visible { outline: 3px solid #102d54; outline-offset: 3px; }
.template-view-only { display: flex; align-items: center; gap: 9px; margin: 0; padding: 12px 0; color: #5b6c80; border-top: 1px solid #d3dde6; font-size: 13px; font-weight: 750; }
.template-view-only i { color: #0d789c; }
.template-stage { min-width: 0; display: grid; justify-content: center; padding: 38px; background: #e9eef3; }

.invoice-template { --document-accent: #287db4; width: 720px; min-height: 1018px; display: flex; flex-direction: column; padding: 46px; color: #253448; background: #fff; border: 1px solid #cfd8e1; font-size: 13px; line-height: 1.45; }
.document-head { display: flex; justify-content: space-between; gap: 34px; align-items: flex-start; padding-bottom: 24px; border-bottom: 3px solid var(--document-accent); }
.document-logo-panel { width: min(100%, 410px); min-width: 0; display: grid; grid-template-columns: minmax(105px, 150px) minmax(150px, 1fr); align-items: center; gap: 18px; padding: 4px; background: #fff; }
.document-logo-panel img { width: 150px; height: 54px; object-fit: contain; object-position: left center; }
.document-issuer { display: block; min-width: 0; padding-left: 17px; border-left: 1px solid #ccd6df; line-height: 1.45; }
.document-issuer b,
.document-issuer span { display: block; }
.document-issuer b { color: var(--gyg-blue); font-size: 13px; line-height: 1.3; }
.document-issuer span { color: #526479; font-size: 11px; }
.document-identity { flex: 0 0 auto; text-align: right; }
.document-identity small,
.document-identity strong { display: block; }
.document-identity small { color: var(--document-accent); font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.document-identity strong { margin-top: 6px; color: var(--gyg-blue); font-size: 25px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.document-context { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 44px; padding: 30px 0; }
.document-client small,
.document-client b,
.document-client span { display: block; }
.document-client small { color: var(--document-accent); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.document-client b { margin-top: 8px; color: var(--gyg-blue); font-size: 18px; }
.document-client span { margin-top: 3px; color: #56697c; }
.document-dates { margin: 0; }
.document-dates div { display: flex; justify-content: space-between; gap: 15px; padding: 8px 0; border-bottom: 1px solid #dce3e9; }
.document-dates dt { color: #607286; }
.document-dates dd { margin: 0; color: var(--gyg-blue); font-weight: 850; text-align: right; }
.document-notes { margin-bottom: 26px; padding: 16px 18px; background: #f7f9fb; border: 1px dashed #b9c8d7; border-radius: 8px; }
.document-notes small { color: #526479; font-weight: 900; }
.document-notes p { margin: 5px 0 0; color: #394b60; }
.document-lines { margin-top: 4px; }
.document-line-head,
.document-line { display: grid; grid-template-columns: minmax(0, 1fr) 52px 90px 52px 52px 86px; }
.document-line-head { color: #fff; background: var(--document-accent); font-size: 11px; font-weight: 850; }
.document-line-head span,
.document-line > span { padding: 11px 8px; text-align: right; }
.document-line-head span { white-space: nowrap; }
.document-line-head span:first-child,
.document-line > span:first-child { text-align: left; }
.document-line { border-bottom: 1px solid #dce3e9; }
.document-line > span { color: #45586d; }
.document-line b,
.document-line small { display: block; }
.document-line b { color: var(--gyg-blue); }
.document-line small { margin-top: 3px; color: #526479; font-size: 10px; line-height: 1.35; }
.document-summary { width: 330px; margin: 34px 0 0 auto; }
.document-summary > div { display: grid; gap: 7px; padding: 0 8px; }
.document-summary > div span { display: flex; justify-content: space-between; gap: 20px; color: #607286; }
.document-summary > strong { display: flex; justify-content: space-between; gap: 20px; margin-top: 14px; padding: 14px 17px; color: #fff; background: var(--document-accent); border-radius: 6px; font-size: 21px; }
.document-summary > strong small { align-self: center; font-size: 11px; text-transform: uppercase; }
.document-foot { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 28px; align-items: end; margin-top: auto; padding-top: 36px; }
.document-payment { padding-top: 15px; border-top: 1px solid #d8e1e8; }
.document-payment small,
.document-payment b,
.document-payment span { display: block; }
.document-payment small { color: #526479; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.document-payment b { margin-top: 5px; color: var(--gyg-blue); }
.document-payment span { margin-top: 3px; color: #53667a; }
.document-qr { width: 64px; height: 64px; object-fit: contain; }
.document-company-close { display: grid; gap: 2px; margin: 17px 0 0; padding-top: 12px; color: #526479; border-top: 1px solid #aebbc7; font-size: 9px; text-align: center; }
.document-company-close b { color: #4d5f72; font-size: 10px; }
.document-company-close span { display: block; }

.template--compacta { --document-accent: #1a2a4a; padding: 36px; }
.template--compacta .document-head { align-items: center; padding: 13px 16px; border: 1px solid #1a2a4a; }
.template--compacta .document-identity { padding-left: 18px; border-left: 1px solid #c9d2dc; }
.template--compacta .document-identity strong { font-size: 21px; }
.template--compacta .document-context { padding: 22px 0; }
.template--compacta .document-line-head span,
.template--compacta .document-line > span { padding-block: 8px; }
.template--compacta .document-foot { padding-top: 22px; }

.template--editorial { --document-accent: #a35419; padding-left: 68px; border-left: 10px solid #a35419; }
.template--editorial .document-head { flex-direction: row-reverse; align-items: center; gap: 26px; border-bottom-width: 1px; }
.template--editorial .document-logo-panel { width: min(100%, 365px); grid-template-columns: 135px minmax(150px, 1fr); }
.template--editorial .document-identity { text-align: left; }
.template--editorial .document-identity small { font: italic 18px/1.2 Georgia, serif; letter-spacing: 0; text-transform: none; }
.template--editorial .document-identity strong { font: 500 30px/1.05 Georgia, serif; }
.template--editorial .document-line-head { color: #4c321f; background: #fff; border-block: 1px solid #b8845e; }
.template--editorial .document-summary > strong { color: #4c321f; background: #f0e4d8; }

.template--tecnica { --document-accent: #466f9e; font-family: Arial, Helvetica, sans-serif; }
.template--tecnica .document-head,
.template--tecnica .document-context,
.template--tecnica .document-notes,
.template--tecnica .document-lines,
.template--tecnica .document-summary { border-radius: 0; }
.template--tecnica .document-context { gap: 0; }
.template--tecnica .document-context { padding-block: 18px; }
.template--tecnica .document-client,
.template--tecnica .document-dates { padding: 16px; border: 1px solid #cbd5df; }
.template--tecnica .document-dates { border-left: 0; }
.template--tecnica .document-head { border-bottom-color: #b9c5d0; }
.template--tecnica .document-notes { border-color: #c7d1db; }
.template--tecnica .document-line-head { color: #2c3f55; background: #eef2f5; border-block: 1px solid #c4ced8; }
.template--tecnica .document-line { border-inline: 1px solid #d3dbe3; border-bottom-color: #d3dbe3; }

.template--profesional { --document-accent: #0f6dcc; padding: 50px 46px; }
.template--profesional .document-head { border: 0; }
.template--profesional .document-logo-panel { width: 100%; max-width: none; display: flex; justify-content: space-between; }
.template--profesional .document-logo-panel img { order: 2; width: 175px; height: 72px; }
.template--profesional .document-issuer { display: block; order: 1; padding-left: 0; border-left: 0; }
.template--profesional .document-issuer b { font-size: 16px; }
.template--profesional .document-identity { display: none; }
.template--profesional .document-context { grid-template-columns: minmax(0, 1fr) 285px; align-items: end; margin-top: 15px; padding-bottom: 24px; }
.template--profesional .document-client b { font-size: 23px; line-height: 1.25; }
.template--profesional .document-dates div { padding: 10px 0; }
.template--profesional .document-notes { margin-bottom: 26px; padding: 17px 20px; }
.template--profesional .document-line-head { font-size: 12px; }
.template--profesional .document-summary { margin-top: 30px; }
.template--profesional .document-payment { padding: 15px 18px; background: #f2f7fc; border: 1px solid #d3e2f0; }

.template--oficios { --document-accent: #137a5b; border-top: 24px solid #137a5b; }
.template--oficios .document-head { border-bottom: 0; }
.template--oficios .document-logo-panel img { width: 94px; height: 76px; }
.template--oficios .document-identity strong { font-size: 22px; }
.template--oficios .document-context { padding: 12px 18px; background: #eef8f4; border: 1px solid #bcd9cf; }
.template--oficios .document-notes { margin-top: 20px; }
.template--oficios .document-payment { padding: 14px 16px; background: #eef8f4; border: 1px solid #bcd9cf; }

.template--tecnica .document-foot,
.template--profesional .document-foot { padding-top: 20px; }
.template--tecnica .document-company-close,
.template--profesional .document-company-close { margin-top: 10px; padding-top: 9px; }

.template--creativa { --document-accent: #a47a42; padding: 54px; }
.template--creativa .document-head { border-bottom: 1px solid #cdb58f; }
.template--creativa .document-identity small { color: #765b36; font: italic 18px/1 Georgia, serif; letter-spacing: 0; text-transform: none; }
.template--creativa .document-identity strong { color: #765b36; font-size: 23px; font-weight: 500; }
.template--creativa .document-line-head { color: #604b30; background: #f1e8da; }
.template--creativa .document-summary > strong { color: #4a3823; background: #e7d6bb; }
.template--creativa .document-foot::before { content: "Gracias por confiar en nuestro trabajo"; align-self: center; color: #8a6a3f; font: italic 16px Georgia, serif; }
.template--creativa .document-payment { display: none; }
.template--creativa .document-foot { grid-template-columns: 1fr 64px; }

.template--minimal { --document-accent: #4d5965; padding: 46px 50px; }
.template--minimal .document-head { gap: 18px; border-bottom: 1px solid #8f9aa4; }
.template--minimal .document-logo-panel { width: min(100%, 420px); grid-template-columns: minmax(150px, 185px) minmax(170px, 1fr); gap: 16px; }
.template--minimal .document-logo-panel img { width: 180px; height: 66px; }
.template--minimal .document-issuer { padding-left: 14px; }
.template--minimal .document-issuer b { font-size: 11px; overflow-wrap: anywhere; }
.template--minimal .document-identity { flex: 0 0 180px; max-width: 180px; }
.template--minimal .document-identity strong { font-size: 17px; font-weight: 600; letter-spacing: .01em; white-space: normal; overflow-wrap: anywhere; }
.template--minimal .document-context { padding-block: 26px; }
.template--minimal .document-line-head { color: #253448; background: #fff; border-block: 1px solid #8f9aa4; }
.template--minimal .document-summary { margin-top: 42px; }
.template--minimal .document-summary > strong { color: #253448; background: #fff; border-block: 2px solid #253448; border-radius: 0; }

.template--atlantica { --document-accent: #1a6b4f; }
.template--atlantica .document-head { gap: 18px; padding: 0 0 24px; background: #fff; border: 0; }
.template--atlantica .document-logo-panel { width: min(100%, 400px); grid-template-columns: minmax(180px, 235px) minmax(145px, 1fr); gap: 14px; }
.template--atlantica .document-issuer { padding-left: 0; border-left: 0; }
.template--atlantica .document-logo-panel img { width: 225px; height: 88px; }
.template--atlantica .document-identity { flex: 0 0 205px; max-width: 205px; }
.template--atlantica .document-identity strong { font-size: 17px; font-weight: 650; white-space: normal; overflow-wrap: anywhere; }
.template--atlantica .document-identity small,
.template--atlantica .document-client > small,
.template--atlantica .document-payment > small { display: flex; align-items: center; gap: 7px; }
.template--atlantica .document-identity small { justify-content: flex-end; }
.template--atlantica .document-identity small i,
.template--atlantica .document-client > small i,
.template--atlantica .document-payment > small i { color: var(--document-accent); font-size: 11px; }
.template--atlantica .document-dates { padding: 14px 18px; background: color-mix(in srgb, var(--document-accent) 8%, white); border-left: 5px solid var(--document-accent); }
.template--atlantica .document-line-head { background: var(--document-accent); }
.template--atlantica .document-concept-title { display: flex; align-items: center; gap: 10px; }
.template--atlantica .document-concept-title i { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; color: var(--document-accent); background: color-mix(in srgb, var(--document-accent) 9%, white); border: 1px solid color-mix(in srgb, var(--document-accent) 25%, white); border-radius: 5px; font-size: 12px; }
.template--atlantica .document-concept-title + small { padding-left: 38px; }
.template--atlantica .document-summary > strong { background: var(--document-accent); }
.template--atlantica .document-foot { padding-top: 20px; }
.template--atlantica .document-company-close { margin-top: 10px; padding-top: 9px; }

.template--esencial { --document-accent: #2f6fb2; padding: 42px; }
.template--esencial .document-head { flex-direction: row-reverse; align-items: center; border: 0; }
.template--esencial .document-identity { padding: 11px 18px; color: #fff; background: #2f6fb2; border-radius: 7px; }
.template--esencial .document-identity small,
.template--esencial .document-identity strong { color: #fff; }
.template--esencial .document-identity strong { font-size: 21px; }
.template--esencial .document-logo-panel img { width: 90px; height: 78px; }
.template--esencial .document-context { padding: 22px; background: #eef4fb; border-radius: 8px; }
.template--esencial .document-notes { margin-top: 20px; }
.template--esencial .document-summary { width: 100%; }
.template--esencial .document-summary > div { width: 320px; margin-left: auto; }

.template-compare { padding: 28px; background: #fff; border: 1px solid #ccd7e1; border-radius: 12px; }
.template-compare-controls { display: grid; grid-template-columns: 1fr 48px 1fr; gap: 18px; align-items: end; margin-bottom: 28px; }
.template-compare-controls label { display: grid; gap: 7px; color: var(--gyg-blue); font-size: 13px; font-weight: 850; }
.template-compare-controls select { width: 100%; min-height: 48px; padding: 10px 12px; color: var(--gyg-blue); background: #fff; border: 1px solid #c9d4df; border-radius: 7px; font-size: 15px; }
.template-compare-controls button { width: 48px; height: 48px; color: #fff; background: var(--gyg-blue); border-radius: 7px; }
.template-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.template-compare-grid > div { min-width: 0; display: flex; justify-content: center; padding: 16px; background: #e9eef3; border: 1px solid #d4dde5; overflow: visible; }
.template-compare-grid .invoice-template { zoom: .69; }

.template-detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #d5dee7; border-radius: 11px; overflow: hidden; }
.template-detail-grid article { padding: 27px; border-right: 1px solid #d5dee7; }
.template-detail-grid article:last-child { border-right: 0; }
.template-detail-grid article > i { width: 46px; height: 46px; display: grid; place-items: center; color: var(--gyg-orange); background: #fff0eb; border-radius: 8px; }
.template-detail-grid h3 { margin: 18px 0 0; font-size: 18px; }
.template-detail-grid p { margin: 9px 0 0; font-size: 14px; line-height: 1.65; }

@media (max-width: 1100px) {
  .templates-hero-grid { gap: 38px; }
  .template-viewer { grid-template-columns: 160px minmax(0, 1fr); }
  .template-viewer-body { grid-template-columns: 205px minmax(0, 1fr); }
  .template-stage { padding: 24px; }
  .template-stage .invoice-template { zoom: .86; }
  .template-compare-grid .invoice-template { zoom: .57; }
  .template-detail-grid { grid-template-columns: 1fr 1fr; }
  .template-detail-grid article:nth-child(2) { border-right: 0; }
  .template-detail-grid article:nth-child(-n+2) { border-bottom: 1px solid #d5dee7; }
}

@media (max-width: 820px) {
  .templates-hero-grid { grid-template-columns: 1fr; }
  .templates-hero-examples { max-width: 620px; }
  .template-viewer { grid-template-columns: 1fr; }
  .template-tabs { grid-template-columns: repeat(2, 1fr); }
  .template-tabs button { border-right: 1px solid #496481; }
  .template-tabs button:nth-child(2n) { border-right: 0; }
  .template-viewer-body { grid-template-columns: 1fr; }
  .template-description { border-right: 0; border-bottom: 1px solid #ccd7e1; }
  .template-description article { position: static; }
  .template-stage .invoice-template { zoom: .79; }
  .template-compare-grid { grid-template-columns: 1fr; }
  .template-compare-grid .invoice-template { zoom: .78; }
}

@media (max-width: 560px) {
  .templates-hero-examples { grid-template-columns: 1fr; }
  .templates-hero-examples article:nth-child(2) { margin-top: 0; }
  .template-preview-strip .container { width: calc(100% - 24px); grid-template-columns: repeat(10, 102px); }
  .template-tabs { grid-template-columns: 1fr 1fr; }
  .template-tabs button { border-bottom: 1px solid #496481; }
  .template-tabs button:nth-child(2n) { border-right: 0; }
  .template-stage { display: block; padding: 12px; overflow: hidden; }
  .template-stage > div { width: 720px; }
  .template-stage .invoice-template { zoom: .445; }
  .template-compare { padding: 14px; }
  .template-compare-controls { grid-template-columns: 1fr; }
  .template-compare-controls button { justify-self: center; transform: rotate(90deg); }
  .template-compare-grid > div { display: block; padding: 8px; overflow: hidden; }
  .template-compare-grid .invoice-template { zoom: .405; }
  .template-detail-grid { grid-template-columns: 1fr; }
  .template-detail-grid article { border-right: 0; border-bottom: 1px solid #d5dee7; }
  .template-detail-grid article:last-child { border-bottom: 0; }
}
