/* Catálogo AGLO con insumos DYZ — rediseño con la marca 2026 (9-oct-2026, Claude). Piezas comunes en aglo-brand.css. */
*, *::before, *::after { box-sizing: border-box; }
body.cg { margin: 0; background: var(--ab-paper); min-height: 100vh; overflow-x: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

/* Cabecera */
.cg-head { position: relative; text-align: center; padding: 22px 16px 12px; }
.cg-home { position: absolute; left: 16px; top: 10px; font-family: var(--ab-display); font-weight: 800; font-stretch: 75%; color: var(--ab-mint); text-decoration: none; letter-spacing: .04em; font-size: .95rem; opacity: .8; }
.cg-title { font-size: clamp(2.6rem, 13vw, 8rem); line-height: .86; }
.cg-with { margin: .25rem 0 0; color: var(--ab-mint); font-size: clamp(1.05rem, 4.6vw, 1.6rem); }
.cg-intro { margin: 0; padding: .9rem 16px; text-align: center; font-size: clamp(1.05rem, 4.4vw, 1.45rem); line-height: 1.3; text-wrap: balance; color: var(--ab-night); }

/* Portada con la canasta */
.cg-pick { padding: 26px 0 40px; }
.cg-pick-grid { width: min(100% - 28px, 1000px); margin-inline: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.cg-cat { position: relative; display: grid; gap: .4rem; padding: 16px 14px 18px; text-align: center; text-decoration: none; border-radius: 22px; transition: transform .25s var(--ab-ease); }
.cg-cat:hover { transform: translateY(-3px); }
.cg-cat strong { font-size: clamp(1.2rem, 5.4vw, 1.75rem); color: var(--ab-night); }
.cg-cat span { font-size: .95rem; line-height: 1.35; color: var(--ab-orange); font-weight: 600; }
.cg-cat-0 { grid-column: 1 / -1; width: min(70%, 340px); justify-self: center; }
.cg-cat-2 { margin-top: 30px; }
.cg-cat-4 { margin-top: 30px; }
/* Flecha que apunta a la canasta */
.cg-arrow { position: absolute; width: 2px; height: 34px; background: var(--ab-night); left: 50%; bottom: -40px; transform-origin: top center; }
.cg-arrow::after { content: ""; position: absolute; left: -5px; bottom: -2px; border: 6px solid transparent; border-top: 9px solid var(--ab-night); border-bottom: 0; }
.cg-cat-0 .cg-arrow { transform: none; }
.cg-cat-1 .cg-arrow { left: 70%; transform: rotate(-32deg); }
.cg-cat-2 .cg-arrow { left: 30%; transform: rotate(32deg); }
.cg-cat-3 .cg-arrow, .cg-cat-4 .cg-arrow { bottom: auto; top: -40px; transform-origin: bottom center; }
.cg-cat-3 .cg-arrow { left: 70%; transform: rotate(32deg); }
.cg-cat-4 .cg-arrow { left: 30%; transform: rotate(-32deg); }
.cg-cat-3 .cg-arrow::after, .cg-cat-4 .cg-arrow::after { top: -2px; bottom: auto; border-top: 0; border-bottom: 9px solid var(--ab-night); }
.cg-basket-fig { grid-column: 1 / -1; position: relative; margin: 6px auto 4px; width: min(76%, 380px); }
.cg-basket-fig img { display: block; width: 100%; height: auto; filter: drop-shadow(0 20px 22px rgba(0, 0, 0, .22)); }
.cg-basket-fig figcaption { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); white-space: nowrap; background: var(--ab-orange); color: var(--ab-night); padding: .35rem 1.2rem; border-radius: 14px; font-size: clamp(1.3rem, 6vw, 2rem); box-shadow: 0 12px 24px -10px rgba(242, 63, 13, .8); }

/* Pestañas y banda de la categoría */
.cg-tabs { display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: stretch; }
.cg-tabs button { border: 0; background: transparent; padding: .9rem .4rem; cursor: pointer; font-family: var(--ab-display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: clamp(1rem, 4.4vw, 1.6rem); line-height: .95; color: var(--ab-night); }
.cg-tabs button.is-on { background: var(--ab-forest); color: var(--ab-mint); border-radius: 22px 22px 0 0; margin-top: -10px; padding-top: 1.2rem; }
.cg-band { position: relative; display: flex; align-items: center; justify-content: center; padding: .7rem 52px; }
.cg-band h2 { margin: 0; font-family: var(--ab-text); font-weight: 500; font-size: clamp(1.3rem, 5.6vw, 2.1rem); color: #fff4ec; text-align: center; line-height: 1.15; }
.cg-back { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); color: #fff; text-decoration: none; font-size: 1.2rem; }
.cg-bar { width: min(100% - 28px, 1120px); margin: 16px auto 8px; display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; }
.cg-search { flex: 1 1 280px; }
.cg-search input { width: 100%; min-height: 48px; padding: .5rem 1.1rem; border-radius: 999px; border: 1px solid rgba(23, 27, 47, .16); background: #fff; font: inherit; color: var(--ab-night); }
.cg-search input:focus { outline: 3px solid rgba(242, 63, 13, .35); outline-offset: 1px; }
.cg-bar p { margin: 0; color: var(--ab-muted); font-size: .9rem; }

/* Tarjetas de producto */
.cg-grid { width: min(100% - 28px, 1120px); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cg-card { position: relative; display: grid; align-content: start; gap: .2rem; padding: 0 0 .8rem; border: 0; background: transparent; text-align: left; cursor: pointer; }
.cg-card-img { display: block; aspect-ratio: 1 / 1.3; background: #f1efea; overflow: hidden; margin-bottom: .45rem; }
.cg-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 8%; mix-blend-mode: multiply; transition: transform .6s var(--ab-ease); }
.cg-card:hover .cg-card-img img { transform: scale(1.05); }
.cg-card-img.is-empty { background: linear-gradient(160deg, #ede7dc, #f6f2ec); }
.cg-card-name { font-family: var(--ab-display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: clamp(1rem, 4.2vw, 1.35rem); line-height: .98; color: var(--ab-forest); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cg-card-var { font-size: .8rem; color: var(--ab-muted); }
.cg-card-price { font-size: clamp(.92rem, 3.8vw, 1.08rem); color: var(--ab-night); }
.cg-tag { position: absolute; left: 6px; top: 6px; background: var(--ab-orange); color: #fff; font-size: .68rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.cg-heart { position: absolute; right: 8px; top: 6px; color: var(--ab-orange); font-size: 1.2rem; }
.cg-card:focus-visible { outline: 3px solid var(--ab-orange); outline-offset: 2px; }
.cg-more { text-align: center; margin: 20px 0 10px; }
.cg-more .ab-btn { color: var(--ab-forest); }
.cg-empty { grid-column: 1 / -1; text-align: center; color: var(--ab-muted); padding: 30px 10px; }
.cg-legal { width: min(100% - 28px, 1120px); margin: 24px auto 120px; font-size: .8rem; color: var(--ab-muted); line-height: 1.5; }

/* Ficha y canasto (hojas) */
.cg-sheet { width: min(100%, 560px); max-height: 92vh; margin: auto auto 0; padding: 0; border: 0; border-radius: 26px 26px 0 0; background: var(--ab-paper); color: var(--ab-night); box-shadow: 0 -20px 60px rgba(0, 0, 0, .25); }
.cg-sheet::backdrop { background: rgba(7, 49, 25, .55); backdrop-filter: blur(3px); }
.cg-sheet[open] { animation: cg-up .35s var(--ab-ease); }
@keyframes cg-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.cg-sheet-in { position: relative; padding: 28px 20px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: .9rem; }
.cg-x { position: absolute; right: 12px; top: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(23, 27, 47, .07); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.cg-item-name { margin: 0 34px 0 0; font-family: var(--ab-text); font-weight: 400; font-size: clamp(1.7rem, 7vw, 2.6rem); line-height: 1.05; }
.cg-item-name b { font-family: var(--ab-display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; color: var(--ab-forest); }
.cg-item-img { margin: 0; display: grid; place-items: center; background: #fff; border-radius: 18px; min-height: 120px; }
.cg-item-img img { max-width: 100%; max-height: 42vh; object-fit: contain; padding: 4%; }
.cg-item-price { margin: 0; text-align: center; font-size: 2rem; font-weight: 500; }
.cg-item-desc { margin: 0; text-align: center; line-height: 1.5; color: #3d3f4f; max-height: 9.5em; overflow: auto; }
.cg-variants { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.cg-variants button { min-height: 44px; padding: .4rem .9rem; border: 1.5px solid var(--ab-night); border-radius: 6px; background: #fff; cursor: pointer; font-size: .9rem; }
.cg-variants button[aria-pressed="true"] { background: var(--ab-forest); border-color: var(--ab-forest); color: var(--ab-mint); }
.cg-buy { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: center; }
.cg-add { min-height: 64px; font-size: clamp(1.3rem, 5.6vw, 1.8rem); border-radius: 18px; }
.cg-qty { display: grid; grid-template-columns: 44px 48px 44px; border: 1.5px solid var(--ab-night); border-radius: 6px; overflow: hidden; background: #fff; }
.cg-qty button { border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; min-height: 56px; }
.cg-qty output { display: grid; place-items: center; font-size: 1.5rem; border-inline: 1.5px solid var(--ab-night); }
.cg-qty-sm { grid-template-columns: 36px 38px 36px; } .cg-qty-sm button { min-height: 40px; font-size: 1.15rem; } .cg-qty-sm output { font-size: 1.1rem; }
.cg-fav { border: 0; background: none; color: var(--ab-orange); font-weight: 600; cursor: pointer; padding: .3rem; }
.cg-keep { border: 0; border-top: 2px solid var(--ab-night); border-bottom: 2px solid var(--ab-night); background: transparent; padding: .7rem; cursor: pointer; font-family: var(--ab-display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: 1.6rem; color: var(--ab-forest); }
.cg-clear { border: 0; background: none; color: var(--ab-muted); text-decoration: underline; cursor: pointer; font-size: .88rem; }
.cg-basket-title { font-size: 2.6rem; color: var(--ab-forest); }
.cg-lines { display: grid; gap: .6rem; max-height: 46vh; overflow: auto; }
.cg-line { display: grid; grid-template-columns: 56px 1fr auto; gap: .7rem; align-items: center; padding: .5rem; background: #fff; border-radius: 14px; }
.cg-line img, .cg-line-img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: #f1efea; mix-blend-mode: multiply; }
.cg-line b { display: block; font-weight: 600; font-size: .92rem; line-height: 1.2; }
.cg-line small { color: var(--ab-muted); }
.cg-total { display: flex; justify-content: space-between; align-items: baseline; margin: 0; padding-top: .5rem; border-top: 1px solid rgba(23, 27, 47, .12); }
.cg-total strong { font-size: 1.5rem; }
.cg-fine { margin: 0; font-size: .82rem; color: var(--ab-muted); line-height: 1.45; }
.cg-send { width: 100%; }

/* Botón flotante del canasto y asesor */
.cg-basket-btn { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: .7rem; width: min(100% - 28px, 520px); padding: .75rem 1.1rem; border: 0; border-radius: 999px; background: var(--ab-forest); color: var(--ab-mint); box-shadow: 0 18px 34px -12px rgba(7, 49, 25, .8); cursor: pointer; text-align: left; }
.cg-basket-btn span:nth-child(2) { flex: 1; }
.cg-basket-btn strong { font-family: var(--ab-display); font-weight: 800; font-stretch: 80%; font-size: 1.3rem; }
.cg-basket-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--ab-orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9h14l-1.5 10h-11z'/%3E%3Cpath d='M9 9l3-5 3 5'/%3E%3C/svg%3E") center / 60% no-repeat; }
.cg-basket-btn.is-bump { animation: cg-bump .5s var(--ab-ease); }
@keyframes cg-bump { 30% { transform: translateX(-50%) scale(1.06); } }
.cg-talk { position: fixed; right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 25; padding: .55rem 1rem; border-radius: 999px; background: #fff; color: var(--ab-forest); font-weight: 600; font-size: .88rem; text-decoration: none; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .35); }

@media (min-width: 760px) {
  .cg-pick-grid { grid-template-columns: 1fr 1.2fr 1fr; grid-template-rows: auto auto auto; gap: 18px 26px; align-items: center; }
  .cg-cat-0 { grid-column: 2; grid-row: 1; width: 100%; }
  .cg-cat-1 { grid-column: 1; grid-row: 1 / span 2; } .cg-cat-2 { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
  .cg-basket-fig { grid-column: 2; grid-row: 2 / span 2; width: 100%; }
  .cg-cat-3 { grid-column: 1; grid-row: 3; } .cg-cat-4 { grid-column: 3; grid-row: 3; margin-top: 0; }
  .cg-arrow { display: none; }
  .cg-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .cg-sheet { margin: auto; border-radius: 26px; }
  .cg-tabs button.is-on { border-radius: 22px; margin: 8px 0; padding-top: .9rem; }
}
@media (min-width: 1100px) { .cg-grid { grid-template-columns: repeat(5, 1fr); } }
@media (prefers-reduced-motion: reduce) { .cg-sheet[open], .cg-basket-btn.is-bump { animation: none; } .cg-card-img img { transition: none; } }
