:root{
  /* Base */
  --np-bg:#f8f8f6;
  --np-surface:#ffffff;
  --np-card:#ffffff;
  --np-text:#1f2937;
  --np-muted:#6b7280;
  --np-border:#e5e7eb;

/* =============================
   Mi Fidelización (Portal)
   ============================= */
.np-loyalty{max-width:720px;margin:24px auto;padding:0 14px;}
.np-loyalty__header{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:12px;}
.np-loyalty__header h2{margin:0;}
.np-loyalty__name{opacity:.75;font-size:14px;}
.np-loyalty__card{background:#fff;border:1px solid rgba(0,0,0,.08);border-radius:14px;padding:14px 14px;margin:12px 0;box-shadow:0 6px 18px rgba(0,0,0,.04);}
.np-loyalty__pointsValue{font-size:34px;font-weight:800;line-height:1;}
.np-loyalty__pointsValue span{font-size:16px;font-weight:700;opacity:.7;}
.np-loyalty__pointsLabel{opacity:.7;margin-top:6px;}
.np-loyalty__progressTop{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:10px;flex-wrap:wrap;}
.np-loyalty__progressMissing{opacity:.75;font-size:13px;}
.np-loyalty__bar{height:12px;border-radius:999px;background:rgba(0,0,0,.08);overflow:hidden;margin-top:10px;}
.np-loyalty__barFill{height:100%;background:rgba(0,0,0,.65);border-radius:999px;}
.np-loyalty__sectionTitle{font-weight:800;margin-bottom:10px;}
.np-loyalty__ladder{list-style:none;padding:0;margin:0;display:grid;gap:8px;}
.np-loyalty__ladderItem{display:flex;justify-content:space-between;gap:10px;padding:10px 12px;border-radius:12px;background:rgba(0,0,0,.03);border:1px solid rgba(0,0,0,.05);}
.np-loyalty__ladderItem.is-done{opacity:.75;}
.np-loyalty__ladderPts{font-weight:800;}
.np-loyalty__orders{display:grid;gap:10px;}
.np-loyalty__orderRow{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:12px;background:rgba(0,0,0,.03);border:1px solid rgba(0,0,0,.05);}
.np-loyalty__orderNum{font-weight:800;}
.np-loyalty__orderDate{opacity:.7;font-size:12px;margin-top:2px;}
.np-loyalty__orderTotal{font-weight:800;text-align:right;}
.np-loyalty__orderPts{opacity:.75;font-size:12px;text-align:right;margin-top:2px;}
.np-loyalty__pendingTitle{font-weight:900;margin-bottom:6px;}
.np-loyalty__pendingHint{opacity:.7;font-size:12px;margin-top:6px;}
.np-loyalty__muted{opacity:.7;}
.np-loyalty--error{max-width:720px;margin:24px auto;padding:14px;border-radius:14px;border:1px solid rgba(0,0,0,.08);background:rgba(0,0,0,.03);}

  /* Identidad Italia */
  --np-green:#1e7f43;
  --np-red:#c62828;

  --np-radius:16px;
  --np-shadow:0 10px 30px rgba(0,0,0,.08);
  --np-max:1100px;
  --np-pad:20px;
  --np-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* Reset básico */
*{box-sizing:border-box}
html,body{margin:0;padding:0}

body{
  font-family:var(--np-font);
  background:var(--np-bg);
  color:var(--np-text);
  line-height:1.6;
  padding-top:68px; /* compensa header fixed */
}

/* Fix barra admin WordPress (agrega margin-top:32px al body si estás logueado) */
body.admin-bar .np-header { top: 32px; }
body.admin-bar { padding-top: calc(68px + 32px); }
@media screen and (max-width:782px){
  body.admin-bar .np-header { top: 46px; }
  body.admin-bar { padding-top: calc(60px + 46px); }
}

a{text-decoration:none;color:inherit}

.np-container{
  max-width:var(--np-max);
  margin:0 auto;
  padding:0 var(--np-pad);
}

/* HEADER — sobreescrito por header.php con diseño custom */
.np-header{
  position:fixed;
  top:0;
  background:transparent;   /* header.php maneja su propio fondo */
  border-bottom:none;        /* header.php maneja su propio borde */
  z-index:10000;             /* suficiente para estar sobre todo */
  overflow:visible;
  max-height:none;
  height:auto;
}

.np-header__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 0;               /* header.php usa height fija, no padding vertical */
  overflow:visible;
  max-height:none;
}

/* BRAND — sobreescrito por header.php */
.np-brand__title{
  font-weight:800;
  font-size:20px;
  color:var(--np-green);
}

.np-brand__tagline{
  font-size:12px;
  color:var(--np-muted);
}

.np-nav__menu{
  list-style:none;
  display:flex;
  gap:16px;
  padding:0;
  margin:0;
}

.np-nav__menu a{
  padding:10px 14px;
  border-radius:12px;
  font-weight:600;
}

.np-nav__menu a:hover{
  background:var(--np-green);
  color:#fff;
}

/* HERO */
.np-hero{
  padding:60px 0 40px;
  text-align:center;
}

.np-hero__title{
  font-size:44px;
  margin-bottom:10px;
  color:var(--np-green);
}

.np-hero__subtitle{
  color:var(--np-muted);
  margin-bottom:25px;
}

/* BOTONES */
.np-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:14px 20px;
  border-radius:14px;
  font-weight:700;
  background:var(--np-red);
  color:#ffffff;
  transition:.2s ease;
}

.np-btn:hover{
  background:#a91f1f;
  transform:translateY(-2px);
}

.np-btn--ghost{
  background:#ffffff;
  border:2px solid var(--np-green);
  color:var(--np-green);
}

.np-btn--ghost:hover{
  background:var(--np-green);
  color:#ffffff;
}

/* QR */
.np-qr{
  margin-top:20px;
  padding:10px;
  background:#ffffff;
  border:2px solid var(--np-green);
  border-radius:14px;
}

/* CONTENT */
.np-content{
  padding:40px 0 60px;
}

.np-article{
  padding:20px;
  background:var(--np-card);
  border:1px solid var(--np-border);
  border-radius:var(--np-radius);
  box-shadow:var(--np-shadow);
  margin-bottom:20px;
}

.np-article__title{
  margin:0 0 10px;
  color:var(--np-green);
}

.np-article__excerpt{
  color:var(--np-muted);
}

/* FOOTER */
.np-footer{
  background:#ffffff;
  border-top:3px solid var(--np-red);
}

.np-footer__inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:20px 0;
}

.np-muted{
  color:var(--np-muted);
}

@media(max-width:768px){
  .np-hero__title{
    font-size:34px;
  }

  .np-nav__menu{
    gap:8px;
    flex-wrap:wrap;
  }
}
.np-product{
  background:var(--np-surface);
  border:1px solid var(--np-border);
  border-radius:var(--np-radius);
  box-shadow:var(--np-shadow);
  padding:20px;
}

.np-product-hero{
  border-radius:var(--np-radius);
  overflow:hidden;
  border:1px solid var(--np-border);
  margin-bottom:16px;
}

.np-product-hero__img{
  display:block;
  width:100%;
  height:auto;
}

.np-product__body{
  display:grid;
  grid-template-columns:180px 1fr;
  gap:16px;
  align-items:start;
  margin-top:10px;
}

.np-product__thumb img{
  width:100%;
  height:auto;
  border-radius:14px;
  border:1px solid var(--np-border);
}

.np-prices{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.np-price{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 14px;
  border:1px solid var(--np-border);
  border-radius:14px;
  background:#fff;
}

.np-price__label{font-weight:700;color:var(--np-green);}
.np-price__value{font-weight:800;}
@media(max-width:720px){
  .np-product__body{grid-template-columns:1fr;}
  .np-prices{grid-template-columns:1fr;}
}
/* HERO del producto: recorte controlado */
.np-product-hero{
  border-radius:var(--np-radius);
  overflow:hidden;
  border:1px solid var(--np-border);
  margin-bottom:16px;
  max-height:260px;           /* control del tamaño */
}

.np-product-hero__img{
  display:block;
  width:100%;
  height:260px;              /* altura fija */
  object-fit:cover;          /* recorta sin deformar */
}
@media(max-width:720px){
  .np-product-hero{max-height:200px;}
  .np-product-hero__img{height:200px;}
}
.np-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(250px,1fr));
  gap:20px;
}

.np-card{
  background:#fff;
  border:1px solid var(--np-border);
  border-radius:16px;
  overflow:hidden;
  box-shadow:var(--np-shadow);
  display:flex;
  flex-direction:column;
}

.np-card__img img{
  width:100%;
  height:180px;
  object-fit:cover;
}

.np-card__body{
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.np-price-card{
  font-weight:800;
  color:var(--np-green);
}

.np-modal{
  display:none;
  position:fixed;
  top:0;left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,.6);
  justify-content:center;
  align-items:center;
  z-index:999;
}

.np-modal__content{
  background:#fff;
  width:90%;
  max-width:600px;
  border-radius:16px;
  padding:20px;
  position:relative;
}

.np-modal__close{
  position:absolute;
  top:10px;
  right:15px;
  font-size:24px;
  cursor:pointer;
}
.np-modal-hero img{
  width:100%;
  height:220px;
  object-fit:cover;
  border-radius:14px;
  border:1px solid var(--np-border);
  margin-bottom:12px;
}
.np-modal-section{margin-top:14px;}
.np-opt{display:block;padding:10px 12px;border:1px solid var(--np-border);border-radius:12px;margin:8px 0;background:#fff;}
.np-opt input{margin-right:8px;}
.np-modal-total{margin-top:16px;padding:12px 14px;border-radius:14px;border:2px solid var(--np-green);background:#fff;font-size:18px;}
/* Modal: permitir scroll interno */
.np-modal__content{
  background:#fff;
  width:90%;
  max-width:650px;
  max-height:85vh;      /* limite alto */
  overflow:auto;        /* scroll */
  border-radius:16px;
  padding:20px;
  position:relative;
}

/* Opciones con precio a la derecha */
.np-opt--line{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.np-opt__price{
  font-weight:800;
  color:var(--np-green);
  white-space:nowrap;
}
/* Floating cart */
.np-cart-fab{
  position:fixed; right:18px; bottom:18px;
  z-index:1000;
  border:none;
  border-radius:999px;
  padding:12px 14px;
  background:var(--np-red, #c1121f);
  color:#fff;
  font-weight:800;
  box-shadow:var(--np-shadow);
  cursor:pointer;
  display:flex; gap:8px; align-items:center;
}
#np-cart-count{
  background:rgba(255,255,255,.2);
  padding:2px 8px;
  border-radius:999px;
}

/* Drawer */
.np-cart-drawer{
  display:none;
  position:fixed; inset:0;
  background:rgba(0,0,0,.55);
  z-index:1001;
}
.np-cart-drawer.is-open{ display:block; }
.np-cart-drawer__panel{
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  width:min(420px, 95vw);
  background:#fff;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  box-shadow:var(--np-shadow);
}
.np-cart-drawer__header{
  display:flex; justify-content:space-between; align-items:center;
  border-bottom:1px solid var(--np-border);
  padding-bottom:10px;
  margin-bottom:10px;
}
.np-icon-btn{
  border:1px solid var(--np-border);
  background:#fff;
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}

/* Cart items */
.np-cart-items{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:10px 0 14px;
  padding:16px 24px;
  flex:0 0 auto;
  overflow:visible;
  min-height:0;
}
.np-cart-item{
  border:1px solid var(--np-border);
  border-radius:14px;
  padding:12px;
  background:#fff;
}
.np-cart-item__top{
  display:flex; justify-content:space-between; gap:10px;
}
.np-cart-item__title{ font-weight:900; }
.np-cart-item__meta{ color:#6b7280; font-size:13px; margin-top:6px; }
.np-cart-item__actions{ display:flex; gap:8px; margin-top:10px; }
.np-mini-btn{
  border:1px solid var(--np-border);
  background:#fff;
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:800;
}
.np-mini-btn--danger{ border-color:#fecaca; color:#b91c1c; }
.np-cart-summary{
  border-top:1px solid var(--np-border);
  padding-top:12px;
  margin-top:10px;
}
.np-cart-total{
  display:flex; justify-content:space-between; align-items:center;
  font-size:18px;
}

/* Checkout form */
.np-checkout{
  margin-top:14px;
  padding:20px 24px 28px;
  display:flex;
  flex-direction:column;
  gap:14px;
  flex:0 0 auto;
  overflow:visible;
}
.np-checkout h4{ margin:10px 0; }
.np-field{ display:block; margin:10px 0; }
.np-field span{ display:block; font-weight:800; margin-bottom:6px; }
.np-field input{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--np-border);
  border-radius:12px;
}
.np-seg{ display:flex; gap:12px; }
.np-btn--primary{
  width:100%;
  margin-top:10px;
}
.np-btn--ghost{
  width:100%;
  margin-top:10px;
  background:#fff;
  border:1px solid var(--np-border);
}

@media (max-width: 768px){
  .np-cart-drawer__panel{
    width:100vw;
    max-width:100vw;
    height:100dvh;
    max-height:100dvh;
    padding-bottom:env(safe-area-inset-bottom, 16px);
  }

  .np-checkout{
    padding-bottom:calc(28px + env(safe-area-inset-bottom, 16px));
  }

  #np-send-whatsapp,
  #np-clear-cart{
    min-height:52px;
  }
}
