/* Catalog layout is scoped to the storefront; quotation, administration and
   home components keep their own independent sizing and navigation. */
.catalog-workspace { padding: 34px 0 60px; background: #f6f8f7; }
.catalog-workspace > .section__inner { width: min(1280px, calc(100% - 48px)); }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.catalog-heading h1 { margin: 8px 0 10px; color: var(--ink); font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.16; letter-spacing: -.035em; }
.catalog-heading p { margin: 0; max-width: 58ch; font-size: .95rem; color: var(--muted); }
/* This longer specialty introduction can wrap while the local font loads. */
#productos .catalog-heading p { min-height: 3.3em; }
.catalog-breadcrumb { color: var(--green-2); font-size: .8rem; font-weight: 700; text-decoration: none; }
.catalog-breadcrumb:hover { text-decoration: underline; }
.catalog-lines { display: inline-flex; flex: 0 0 auto; padding: 4px; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.catalog-lines a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 18px; border-radius: 8px; font-size: .85rem; font-weight: 750; color: var(--muted); text-decoration: none; }
.catalog-lines [aria-current="page"] { background: var(--green-2); color: #fff; }
/* Reserve the first screen of results before network data arrives. Otherwise
   the quote form briefly occupies this space and jumps below the loaded grid. */
.catalog-workspace .catalog-browser { grid-template-columns: 222px minmax(0, 1fr); gap: 26px; align-content: start; min-height: max(540px, calc(100svh - 230px)); }
.catalog-workspace .documentary-catalog__grid:empty { min-height: 480px; }
.catalog-sidebar { position: sticky; top: 102px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.catalog-sidebar summary { display: flex; justify-content: space-between; gap: 12px; min-height: 44px; align-items: center; padding: 4px 10px 12px; color: var(--ink); font-size: .95rem; font-weight: 750; cursor: pointer; list-style: none; }
.catalog-sidebar summary::-webkit-details-marker { display: none; }
.catalog-sidebar[open] summary > span[aria-hidden="true"] { transform: rotate(180deg); }
.catalog-sidebar .segmented { max-height: min(66vh, 690px); padding: 4px; gap: 3px; }
.catalog-sidebar .segmented button { min-height: 44px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: #465b64; font-weight: 500; font-size: .85rem; line-height: 1.4; }
.catalog-sidebar .segmented button:hover { background: #f1f6f4; }
.catalog-sidebar .segmented .is-active { background: #eaf4ef; color: #145a50; box-shadow: inset 3px 0 #187668; font-weight: 750; }
.catalog-toolbar { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; }
.catalog-search { flex: 1 1 auto; min-width: 0; }
.catalog-search label { display: block; margin-bottom: 7px; font-size: .83rem; color: var(--ink); font-weight: 700; }
.catalog-search__field { position: relative; }
.catalog-search__field .icon { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: #52756e; pointer-events: none; }
.catalog-search__field .search { width: 100%; max-width: none; min-height: 48px; padding-left: 44px; padding-right: 14px; border-radius: 12px; background: #fff; font-size: .95rem; }
.catalog-reset { flex: 0 0 auto; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--green-2); font-size: .83rem; font-weight: 700; cursor: pointer; }
.catalog-view-switch { display: flex; gap: 24px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.catalog-view-switch button { min-height: 48px; padding: 8px 0 11px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #536774; font-size: .91rem; font-weight: 650; cursor: pointer; }
.catalog-view-switch [aria-pressed="true"] { border-bottom-color: var(--orange-2); color: var(--ink); }
.catalog-view-note { margin: 0 0 12px; font-size: .9rem; color: var(--muted); }
.catalog-workspace .result-count, .catalog-workspace .documentary-catalog__status { min-height: 1.65em; margin: 0 0 16px; font-size: .85rem; font-weight: 500; color: #4d656d; scroll-margin-top: 100px; }
.catalog-workspace .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.catalog-workspace .product-card { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: none; }
.catalog-workspace .product-card:hover, .catalog-workspace .product-card:focus-within { transform: none; border-color: #8db7a9; box-shadow: 0 8px 24px rgba(24, 57, 58, .06); }
.catalog-workspace .product-card__media { display: block; flex: 0 0 220px; height: 220px; min-height: 0; padding: 0; cursor: pointer; }
.catalog-workspace .product-card__media img { inset: 20px; width: calc(100% - 40px); height: calc(100% - 40px); object-fit: contain; object-position: center; mix-blend-mode: normal; }
.catalog-workspace .product-card__body { padding: 16px; }
.catalog-workspace .product-card__body h3 { margin: 0 0 12px; font-size: 1.05rem; font-weight: 650; line-height: 1.35; }
.catalog-workspace .product-card__category { margin: 0 0 6px; color: var(--green-2); font-size: .72rem; font-weight: 700; }
.catalog-workspace .product-card__action { display: flex; flex-direction: column; align-items: stretch; margin-top: auto; min-height: 0; padding: 0 16px 16px; gap: 10px; }
.catalog-workspace .product-card__action .link-action { min-height: 44px; }
.catalog-workspace .product-card__quick-add { width: 100%; min-height: 44px; padding: 10px 12px; font-size: .875rem; }
.catalog-workspace .documentary-product { border-radius: 16px; }
.catalog-workspace .documentary-product:focus-within { border-color: #8db7a9; box-shadow: 0 8px 24px rgba(24, 57, 58, .06); }
/* Frame the photograph, not the metadata. The white, fixed-height interior
   preserves every source ratio and separates the moss outline from the copy. */
.catalog-workspace :is(.product-card, .documentary-product) { border: 1px solid #dce6e1; background: #fff; box-shadow: 0 4px 16px rgba(18, 76, 71, .04); }
.catalog-workspace :is(.product-card, .documentary-product):is(:hover, :focus-within) { border-color: #a7bdb3; box-shadow: 0 6px 22px rgba(18, 76, 71, .1); }
.catalog-workspace :is(.product-card__media, .documentary-product__image) { width: calc(100% - 24px); margin: 12px 12px 0; border: 2px solid var(--brand-moss); border-radius: 16px; background: #fff; box-sizing: border-box; overflow: hidden; }
.catalog-workspace .documentary-product__image img { object-fit: contain; object-position: center; mix-blend-mode: normal; }
.catalog-workspace :is(.product-card__quick-add, .documentary-product__actions .btn--primary) { background: var(--brand-moss, #365749); border-color: var(--brand-moss, #365749); color: #fff; box-shadow: 0 4px 10px rgba(54, 87, 73, .08); }
.catalog-workspace :is(.product-card__quick-add, .documentary-product__actions .btn--primary):hover { background: #203f35; border-color: #203f35; }
.catalog-workspace [hidden] { display: none !important; }
.catalog-lines a:focus-visible, .catalog-breadcrumb:focus-visible, .documentary-product__image:focus-visible { outline: 3px solid var(--orange-2); outline-offset: 3px; }

/* Line selection follows the same image/title/action hierarchy as the catalog. */
.catalog-choice-section { display: block; min-height: 0; padding: 40px 0 60px; background: #f6f8f7; }
.catalog-choice-section > .section__inner { width: min(1280px, calc(100% - 48px)); }
.catalog-choice-section .section__head { text-align: left; align-items: start; }
.catalog-choice-section .order-progress { display: none; }
.catalog-choice { position: relative; padding: 24px; border: 1px solid #dce6e1; background: #fff; }
/* The wrapper exists before the API resolves the cover. The photograph keeps
   its full shape while title and action positions stay stable during loading. */
.catalog-choice__media { align-self: stretch; width: auto; height: 220px; flex: 0 0 220px; margin: -12px -12px 22px; border: 2px solid var(--brand-moss); border-radius: 16px; background: #fff; box-sizing: border-box; overflow: hidden; }
.catalog-choice__photo { width: 100%; max-width: none; height: 100%; margin: 0; padding: 20px; object-fit: contain; box-sizing: border-box; }
.catalog-choice h2 { margin-top: 8px; }
.catalog-choice__count { margin-bottom: 18px; font-size: .85rem; color: var(--muted); }

@media (max-width: 1100px) {
  .catalog-workspace .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-heading { align-items: start; flex-direction: column; gap: 18px; }
}
@media (max-width: 899px) {
  .catalog-workspace { padding-top: 24px; }
  .catalog-workspace .catalog-browser { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .catalog-sidebar { position: static; padding: 6px 10px; }
  .catalog-sidebar summary { padding: 8px 6px; }
  .catalog-sidebar .segmented { max-height: 330px; }
  .catalog-heading { margin-bottom: 22px; }
}
@media (max-width: 560px) {
  .catalog-workspace { padding-top: 18px; }
  .catalog-workspace > .section__inner { width: calc(100% - 32px); }
  .catalog-lines { width: 100%; }
  .catalog-lines a { flex: 1; padding-inline: 10px; }
  .catalog-heading { gap: 12px; margin-bottom: 16px; }
  .catalog-heading h1 { margin-block: 6px 8px; }
  .catalog-workspace .catalog-browser { gap: 14px; }
  .catalog-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 12px; }
  .catalog-search label { font-size: .78rem; }
  .catalog-reset { min-height: 44px; padding: 6px 10px; font-size: .8rem; }
  .catalog-reset__extra { display: none; }
  .catalog-view-switch { gap: 20px; }
  .catalog-view-switch button { font-size: .85rem; }
  .catalog-workspace .product-grid { grid-template-columns: minmax(0, 1fr); }
  .catalog-heading h1 { font-size: 1.75rem; }
  .catalog-heading p { font-size: .88rem; }
  .catalog-choice-section { padding-top: 24px; }
  .catalog-choice-section > .section__inner { width: calc(100% - 32px); }
}

/* Primary card targets open the piece; enlargement is a separate explicit link. */
.documentary-product__image { padding: 0; cursor: pointer; }
.documentary-product .documentary-product__zoom { position: static; display: flex; align-items: center; justify-content: flex-end; min-height: 44px; margin: 0 12px; padding: 4px 8px; border: 0; background: transparent; font-size: .78rem; text-underline-offset: 3px; }
.documentary-product__title { display: block; width: 100%; min-height: 44px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.documentary-product__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.documentary-product__title:focus-visible, .documentary-product__zoom:focus-visible { outline: 3px solid var(--orange-2); outline-offset: 3px; }
/* Quiet placeholders preserve a useful result frame while stale actions vanish. */
.documentary-skeleton { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.documentary-skeleton__image { height: 220px; border-radius: 12px; background: #eef2ef; }
.documentary-skeleton__line { height: 16px; width: 80%; margin-top: 20px; border-radius: 4px; background: #eef2ef; }
.documentary-skeleton__line:last-child { width: 60%; margin-bottom: 20px; }

/* Consistent quantity controls for cards and exact/documentary detail views. */
.quantity-stepper { display: grid; grid-template-columns: 44px minmax(48px, 1fr) 44px; width: min(100%, 220px); min-width: 0; align-items: stretch; gap: 0; border: 1px solid #acc2b8; border-radius: 10px; background: #fff; }
.quantity-stepper input[type="number"] { width: 100%; min-width: 0; min-height: 44px; padding: 7px 4px; border: 0; border-radius: 0; text-align: center; font-size: .95rem; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; background: transparent; }
.quantity-stepper input::-webkit-outer-spin-button, .quantity-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quantity-stepper__button { min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 9px; background: #f0f6f2; color: #174b3e; font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.quantity-stepper__button:disabled { color: #65766c; background: #f3f5f3; cursor: default; }
.quantity-stepper__button:hover:enabled { background: #dcebe2; }
.quantity-stepper__button:focus-visible, .quantity-stepper input:focus-visible { position: relative; outline: 3px solid var(--orange-2, #da8443); outline-offset: 2px; z-index: 1; }
.quantity-stepper:has([aria-invalid="true"]) { border-color: #ad4138; }
.quantity-stepper__error { margin: 6px 0 0; color: #9f332e; font-size: .8rem; line-height: 1.45; }
.quantity-stepper__error[hidden] { display: none; }

.piece-picker-steps { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 24px; padding: 0; list-style: none; color: #456353; font-size: .79rem; line-height: 1.45; }
.piece-picker-steps li { display: flex; gap: 6px; align-items: center; }
.piece-picker-steps li > span { display: inline-flex; width: 23px; height: 23px; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 50%; background: #e4f0e9; color: #214e3b; font-weight: 800; }
.variant-toolbar > label { display: block; margin-bottom: 7px; color: var(--ink); font-size: .85rem; font-weight: 700; }
.variant-toolbar__search { display: flex; gap: 8px; align-items: stretch; }
.variant-toolbar__search .search { min-width: 0; max-width: none; min-height: 46px; margin: 0; flex: 1; }
.variant-toolbar__search .btn { min-width: 72px; min-height: 44px; padding: 8px 12px; }
.variant-search-help { margin: 6px 0 12px; color: #53685d; font-size: .79rem; line-height: 1.45; }
.measure-shortcuts { margin: 8px 0 14px; color: #4c6356; font-size: .78rem; }
.measure-shortcuts__list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.measure-shortcuts__list button { min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid #bbd0c4; border-radius: 10px; background: #fff; color: #274f3d; font: inherit; font-weight: 700; overflow-wrap: anywhere; cursor: pointer; }
.measure-shortcuts__list button:hover, .measure-shortcuts__list button[aria-pressed="true"] { border-color: #386d53; background: #e9f4ed; }
.measure-shortcuts__list button:focus-visible { outline: 3px solid var(--orange-2); outline-offset: 2px; }
.product-dialog .detail-purchase { grid-template-columns: minmax(0, 1fr) 170px; }
.product-dialog #detailQuantityField { grid-column: 2; }
.product-dialog .piece-selection-summary { grid-column: 1 / -1; margin: 0; color: #315642; font-size: .8rem; line-height: 1.4; }
.product-dialog .variant-selection { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.product-dialog .variant-pagination .btn { min-height: 44px; }
.product-dialog [hidden] { display: none !important; }
@media (max-width: 900px) {
  .product-dialog .detail-purchase { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .product-dialog #detailQuantityField { grid-column: 1; }
  .product-dialog #detailQuantityField label { margin-bottom: 4px; font-size: .8rem; }
  .product-dialog #detailQuantityField .quantity-stepper { width: 170px; }
}
@media (max-width: 390px) {
  .piece-picker-steps { gap: 6px 10px; font-size: .75rem; }
  .variant-toolbar__search .btn { min-width: 60px; padding-inline: 7px; }
}
