/* Sweet Drizzle — owner's TV control panel v2 (mobile-first).
   Black + pink + gold, Fredoka, original logo, clean. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--sd-font-display); color: var(--sd-cocoa); min-height: 100vh; background: var(--sd-blush); }
button, input, textarea { font: inherit; color: inherit; }
.muted { color: #7A5550; font-size: 14px; line-height: 1.4; }

.app { max-width: 640px; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }
.panel { display: flex; flex-direction: column; gap: 16px; }

/* header: black band with the original logo */
.top {
  display: flex; align-items: center; gap: 14px; margin: 0 -16px; padding: 14px 16px;
  background: var(--sd-grad-night); color: var(--sd-text-dark); border-bottom: 1px solid var(--sd-gold-light);
}
.top .logo { width: 62px; height: 62px; flex: none; display: block; }
.top h1 { font-size: 23px; font-weight: 600; line-height: 1.1; }
.top .muted { color: var(--sd-muted-dark); }
.status { margin-left: auto; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--sd-line-dark); color: var(--sd-gold-light); white-space: nowrap; }
.status.dirty { color: var(--sd-pink); border-color: var(--sd-pink); }

/* cards */
.card { background: #fff; border-radius: var(--sd-radius-m); padding: 18px; border: 1px solid rgba(176,122,42,.28); box-shadow: 0 6px 20px rgba(59,36,34,.06); }
.card h2 { font-size: 19px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--sd-gold); color: var(--sd-gold-dark); }
.lbl { display: block; font-size: 13px; font-weight: 500; margin: 14px 0 6px; color: #7A5550; }

.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; border: 1px solid #EBCFD3; background: #FFFCFC;
  font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.input:focus { border-color: var(--sd-pink); box-shadow: 0 0 0 4px rgba(242,139,151,.22); }
.input:disabled { opacity: .55; }
.money { display: flex; align-items: center; gap: 8px; }
.money span { font-weight: 600; font-size: 20px; color: var(--sd-gold-dark); }
.money .input { max-width: 140px; }

/* switch */
.switch { position: relative; flex: none; width: 52px; height: 30px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #E9D9DB; transition: background .25s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(59,36,34,.25); transition: transform .25s cubic-bezier(.3,.9,.3,1.2); }
.switch input:checked + span { background: var(--sd-pink); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px rgba(242,139,151,.35); }

/* special */
.special-body { transition: opacity .3s; }
.special-body.off { opacity: .45; pointer-events: none; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.photo-grid button {
  position: relative; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden; border: 2px solid transparent; background: #fff; cursor: pointer; padding: 0;
  box-shadow: 0 0 0 1px #EBCFD3; transition: transform .2s, border-color .2s;
}
.photo-grid button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid button[aria-checked="true"] { border-color: var(--sd-pink); transform: translateY(-2px); }
.photo-grid button[aria-checked="true"]::after { content: "✓"; position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--sd-pink); color: #0E0B0C; font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.photo-grid .b3d { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: #0E0B0C; color: var(--sd-gold-light); font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.photo-grid .none { display: grid; place-items: center; font-size: 12px; font-weight: 500; color: #7A5550; text-align: center; padding: 6px; background: var(--sd-blush); }

.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.suggest button { border: 1px solid #EBCFD3; cursor: pointer; padding: 8px 12px; border-radius: 999px; background: #FFFCFC; font-size: 13px; }
.suggest button:active { transform: scale(.97); }

/* prices */
.price-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.price-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F4E3E5; }
.price-row:last-child { border-bottom: 0; }
.price-row .nm { flex: 1; min-width: 0; }
.price-row .nm b { display: block; font-weight: 500; font-size: 15px; }
.price-row .nm small { color: #7A5550; opacity: .8; font-size: 12px; }
.price-row.changed .nm small { color: var(--sd-pink-deep); opacity: 1; font-weight: 500; }
.stepper { display: flex; align-items: center; background: var(--sd-blush); border-radius: 999px; padding: 3px; }
.stepper button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #fff; font-size: 20px; font-weight: 600; color: var(--sd-pink-deep); cursor: pointer; }
.stepper input { width: 62px; text-align: center; border: 0; background: transparent; font-weight: 600; font-size: 17px; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.reset-one { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #7A5550; font-size: 18px; cursor: pointer; visibility: hidden; }
.price-row.changed .reset-one { visibility: visible; }
.group-label { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sd-gold-dark); margin: 14px 0 2px; }
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--sd-grad-gold); opacity: .6; }

/* sold out */
.count-pill { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px; background: var(--sd-blush); color: var(--sd-pink-deep); display: grid; place-items: center; font-weight: 600; }
.count-pill.has { background: var(--sd-pink); color: #0E0B0C; }
details.so-group { border-radius: 14px; border: 1px solid #F1DDE0; margin-top: 10px; overflow: hidden; }
details.so-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 500; }
details.so-group summary::-webkit-details-marker { display: none; }
details.so-group summary::after { content: "›"; margin-left: 8px; font-size: 22px; color: var(--sd-gold); transition: transform .2s; }
details.so-group[open] summary::after { transform: rotate(90deg); }
details.so-group summary .n { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--sd-pink-deep); }
.so-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid #F6E7E9; min-height: 54px; }
.so-row .nm { font-size: 15px; }
.so-row.on .nm { text-decoration: line-through; text-decoration-color: var(--sd-pink); opacity: .6; }
.so-row .st { font-size: 11px; font-weight: 600; color: #0E0B0C; background: var(--sd-pink); padding: 3px 8px; border-radius: 8px; margin-left: 8px; display: inline-block; }

/* segmented */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 16px; background: var(--sd-blush); margin-top: 12px; }
.seg button { border: 0; padding: 12px 6px; border-radius: 12px; background: transparent; font-size: 14px; font-weight: 500; cursor: pointer; }
.seg button[aria-checked="true"] { background: #0E0B0C; color: var(--sd-gold-light); }

.link-btn { align-self: center; border: 0; background: none; color: #7A5550; text-decoration: underline; font-size: 14px; padding: 10px; cursor: pointer; }
.spacer { height: 96px; }

/* push bar */
.pushbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(14,11,12,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--sd-gold-light);
}
.pending { font-size: 13px; color: var(--sd-muted-dark); flex: 1; }
.pending.dirty { color: var(--sd-pink); font-weight: 500; }
.push { border: 0; cursor: pointer; height: 52px; padding: 0 28px; border-radius: 999px; font-weight: 600; font-size: 17px; color: #0E0B0C; background: var(--sd-pink); transition: transform .15s, box-shadow .2s; }
.push:active { transform: scale(.97); }
.push.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(242,139,151,.25); } }

/* glassy toast */
.toast {
  position: fixed; left: 50%; top: 18px; z-index: 50; transform: translate(-50%, -30px); opacity: 0; pointer-events: none;
  padding: 14px 22px; border-radius: 999px; font-weight: 500; font-size: 16px; white-space: nowrap; color: var(--sd-text-dark);
  background: rgba(14,11,12,.72); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--sd-gold-light); box-shadow: 0 18px 40px rgba(0,0,0,.25);
  transition: opacity .35s, transform .45s cubic-bezier(.2,.9,.3,1.3);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* preview */
.preview { background: #0E0B0C; color: var(--sd-text-dark); border-radius: var(--sd-radius-m); padding: 12px; border: 1px solid var(--sd-line-dark); }
.pv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pv-title { font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pv-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sd-pink); box-shadow: 0 0 0 4px rgba(242,139,151,.2); }
.pv-ctrls { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--sd-line-dark); background: transparent; color: var(--sd-gold-light); font-weight: 600; font-size: 16px; cursor: pointer; }
.tv-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.tv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pv-hint { margin-top: 12px; font-size: 13px; color: var(--sd-muted-dark); }
.pv-hint b { color: var(--sd-pink); font-weight: 500; }

/* mobile: preview sits under the header */
@media (max-width: 999px) {
  .app { padding-top: 0; }
  .preview { order: 2; }
  .panel { display: contents; }
  .top { order: 1; }
  #sec-special { order: 3; } #sec-banner { order: 4; } #sec-prices { order: 5; } #sec-soldout { order: 6; } #sec-weather { order: 7; }
  .link-btn { order: 8; } .spacer { order: 9; }
}

/* desktop: side-by-side */
@media (min-width: 1000px) {
  .app { max-width: 1320px; flex-direction: row-reverse; align-items: flex-start; gap: 28px; padding: 0 28px; }
  .panel { flex: 0 0 520px; padding-top: 20px; }
  .top { margin: 0; border-radius: var(--sd-radius-m); border: 1px solid var(--sd-gold-light); }
  .preview { position: sticky; top: 20px; margin-top: 20px; flex: 1; padding: 18px; }
  .pushbar { left: max(28px, calc(50% - 632px)); right: auto; width: 520px; border-radius: 18px 18px 0 0; border: 1px solid var(--sd-gold-light); border-bottom: 0; }
}

/* v3: preview mode, language, reset */
.pv-seg { margin: 0 0 8px; background: rgba(255,255,255,.06); }
.pv-seg { grid-template-columns: 1fr 1fr; }
.pv-seg button { color: var(--sd-text-dark); }
.pv-seg button[aria-checked="true"] { background: var(--sd-pink); color: #0E0B0C; }
.pv-label { font-size: 13px; margin: 0 0 10px; color: var(--sd-gold-light); }
.pv-label.draft { color: var(--sd-pink); }
#langSeg button { font-size: 13px; }
.reset-btn { margin-top: 12px; width: 100%; min-height: 50px; border-radius: 999px; border: 1px solid var(--sd-pink-deep); background: #fff; color: var(--sd-pink-deep); font-weight: 600; font-size: 15px; cursor: pointer; }
.reset-btn:active { transform: scale(.98); }
.reset-btn.armed { background: var(--sd-pink-deep); color: #fff; }
@media (max-width: 999px) {
  #sec-lang { order: 8; } #sec-reset { order: 9; } .spacer { order: 10; }
}

/* celular: campo de precio más alto para el dedo */
@media (pointer: coarse), (max-width: 760px) { .stepper input { height: 40px; } }

/* conexión con la TV de la tienda */
.conn { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; padding: 8px 12px; border-radius: 14px; background: #fff; border: 1px solid #F4E3E5; font-size: 13.5px; color: #4a2c2a; }
.conn .cdot { width: 9px; height: 9px; border-radius: 50%; background: #c9c0c1; flex: none; }
.conn.ok .cdot { background: #2fa84f; box-shadow: 0 0 0 4px rgba(47,168,79,.15); }
.conn.warn .cdot { background: #e6a23c; box-shadow: 0 0 0 4px rgba(230,162,60,.18); }
.conn.demo .cdot { background: var(--sd-pink); }
.conn-out { margin-left: auto; border: 1px solid #F4E3E5; background: transparent; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; min-height: 32px; }

/* pantalla de PIN */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(14,11,12,.72); backdrop-filter: blur(6px); }
.gate[hidden] { display: none; }
.gate-card { width: min(360px, 100%); background: #fff; border-radius: 24px; padding: 26px 22px 20px; display: grid; gap: 12px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.gate-card img { width: 86px; height: 86px; margin: 0 auto; }
.gate-card h2 { margin: 0; }
.gate-card .pin { text-align: center; font-size: 22px; letter-spacing: .3em; }
.gate-card .push { width: 100%; }
.gate-err { margin: 0; min-height: 1.2em; color: var(--sd-pink-deep); font-size: 13.5px; }
