:root {
  --brand-primary: #2563EB;
  --brand-hero: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
}

.portal-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--zel-text);
  background: var(--zel-bg);
}

/* Top nav (product, checkout, dashboard) */
.portal-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 4%;
  background: var(--zel-card);
  border-bottom: 1px solid var(--zel-border);
}
.dark .portal-nav {
  background: var(--zel-card-dark);
  border-color: var(--zel-border-dark);
}
.portal-nav a { color: inherit; text-decoration: none; }
.portal-nav .brand { padding: 0; }
.portal-nav-links { display: flex; gap: 1rem; font-size: .9rem; align-items: center; }
.portal-nav-links a:hover { color: var(--brand-primary); }

/* Storefront (catalog) */
.negocio-landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--zel-bg);
}
.negocio-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--zel-border);
  padding: .75rem 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dark .negocio-header { background: rgba(30,41,59,.92); }
.negocio-brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: inherit; }
.negocio-logo {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand-primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.25rem;
}
.negocio-name { font-family: var(--font-brand); font-weight: 700; font-size: 1.1rem; }
.negocio-tag { font-size: .75rem; color: var(--zel-muted); }
.negocio-nav { display: flex; gap: 1.25rem; font-size: .9rem; align-items: center; }
@media (max-width: 640px) {
  .negocio-header { padding: .6rem 4%; }
  .negocio-nav { gap: .75rem; font-size: .82rem; }
  .negocio-nav .nav-optional { display: none; }
  .negocio-tag { display: none; }
  .negocio-hero { padding: 2.5rem 4%; }
  .negocio-hero h1 { font-size: 1.9rem; }
}
.negocio-nav a { color: inherit; text-decoration: none; font-weight: 500; }
.negocio-nav a:hover { color: var(--brand-primary); }
.negocio-hero {
  background: var(--brand-hero); color: #fff;
  padding: 4rem 4%;
  text-align: center;
  border-radius: 0 0 2rem 2rem;
}
.negocio-hero h1 { font-family: var(--font-brand); font-size: 2.5rem; margin: 0 0 .5rem; }
.negocio-hero p { font-size: 1.1rem; opacity: .9; max-width: 600px; margin: 0 auto 1.5rem; }
.negocio-hero .cta { display: inline-flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.negocio-hero .btn { background: #fff; color: var(--brand-primary); }
.negocio-hero .btn.outline { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); }
.negocio-hero .btn.outline:hover { border-color: #fff; color: #fff; }
.negocio-meta {
  display: flex; gap: 1.5rem; justify-content: center; margin-top: 1.5rem;
  font-size: .9rem; opacity: .85; flex-wrap: wrap;
}
.negocio-section { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1rem; }
.negocio-section h2 { font-family: var(--font-brand); font-size: 1.4rem; margin-bottom: 1rem; color: var(--zel-text); }
.negocio-chips { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.negocio-chip {
  padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid var(--zel-border);
  background: var(--zel-card);
  cursor: pointer; font-size: .85rem; color: inherit; font-family: inherit;
  transition: border-color .15s ease, color .15s ease;
}
.negocio-chip:hover, .negocio-chip.active {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.negocio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; transition: opacity .16s ease, transform .16s ease; }
.negocio-grid.cat-switching { opacity: .2; transform: scale(.985); pointer-events: none; }
.negocio-product {
  position: relative;
  background: var(--zel-card); border: 1px solid var(--zel-border);
  border-radius: 1rem; padding: 1rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.promo-badge {
  position: absolute; top: .75rem; left: .75rem; z-index: 2;
  background: linear-gradient(135deg, #ef4444, #f97316); color: #fff;
  font-size: .75rem; font-weight: 800; padding: .2rem .55rem;
  border-radius: .5rem; box-shadow: 0 2px 6px rgba(239,68,68,.35);
}
.price-old { text-decoration: line-through; color: var(--zel-muted); font-weight: 500; font-size: .85em; }
.promo-hint { font-size: .75rem; color: #ea580c; margin: .15rem 0 .5rem; }
.promo-hint i { margin-right: .25rem; }
.negocio-product:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-primary);
}
.negocio-product img { width: 100%; height: 140px; object-fit: cover; border-radius: .75rem; background: var(--zel-bg); }
.negocio-product h3 { font-size: 1rem; margin: .75rem 0 .25rem; }
.negocio-product .price { font-size: 1.25rem; font-weight: 800; color: var(--brand-primary); }
.negocio-product .stock { font-size: .8rem; color: var(--zel-green); margin: .25rem 0 .75rem; }
.negocio-product .actions { display: flex; gap: .5rem; }
.negocio-product .actions a { flex: 1; text-align: center; padding: .5rem; font-size: .85rem; }

/* Filtro por categoria: salida del grid + entrada escalonada de cards */
.negocio-product.cat-enter { animation: portalCatIn .4s cubic-bezier(.2,0,0,1) both; }
@keyframes portalCatIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.negocio-chip:active { transform: scale(.93); }
@media (prefers-reduced-motion: reduce) {
  .negocio-product.cat-enter { animation: none; }
  .negocio-grid { transition: none; }
  .negocio-chip:active { transform: none; }
}
.cart-icon { position: relative; display: inline-flex; align-items: center; gap: .35rem; color: inherit; text-decoration: none; font-weight: 600; }
.cart-badge { background: var(--brand-primary); color: #fff; padding: .1rem .4rem; border-radius: 999px; font-size: .7rem; }
.negocio-footer {
  background: var(--brand-hero); color: #fff;
  padding: 2rem 4%; text-align: center; border-radius: 2rem 2rem 0 0;
  margin-top: auto;
}
.negocio-footer a { color: #fff; opacity: .85; text-decoration: none; margin: 0 .5rem; }
.negocio-footer a:hover { opacity: 1; }

/* Product detail */
.product-detail-wrap { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 768px) { .product-detail-grid { grid-template-columns: 1fr; } }
.product-image-box { background: var(--zel-bg); border-radius: 1rem; display: flex; align-items: center; justify-content: center; min-height: 260px; }
.product-image-box img { max-width: 100%; border-radius: 1rem; }
.product-title { font-family: var(--font-brand); font-size: 1.75rem; margin: .5rem 0 .25rem; }
.product-meta { color: var(--zel-muted); margin-bottom: 1rem; }
.product-price { font-size: 2rem; font-weight: 800; margin-bottom: 1rem; }
.product-stock { color: var(--zel-green); margin-bottom: 1rem; }
.product-quantity { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.product-quantity input { width: 80px; padding: .75rem; border-radius: .5rem; border: 1px solid var(--zel-border); background: var(--zel-card); color: inherit; }
.product-reviews .review { padding: 1rem 0; border-bottom: 1px solid var(--zel-border); }
.product-reviews .review:last-child { border-bottom: none; }

/* Checkout */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }
.method { padding: 1rem; border: 1px solid var(--zel-border); border-radius: .5rem; margin-bottom: .75rem; background: var(--zel-card); display: flex; align-items: center; gap: .75rem; cursor: pointer; }
.dark .method { background: var(--zel-card-dark); border-color: var(--zel-border-dark); }
.method.selected { border-color: var(--zel-primary); background: rgba(37,99,235,.05); }
.method input { cursor: pointer; }
.checkout-wrap { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }

/* Checkout glassmorphism: capa ambiental con manchas de marca + tarjetas
   translucidas con backdrop-filter. Fallback a tarjeta solida cuando el
   navegador no soporta blur. */
.portal-glass { position: relative; isolation: isolate; min-height: 100vh; }
.portal-ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(46rem 30rem at 10% -5%, rgba(37, 99, 235, .14), transparent 62%),
    radial-gradient(36rem 26rem at 94% 16%, rgba(229, 165, 45, .12), transparent 62%),
    radial-gradient(52rem 38rem at 55% 108%, rgba(56, 189, 248, .10), transparent 66%),
    var(--zel-bg);
}
.dark .portal-ambient {
  background:
    radial-gradient(46rem 30rem at 10% -5%, rgba(59, 130, 246, .22), transparent 62%),
    radial-gradient(36rem 26rem at 94% 16%, rgba(229, 165, 45, .08), transparent 62%),
    radial-gradient(52rem 38rem at 55% 108%, rgba(56, 189, 248, .12), transparent 66%),
    var(--zel-bg-dark);
}

.portal-glass .card { animation: checkoutGlassIn .45s cubic-bezier(.2, 0, 0, 1) both; }
.portal-glass .grid-2 .card:nth-of-type(2) { animation-delay: .06s; }
.portal-glass .grid-2 .card:nth-of-type(3) { animation-delay: .12s; }
.portal-glass .grid-2 > div:last-child .card { animation-delay: .09s; }
@keyframes checkoutGlassIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-glass .card { animation: none; }
}

@supports ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .portal-glass .portal-nav {
    background: rgba(255, 255, 255, .6);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    border-bottom-color: rgba(255, 255, 255, .55);
  }
  .dark .portal-glass .portal-nav {
    background: rgba(11, 18, 32, .55);
    border-bottom-color: rgba(148, 163, 184, .15);
  }
  .portal-glass .card {
    background: rgba(255, 255, 255, .58);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    backdrop-filter: blur(20px) saturate(1.5);
    border-color: rgba(255, 255, 255, .65);
    box-shadow: var(--shadow-md);
  }
  .dark .portal-glass .card {
    background: rgba(30, 41, 59, .5);
    border-color: rgba(148, 163, 184, .18);
  }
  .portal-glass .form-input,
  .portal-glass .method {
    background: rgba(255, 255, 255, .5);
    border-color: rgba(226, 232, 240, .7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
  .dark .portal-glass .form-input,
  .dark .portal-glass .method {
    background: rgba(15, 23, 42, .4);
    border-color: rgba(148, 163, 184, .22);
  }
  .portal-glass .method.selected {
    background: rgba(37, 99, 235, .12);
    border-color: var(--zel-primary);
  }
}

.form-label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .4rem; }
.form-input {
  width: 100%; padding: .75rem 1rem; border-radius: .5rem;
  border: 1px solid var(--zel-border); background: var(--zel-card); color: inherit; margin-bottom: 1rem;
}
.dark .form-input { background: var(--zel-card-dark); border-color: var(--zel-border-dark); }
.form-input:focus { outline: none; border-color: var(--zel-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-input:read-only { background: var(--zel-bg); color: var(--zel-muted); }

/* Dashboard */
.portal-dashboard-wrap { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
.portal-account-nav { display: flex; gap: 1rem; font-size: .9rem; align-items: center; }
.portal-account-nav a:hover { color: var(--zel-primary); }
.dashboard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { .dashboard-stats { grid-template-columns: 1fr; } }
.dashboard-stat { padding: 1.25rem; text-align: center; }
.dashboard-stat .label { color: var(--zel-muted); font-size: .85rem; text-transform: uppercase; font-weight: 700; }
.dashboard-stat .value { font-size: 2rem; font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } }
.dashboard-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dashboard-table th { text-align: left; font-size: .75rem; text-transform: uppercase; color: var(--zel-muted); border-bottom: 1px solid var(--zel-border); padding: .5rem 0; }
.dashboard-table td { padding: .75rem 0; border-bottom: 1px solid var(--zel-border); }


/* Carrito */
.cart-wrap { max-width: 980px; margin: 0 auto; padding: 2rem 1rem; }
.cart-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: start; }
@media (min-width: 820px) {
  .cart-grid { grid-template-columns: 1.6fr 1fr; }
  .cart-summary { position: sticky; top: 5.5rem; }
}

.cart-item {
  display: flex; gap: 1rem; align-items: center;
  padding: 1rem 0; border-bottom: 1px solid var(--zel-border);
  animation: checkoutGlassIn .4s cubic-bezier(.2,0,0,1) both;
}
.cart-item:last-of-type { border-bottom: none; }
.cart-thumb {
  width: 64px; height: 64px; border-radius: .75rem; flex-shrink: 0;
  object-fit: cover; background: var(--zel-bg);
  border: 1px solid var(--zel-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--zel-muted); font-size: 1.3rem; overflow: hidden;
}
.dark .cart-thumb { background: rgba(15,23,42,.4); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cart-item-unit { color: var(--zel-muted); font-size: .8rem; margin-top: .15rem; }
.cart-item-total { font-weight: 800; min-width: 5.5rem; text-align: right; font-size: 1rem; }

.qty-stepper {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--zel-border); border-radius: .65rem; overflow: hidden;
  background: var(--zel-card);
}
.qty-stepper button {
  width: 2rem; height: 2.1rem; border: none; background: transparent;
  color: var(--zel-primary); font-size: .95rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.qty-stepper button:hover { background: rgba(37,99,235,.08); }
.qty-stepper button:active { transform: scale(.92); }
.qty-stepper input {
  width: 2.6rem; border: none; text-align: center; font-weight: 700; font-size: .9rem;
  background: transparent; color: inherit; -moz-appearance: textfield; appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-remove {
  width: 2.1rem; height: 2.1rem; border-radius: .65rem; border: 1px solid transparent;
  background: transparent; color: var(--zel-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.cart-remove:hover { color: var(--zel-danger); background: rgba(214,69,69,.08); border-color: rgba(214,69,69,.25); }

/* Barra de progreso hacia el pedido minimo */
.minorder-bar { height: .5rem; border-radius: 999px; background: rgba(148,163,184,.25); overflow: hidden; }
.minorder-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--zel-primary), #38BDF8);
  transition: width .5s cubic-bezier(.2,0,0,1);
}
.minorder-fill.done { background: linear-gradient(90deg, var(--zel-success), #4ade80); }

/* Marca del negocio en el storefront: el local es el protagonista,
   Zelanda queda como atribucion sutil. */
.store-brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.store-brand-logo {
  width: 36px; height: 36px; border-radius: .65rem; object-fit: cover;
  border: 1px solid var(--zel-border); background: #fff; flex-shrink: 0;
}
.store-brand-letter {
  width: 36px; height: 36px; border-radius: .65rem; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-hero); color: #fff; font-weight: 800; font-size: 1.05rem;
}
.store-brand-text { font-weight: 700; font-size: .95rem; line-height: 1.15; display: flex; flex-direction: column; }
.store-brand-text small { font-weight: 500; font-size: .68rem; color: var(--zel-muted); letter-spacing: .01em; }

/* Logo real dentro del header del storefront (reemplaza la letra) */
.negocio-logo-img { padding: 0; object-fit: cover; background: #fff; }

/* Atribucion discreta al pie de las paginas del funnel */
.powered-by {
  display: flex; align-items: center; justify-content: center; gap: .3rem;
  font-size: .75rem; color: var(--zel-muted);
  margin: 1.75rem 0 .5rem; opacity: .8;
}
.powered-by img { height: 14px; width: 14px; border-radius: 3px; opacity: .85; }
