@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #edf2ec;
  --surface: #ffffff;
  --surface-soft: #f4f8f3;
  --ink: #182129;
  --muted: #5f6a73;
  --green: #06b000;
  --green-deep: #067a00;
  --line: rgba(6, 176, 0, 0.18);
  --line-soft: rgba(6, 176, 0, 0.1);
  --shadow: 0 16px 34px rgba(14, 33, 18, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent !important;
}

*:focus:not(:focus-visible) {
  outline: none !important;
}

*:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body,
button,
input,
select,
textarea {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(6, 176, 0, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(16, 63, 186, 0.12), transparent 24%),
    linear-gradient(180deg, #f7f9f5 0%, var(--bg) 100%);
}

.page {
  width: min(1400px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 8px 12px 8px 18px;
  border: 1px solid rgba(6, 176, 0, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(4, 10, 7, 0.84), rgba(11, 20, 15, 0.74)),
    linear-gradient(100deg, rgba(6, 176, 0, 0.24) 0%, rgba(0, 0, 0, 0) 50%, rgba(6, 176, 0, 0.12) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 14px 30px rgba(2, 8, 5, 0.36);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand img {
  width: auto;
  height: 34px;
  max-width: 102px;
  object-fit: contain;
}

.nav-panel {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.nav-links a.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--green, #06b000), var(--green-deep, #058f00));
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(6, 176, 0, 0.32);
  font-weight: 700;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(6, 176, 0, 0.28);
  border-radius: 999px;
  background: rgba(6, 176, 0, 0.1);
  color: #fff;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(165, 247, 161, 0.2);
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ========================================================
   BARRA DE CATEGORÍAS DE FILAMENTOS
   ======================================================== */
.catalog-header {
  margin: 6px 0 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Pestañas de categorías estilo tienda moderna (horizontal scroll en móvil) */
.catalog-category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 6px;
  scrollbar-width: none;
  width: 100%;
}

.catalog-category-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #a3b899;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cat-tab:hover {
  background: rgba(6, 176, 0, 0.12);
  border-color: rgba(6, 176, 0, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}

.cat-tab.active {
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(6, 176, 0, 0.35);
  font-weight: 700;
}

.cat-tab .tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.cat-tab.active .tab-num {
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 245, 0.98)),
    var(--surface);
  box-shadow: 0 14px 30px rgba(18, 33, 18, 0.09);
  transition: transform 180ms ease, box-shadow 180ms ease;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 38px rgba(18, 33, 18, 0.16);
}

.image-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  aspect-ratio: 1 / 1;
  padding: 10px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 32%, rgba(6, 176, 0, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff, #eef3ee 100%);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.16s ease;
}

.image-wrap:hover {
  border-color: rgba(6, 176, 0, 0.32);
  box-shadow: inset 0 0 0 1px rgba(6, 176, 0, 0.16);
}

.image-wrap:active {
  transform: scale(0.97);
}

.card-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  z-index: 2;
}

.card-badges .badge:only-child {
  margin-left: auto;
}

.badge {
  align-self: flex-end;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(6, 176, 0, 0.18);
  box-shadow: 0 4px 10px rgba(6, 176, 0, 0.12);
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.card-badges .badge {
  align-self: auto;
}

.badge-new {
  background: linear-gradient(135deg, #e63946 0%, #ff4d6d 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.35);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.image-wrap img {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: scale(1.16);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .image-wrap img {
  transform: scale(1.25);
}

.zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(6, 176, 0, 0.18);
  color: var(--green-deep);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0.65;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  pointer-events: none;
}

.product-card:hover .zoom-hint {
  opacity: 1;
  transform: scale(1.12);
  background: #ffffff;
}

/* ========================================================
   FICHA DE PRODUCTO BOTTOM SHEET (80% VH CON BORDES SUPERIORES REDONDEADOS)
   Transición suave desde abajo hacia arriba (Slide-up)
   ======================================================== */
.krea-app-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 1;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.45s ease;
  box-sizing: border-box;
}

.krea-app-modal.open {
  visibility: visible;
  pointer-events: auto;
}

.krea-app-modal.closing {
  visibility: visible;
  pointer-events: none;
}

.krea-app-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.krea-app-modal.open .krea-app-backdrop {
  opacity: 1;
}

.krea-app-modal.closing .krea-app-backdrop {
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Ocupa el 80% del vh con bordes superiores redondeados y transición suave */
.krea-app-sheet {
  position: relative;
  z-index: 2;
  width: 100vw;
  max-width: 480px;
  height: 90vh;
  height: 90dvh;
  max-height: 90dvh;
  background: #ffffff;
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translate3d(0, 100%, 0);
  transition: transform 0.48s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.krea-app-modal.open .krea-app-sheet {
  transform: translate3d(0, 0, 0);
}

.krea-app-modal.closing .krea-app-sheet {
  transform: translate3d(0, 100%, 0);
  transition: transform 0.42s cubic-bezier(0.32, 0, 0.67, 0);
}

.krea-app-drag-bar {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  cursor: grab;
  touch-action: none;
}

.krea-app-drag-pill {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.24);
  transition: background 0.2s ease, transform 0.2s ease;
}

.krea-app-drag-bar:active .krea-app-drag-pill {
  transform: scaleX(1.15);
  background: rgba(15, 23, 42, 0.45);
}

.krea-app-scroll-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.krea-app-scroll-content::-webkit-scrollbar {
  display: none;
}

/* Escenario Hero: Proporcionado, protagónico y absorbe el alto para que la imagen destaque en el 80% vh */
.krea-app-hero-stage {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 220px;
  background: #f2f3f5;
  border-radius: 0 0 32px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

/* Botón de retroceso: pastilla blanca limpia en la esquina superior */
.krea-app-back-btn {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  outline: none;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.krea-app-back-btn:focus,
.krea-app-back-btn:focus-visible {
  outline: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12) !important;
}

.krea-app-back-btn:hover {
  background: #f8fafc;
  transform: scale(1.05);
}

.krea-app-img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  box-sizing: border-box;
}

/* Imagen del filamento: grande, nítida y protagónica */
.krea-app-img-wrap img {
  max-width: 86%;
  max-height: 86%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: scale(1.22);
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.08));
  transition: transform 0.3s ease;
}

/* Cuerpo del producto: espacioso, elegante y con tipografía estilizada (como Imagen 1) */
.krea-app-body {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 22px 24px max(24px, env(safe-area-inset-bottom));
  background: #ffffff;
  box-sizing: border-box;
}

.krea-app-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.krea-app-category-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
}

.krea-app-badges-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.krea-app-badges-target .badge {
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 999px;
  box-shadow: none;
  align-self: auto;
}

.krea-app-badges-target .badge-new {
  background: linear-gradient(135deg, #e63946 0%, #ff4d6d 100%);
  color: #ffffff;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(230, 57, 70, 0.25);
}

.krea-app-title-row {
  margin-bottom: 6px;
}

.krea-app-title {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 600;
  color: var(--green-deep);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.krea-app-subtitle {
  margin: 0 0 16px;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
  font-weight: 400;
}

/* Tarjeta de ubicación de entrega: amplia, limpia y refinada */
.krea-app-delivery-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-bottom: 16px;
}

.krea-app-delivery-tile:hover {
  background: #f1f5f9;
}

.krea-app-tile-pin-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eef2f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #06b000;
  flex: 0 0 auto;
}

.krea-app-tile-texts {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.krea-app-tile-texts strong {
  font-size: 0.84rem;
  color: #0f172a;
  font-weight: 600;
}

.krea-app-tile-texts span {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 400;
}

.krea-app-tile-arrow {
  color: #64748b;
  display: flex;
  align-items: center;
}

.krea-app-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 16px 0;
  border: 0;
}

/* Sección de Precio: nítida, moderna y con peso tipográfico limpio */
.krea-app-price-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 16px;
}

.krea-app-unit-price {
  font-size: 1.62rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.025em;
}

.krea-app-price-subtext {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 400;
}

/* Botón Agregar al carrito: estilizado, generoso (52px) y con esquinas redondeadas elegantes */
.krea-app-primary-btn {
  margin-top: 4px;
  width: 100%;
  height: 52px;
  min-height: 52px;
  border-radius: 16px;
  border: 0;
  outline: none;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: #ffffff;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(6, 176, 0, 0.22);
  cursor: pointer;
  transition: filter 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.krea-app-primary-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(6, 176, 0, 0.3);
}

.krea-app-primary-btn:active {
  transform: translateY(1px);
}

.krea-app-primary-btn.is-added {
  background: #111827;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.3);
}

.krea-app-primary-btn .krea-add-icon {
  width: 20px;
  height: 20px;
  opacity: 1;
  flex: 0 0 auto;
}

.krea-app-primary-btn .krea-add-label {
  display: inline-block;
  white-space: nowrap;
  font-weight: 800;
}

@media (min-width: 640px) {
  .krea-app-modal {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .krea-app-sheet {
    width: min(92vw, 460px);
    height: 90vh;
    height: 90dvh;
    max-height: 90dvh;
    border-radius: 36px 36px 0 0;
    box-shadow: 0 -16px 54px rgba(0, 0, 0, 0.35);
  }
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 12px 4px 2px;
}

.product-body h2 {
  margin: 0;
  color: var(--green-deep);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  min-height: 2.5em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.price {
  margin: auto 0 0;
  font-size: 1.38rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}

.footer-note {
  margin: 24px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.krea-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  width: 100%;
  padding: 0 8px;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(6, 176, 0, 0.2);
  cursor: pointer;
  transition: filter 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  overflow: hidden;
}

.krea-add-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 11px 20px rgba(6, 176, 0, 0.26);
}

.krea-add-icon {
  width: 17px;
  height: 17px;
  opacity: 1;
  flex: 0 0 auto;
}

.krea-add-label {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.krea-add-label {
  display: inline-block;
  white-space: nowrap;
  font-weight: 700;
}

.krea-add-btn.is-added {
  animation: kreaAddToCartPulse 420ms ease;
}

.krea-cart {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 45;
}

.krea-cart-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #0f1720;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.krea-cart-fab.is-bump {
  animation: kreaCartFabBump 460ms ease;
}

.krea-icon svg,
.krea-icon-sm svg,
.krea-icon-xs svg,
.krea-cart-fab-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.krea-icon-sm {
  width: 16px;
  height: 16px;
  display: inline-flex;
  flex: 0 0 auto;
}

.krea-icon-xs {
  width: 14px;
  height: 14px;
  display: inline-flex;
  flex: 0 0 auto;
}

.krea-cart-fab-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 auto;
}

.krea-cart-fab-count {
  min-width: 24px;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #10b981;
  color: #fff;
  font-size: 0.8rem;
}

.krea-cart-fab-count.is-bump {
  animation: kreaCartCountPop 460ms ease;
}

@keyframes kreaAddToCartPulse {
  0% {
    transform: translateY(0) scale(1);
  }

  40% {
    transform: translateY(-1px) scale(1.03);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes kreaCartFabBump {
  0% {
    transform: translateY(0) scale(1);
  }

  35% {
    transform: translateY(-2px) scale(1.05);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes kreaCartCountPop {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

/* ========================================================
   CARRITO DE COMPRAS / ORDER DETAILS (DISEÑO APP MÓVIL)
   ======================================================== */
.krea-cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 990;
  background: rgba(8, 14, 10, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.krea-cart-panel.open~.krea-cart-backdrop {
  opacity: 1;
  visibility: visible;
}

.krea-cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  width: min(440px, 100vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 32px 0 0 32px;
  border: 0;
  background: #ffffff;
  color: #111827;
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateX(100%);
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.krea-cart-panel.open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.krea-cart-drag-handle {
  position: absolute;
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
  width: 14px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.krea-cart-drag-pill {
  width: 4px;
  height: 38px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.22);
  transition: transform 0.2s ease, background 0.2s ease;
}

.krea-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #f3f4f6;
  background: #ffffff;
}

.krea-cart-back,
.krea-cart-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  border: 1px solid #eef0f2;
  background: #f8fafc;
  color: #1f2937;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
  transition: background 0.15s ease, transform 0.15s ease;
}

.krea-cart-back:hover,
.krea-cart-close:hover {
  background: #edf2f7;
  transform: scale(1.05);
}

.krea-cart-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}

.krea-cart-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  -webkit-overflow-scrolling: touch;
}

.krea-cart-section {
  display: flex;
  flex-direction: column;
}

.krea-cart-section-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.01em;
}

.krea-cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.krea-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: #f9fafb;
  border: 1px solid #f0f2f5;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.krea-cart-thumb {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #eef0f2;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.krea-cart-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: scale(1.12);
}

.krea-thumb-fallback {
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
}

.krea-cart-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.krea-cart-info h4 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.krea-cart-unit-price {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
  font-weight: 600;
}

.krea-cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
}

.krea-cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  margin-bottom: 14px;
  background: #ffffff;
  border-bottom: 1px solid #f8fafc;
}

.krea-cart-thumb {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  background: #f2f3f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.krea-cart-thumb img {
  max-width: 86%;
  max-height: 86%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: scale(1.1);
}

.krea-cart-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.krea-cart-info h4 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.krea-cart-unit-price {
  margin: 0;
  font-size: 0.84rem;
  color: #94a3b8;
  font-weight: 500;
}

.krea-cart-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.krea-qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.krea-qty button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.krea-qty button:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.krea-qty span {
  font-size: 0.92rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  color: #0f172a;
}

.krea-remove {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
  background: #f8fafc;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.krea-remove:hover {
  color: #e63946;
  background: #fee2e2;
  border-color: #fecaca;
}

/* Fichas selectoras de entrega y pago en el carrito */
.krea-cart-selector-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.krea-select-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.16s ease;
  position: relative;
}

.krea-select-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.krea-select-card.is-selected {
  background: rgba(6, 176, 0, 0.05);
  border-color: #06b000;
  box-shadow: 0 4px 14px rgba(6, 176, 0, 0.12);
}

.krea-select-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.krea-select-card.is-selected .krea-select-radio {
  border-color: #06b000;
  background: #06b000;
}

.krea-select-card.is-selected .krea-select-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.krea-select-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eef2f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.krea-select-card.is-selected .krea-select-icon {
  background: rgba(6, 176, 0, 0.14);
  color: #06b000;
}

.krea-select-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.krea-select-body strong {
  font-size: 0.86rem;
  color: #0f172a;
  font-weight: 700;
}

.krea-select-body span {
  font-size: 0.76rem;
  color: #64748b;
}

/* Compatibilidad con ficha previa */
.krea-app-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease;
}

/* Order Info / Resumen */
.krea-cart-order-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0;
}

.krea-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  color: #94a3b8;
  font-weight: 500;
}

.krea-summary-line span:last-child {
  color: #0f172a;
  font-weight: 600;
}

.krea-summary-line.total {
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f172a;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  margin-top: 4px;
}

.krea-summary-line.total strong {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.krea-delivery-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: #067a00;
}

.krea-cart-footer {
  padding: 14px 22px max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

.krea-cart-send {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: #ffffff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(6, 176, 0, 0.35);
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.krea-cart-send:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(6, 176, 0, 0.45);
}

.krea-cart-send:active {
  transform: translateY(0);
}

.krea-cart-send svg {
  flex-shrink: 0;
}

.krea-cart-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px;
  text-align: center;
  gap: 8px;
}

.krea-empty-icon {
  font-size: 2.2rem;
}

.krea-cart-empty-box p {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}

.krea-cart-empty-box span {
  font-size: 0.84rem;
  color: #6b7280;
}

.krea-cart-notice {
  margin: 0 18px 8px;
  max-height: 0;
  overflow: hidden;
  padding: 0 12px;
  border-radius: 12px;
  background: transparent;
  color: #067a00;
  font-size: 0.84rem;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease, max-height 180ms ease, padding 180ms ease;
}

.krea-cart-notice.show {
  max-height: 120px;
  padding: 10px 12px;
  background: rgba(6, 176, 0, 0.12);
  border: 1px solid rgba(6, 176, 0, 0.22);
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1140px) and (min-width: 861px) {
  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 860px) {
  .topbar {
    position: sticky !important;
    top: max(8px, env(safe-area-inset-top, 8px)) !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    margin: 0 0 16px 0 !important;
    border-radius: 999px !important;
    padding: 0 10px 0 16px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #16231c !important;
    -webkit-backdrop-filter: blur(14px) !important;
    backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    z-index: 900 !important;
    overflow: visible !important;
  }

  .brand {
    flex: 0 0 auto;
    max-width: 90px;
    display: flex;
    align-items: center;
    opacity: 1;
    transform: none;
    z-index: 2;
  }

  .brand img {
    height: 28px;
    width: auto;
    max-width: 88px;
    object-fit: contain;
  }

  .menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    margin-left: 0 !important;
    flex: 0 0 auto !important;
    z-index: 10 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    cursor: pointer !important;
  }

  .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
  }

  /* Menú desplegable móvil que abre limpiamente debajo de la topbar */
  .nav-panel {
    position: fixed !important;
    top: 68px !important;
    left: 14px !important;
    right: 14px !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 20px !important;
    background: #16231c !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55) !important;
    display: none !important;
    flex-direction: column !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
  }

  .nav-panel.open,
  .topbar.open .nav-panel {
    display: flex !important;
  }

  .nav-links {
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    white-space: normal !important;
    padding: 0 !important;
  }

  .nav-links a {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 16px !important;
    border-radius: 12px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid transparent !important;
  }

  .nav-links a.active {
    background: var(--store-pill-active, #009e2e) !important;
    color: #ffffff !important;
  }

  .page {
    width: min(100% - 20px, 900px) !important;
    padding-bottom: 40px !important;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .krea-cart {
    position: relative !important;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 16px, 900px) !important;
    padding-bottom: 30px !important;
  }

  .krea-cart {
    right: 12px;
    bottom: 78px !important;
  }

  .krea-cart-fab-label {
    display: none;
  }

  .brand img {
    height: 28px;
    max-width: 84px;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .catalog-header {
    margin: 8px 0 16px;
    gap: 10px;
  }

  .catalog-page-title {
    font-size: 1.4rem;
  }

  .catalog-page-desc {
    font-size: 0.8rem;
  }

  .cat-tab {
    padding: 7px 14px;
    font-size: 0.8rem;
  }

  .product-card {
    padding: 10px 9px;
    border-radius: 18px;
  }

  .image-wrap {
    border-radius: 14px;
    padding: 6px;
    gap: 4px;
  }

  .badge {
    padding: 4px 7px;
    font-size: 0.68rem;
  }

  .product-body {
    gap: 6px;
    padding: 8px 1px 1px;
  }

  .product-body h2 {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    min-height: 2.5em;
    color: var(--green-deep);
  }

  .price {
    font-size: 1.22rem;
    font-weight: 700;
  }

  .krea-add-btn {
    min-height: 38px;
    padding: 0 6px;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 10px;
  }

  .krea-add-icon {
    width: 15px;
    height: 15px;
  }

  .krea-cart-panel {
    border-radius: 24px 0 0 24px;
  }
}