:root{
  --bg: #fff0ef;
  --bg-2: #ffe2df;
  --surface: #ffffff;
  --surface-2: #fff7f6;
  --ink: #231513;
  --muted: #7a5c58;
  --line: #f2d4cf;
  --brand: #e34b3f;
  --brand-2: #f36a5f;
  --accent: #b5342c;
  --danger: #b00020;
  --ok: #1b5e20;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(63, 37, 18, 0.16);
  --shadow-soft: 0 10px 28px rgba(63, 37, 18, 0.12);
}

*{ box-sizing:border-box; }
html, body{ width:100%; overflow-x:hidden; }
html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(600px 260px at 10% 0%, rgba(227,75,63,0.22), transparent 60%),
    radial-gradient(700px 380px at 95% 15%, rgba(243,106,95,0.2), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--ink);
}

.wrap{
  width:100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px;
}

.hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  margin: 8px 0 22px;
  padding: 18px 20px;
  background: linear-gradient(120deg, #fff5f4, #ffebe9);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow:hidden;
}

.hero::after{
  content:"";
  position:absolute;
  right:-80px;
  top:-60px;
  width:200px;
  height:200px;
  border-radius:50%;
  background: radial-gradient(circle, rgba(227,75,63,0.2), transparent 70%);
  pointer-events:none;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.logoBox{
  width:88px;
  height:88px;
  border-radius: 0;
  border:0;
  background: transparent;
  box-shadow: none;
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
  overflow:hidden;
}

.logoImg{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:0;
}

.brandText{ min-width:0; }

h1{
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.05;
  margin:0;
  letter-spacing:-0.02em;
}

.subtitle{
  margin:6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.meta{
  text-align:right;
  color: var(--muted);
  font-size: 14px;
  max-width: 320px;
}

.metaTitle{
  font-weight:700;
  color: var(--ink);
  margin-bottom:6px;
}

.metaList{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 14px;
  border:1px solid var(--line);
  border-radius: 999px;
  background:#fff;
  box-shadow: 0 8px 18px rgba(63, 37, 18, 0.08);
  width: fit-content;
  margin-top:10px;
  font-size: 13px;
}

.layout{
  display:grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
  align-items:start;
  min-width:0;
}

.card{
  background: var(--surface);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  min-width:0;
}

.card h2{
  font-family: "Fraunces", "Times New Roman", serif;
  margin:0 0 12px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.cardTitleRow{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
}

.hint{
  font-size: 13px;
  color: var(--muted);
}

.grid3{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}


label{
  display:block;
  font-size: 13px;
  color: var(--muted);
}

input{
  width:100%;
  margin-top: 6px;
  padding: 12px 12px;
  border:1px solid var(--line);
  border-radius: 14px;
  outline:none;
  font-size: 15px;
  background: var(--surface-2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus{
  border-color: rgba(243,91,63,.55);
  box-shadow: 0 0 0 4px rgba(243,91,63,.14);
  background:#fff;
}

.row{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.radioPill{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 14px;
  border:1px solid var(--line);
  border-radius: 999px;
  cursor:pointer;
  user-select:none;
  background:#fff;
  color: var(--ink);
  font-weight:600;
}
.pill input{ width:auto; margin:0; }
.pill.active{
  border-color: rgba(243,91,63,.35);
  background: rgba(243,91,63,.08);
  box-shadow: 0 0 0 4px rgba(243,91,63,.10);
}

.productsList{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
}

.productCard{
  border:1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  background: #ffffff;
  min-width:0;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.productCard:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.productLeft{
  display:flex;
  gap:12px;
  align-items:center;
  min-width:0;
}

.productImg{
  width:60px;
  height:60px;
  border-radius: 16px;
  border:1px solid var(--line);
  object-fit:cover;
  background: #ffffff;
  flex: 0 0 auto;
}

.thumb{
  width:60px;
  height:60px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color: rgba(227,75,63,.85);
  flex: 0 0 auto;
}

.productInfo{ min-width:0; }
.productName{
  font-family: "Fraunces", "Times New Roman", serif;
  font-weight:700;
  margin:0 0 4px;
  font-size: 16px;
}

.productMeta{
  color: var(--muted);
  font-size: 12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  min-width:0;
}

.price{ font-weight:800; color: var(--ink); }
.stockLow{ color:#b45309; }

.stepper{
  display:flex;
  align-items:center;
  gap:10px;
  flex: 0 0 auto;
}

.stepper button{
  width:40px;
  height:40px;
  border-radius: 12px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
  font-size: 18px;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stepper button:hover{
  border-color: rgba(243,91,63,.35);
  box-shadow: 0 8px 16px rgba(63, 37, 18, 0.12);
  transform: translateY(-1px);
}

.qtyBox{
  width: 72px;
  max-width: 72px;
  text-align:center;
  font-weight:800;
  background:#fff;
}

.summaryRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 8px 0;
  color: var(--muted);
  font-size: 14px;
}
.summaryRow strong{ color: var(--ink); }

.summaryTotal{
  border-top: 1px dashed var(--line);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 22px;
  color: var(--ink);
  font-weight:800;
  display:flex;
  justify-content:space-between;
}

.chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.chip{
  font-size:12px;
  color: var(--ink);
  background:#fff;
  border:1px solid var(--line);
  border-radius:999px;
  padding:6px 10px;
}

.cartEmpty{
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
}

.cartList{
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.cartItem{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size: 13px;
  color: var(--muted);
}
.cartItem strong{
  color: var(--ink);
  font-weight:800;
}

.error{ color: var(--danger); margin-top: 10px; font-size: 14px; }
.success{ color: var(--ok); margin-top: 10px; font-size: 14px; }

.btn{
  width:100%;
  border:0;
  border-radius: 16px;
  padding: 15px 14px;
  font-weight:800;
  cursor:pointer;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 12px 26px rgba(243,91,63,.28);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover{ transform: translateY(-1px); filter: saturate(1.08); }

.btn:disabled{
  opacity:1;
  background:#f5c7b8;
  color:#ffffff;
  box-shadow:none;
  cursor:not-allowed;
}

.wa{
  display:block;
  margin-top: 10px;
  text-align:center;
  padding: 12px;
  border-radius: 14px;
  text-decoration:none;
  border:1px solid var(--line);
  background:#fff;
  color: var(--ink);
}

.hidden{ display:none; }

/* =========================
   Responsive
   ========================= */

@media (max-width: 920px){
  .layout{ grid-template-columns: 1fr; }
  .hero{
    align-items:center;
    flex-direction:column;
    text-align:center;
    gap:14px;
  }
  .meta{ text-align:left; max-width:none; }
  #submitBtn{ display:none; }
  .wrap{ padding: 14px; }
  input, select, textarea{ font-size:16px; }
  .brand{
    flex-direction:column;
    align-items:center;
    gap:10px;
  }
  .badge{
    align-self:center;
    text-align:center;
    width:100%;
    justify-content:center;
  }
  .logoBox{ width:120px; height:120px; }
  .titleLine{
    display:block;
  }
}

@media (max-width: 720px){
  .grid3{ grid-template-columns: 1fr; }
}

/* Productos apilados */
@media (max-width: 520px){
  .productCard{
    flex-direction: column;
    align-items: stretch;
  }
  .stepper{
    justify-content: flex-end;
  }
  h1{
    font-size: clamp(24px, 8vw, 34px);
    line-height: 1.1;
    white-space: normal;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:2px;
    text-align: center;
  }
}

/* pills: que no se monten */
@media (max-width: 520px){
  .radioPill{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:10px;
  }
}
@media (max-width: 360px){
  .radioPill{ grid-template-columns: 1fr; }
}

/* Evita overflow por nombres largos en productos */
@media (max-width: 520px){
  .productInfo{ min-width:0; }
  .productName{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .stepper{
    display:grid;
    grid-template-columns: 44px 1fr 44px;
    gap:8px;
    align-items:center;
  }
  .qtyBox{
    width:100%;
    max-width:none;
    text-align:center;
  }
}

/* =========================
   Sticky mobile
   ========================= */

.mobileSticky{ display:none; }

@media (max-width: 920px){
  .mobileSticky{
    display:block;
    position: sticky;
    bottom: 0;
    margin-top: 12px;
    border-radius: 18px;
    border:1px solid var(--line);
    background: rgba(255,250,244,.92);
    backdrop-filter: blur(8px);
    padding: 12px;
    box-shadow: 0 -10px 30px rgba(63, 37, 18, 0.12);
    z-index: 50;
  }

  .mobileSticky .row{ justify-content:space-between; }
  .mobileSticky .btn{ margin-top: 10px; }
}

/* Espacio entre cards apiladas */
.layout > div > .card{
  margin-bottom: 14px;
}
.layout > div > .card:last-child{
  margin-bottom: 0;
}

@media (max-width: 520px){
  .layout > div > .card{
    margin-bottom: 16px;
  }
}

@keyframes fadeUp{
  from{ opacity:0; transform: translateY(8px); }
  to{ opacity:1; transform: translateY(0); }
}

.card, .productCard{
  animation: fadeUp 0.35s ease both;
}

@media (prefers-reduced-motion: reduce){
  .card, .productCard{ animation: none; }
  .btn, .productCard, .stepper button{ transition: none; }
}
