/* Loja online Maricota Kids — mesma identidade do sistema (arco-íris + água) */
:root {
  --bg: #f4fbfa; --surface: #fff; --surface-2: #f6fbfb; --ink: #2d3142; --muted: #6b7185; --line: #e3eceb;
  --teal: #2aa6bd; --teal-dark: #1a8296; --pink: #e6457a; --orange: #f2913a; --yellow: #f5c53f; --green: #7fbf3f; --purple: #9a5bc4; --red: #d9434e;
  --rainbow: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow), var(--green), var(--teal), var(--purple));
  --shadow: 0 2px 12px rgba(42, 166, 189, .10), 0 1px 2px rgba(0, 0, 0, .04);
  font-family: 'Nunito', system-ui, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 15px; line-height: 1.45; min-height: 100vh; display: flex; flex-direction: column; }
body.lock { overflow: hidden; }
h1, h2, h3 { font-family: 'Baloo 2', 'Nunito', sans-serif; margin: 0; line-height: 1.15; }
a { color: var(--teal-dark); }
.small { font-size: 13px; } .muted { color: var(--muted); } .center { text-align: center; } .mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .5px; }
.warn { color: var(--red); font-weight: 700; } .hint { color: var(--teal-dark); font-weight: 700; }

/* Topo */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); box-shadow: var(--shadow); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 12px; align-items: center; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: 'Baloo 2'; font-weight: 800; font-size: 20px; flex: none; }
.brand img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.search { flex: 1; min-width: 0; }
.search input { width: 100%; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 16px; font: inherit; background: var(--surface-2); }
.search input:focus { outline: none; border-color: var(--teal); background: #fff; }
.bag-btn { position: relative; flex: none; border: 0; background: var(--pink); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 21px; cursor: pointer; }
.bag-btn span { position: absolute; top: -4px; right: -4px; background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }
.bag-btn span[hidden] { display: none; }
.rainbow { height: 4px; background: var(--rainbow); }
@media (max-width: 600px) { .brand span { display: none; } }

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px; }
.hero { text-align: center; padding: 18px 8px 6px; }
.hero h1 { font-size: clamp(24px, 5vw, 34px); color: var(--teal-dark); }
.hero p { margin: 6px auto 0; color: var(--muted); max-width: 620px; }

/* Filtros */
.filters { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 6px; }
.frow { display: flex; flex-wrap: wrap; gap: 8px; }
.frow.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--teal); }
.chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.selects { gap: 10px; }
.selects label { display: flex; flex-direction: column; font-size: 12px; font-weight: 800; color: var(--muted); gap: 2px; flex: 1 1 140px; max-width: 220px; }
.selects select { font: inherit; font-size: 14px; color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; }
.count { font-size: 13px; color: var(--muted); font-weight: 700; margin: 6px 2px 10px; }

/* Grade de peças */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.card { background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card:focus-visible { outline: 3px solid var(--teal); }
.ph { aspect-ratio: 4 / 5; background: var(--surface-2); display: grid; place-items: center; font-size: 46px; overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.nm { font-weight: 700; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pr { font-family: 'Baloo 2'; font-weight: 800; font-size: 19px; color: var(--pink); }
.tm { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { text-align: center; padding: 10px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 800; padding: 10px 18px; border-radius: 14px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); }
.btn.big { width: 100%; padding: 14px; font-size: 16px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: default; }

/* Detalhe da peça */
.modal-bg { position: fixed; inset: 0; background: rgba(30, 40, 50, .5); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-bg[hidden] { display: none; }
.modal { position: relative; background: #fff; border-radius: 20px; max-width: 880px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; }
.x { position: absolute; top: 10px; right: 10px; z-index: 2; border: 0; background: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 17px; cursor: pointer; box-shadow: var(--shadow); }
.pd { display: grid; grid-template-columns: 1.1fr 1fr; }
.pd-ph { background: var(--surface-2); }
.pd-main { aspect-ratio: 4 / 5; display: grid; place-items: center; font-size: 70px; }
.pd-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
.pd-thumbs button { flex: none; width: 56px; height: 70px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #fff; }
.pd-thumbs button.on { border-color: var(--teal); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { padding: 26px 22px 20px; display: flex; flex-direction: column; gap: 10px; }
.pd-info h2 { font-size: 24px; padding-right: 30px; }
.pd-price { font-family: 'Baloo 2'; font-weight: 800; font-size: 30px; color: var(--pink); }
.lbl { font-weight: 800; font-size: 14px; margin-top: 4px; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.size { min-width: 52px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-weight: 800; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.size small { font-size: 10px; color: var(--pink); }
.size:hover { border-color: var(--teal); }
.size.on { border-color: var(--teal); background: var(--teal); color: #fff; }
.size.on small { color: #fff; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (max-width: 720px) {
  .modal-bg { padding: 0; place-items: end center; }
  .modal { border-radius: 20px 20px 0 0; max-height: 94vh; }
  .pd { grid-template-columns: 1fr; }
  .pd-main { aspect-ratio: 1 / 1; }
}

/* Sacola */
.drawer-bg { position: fixed; inset: 0; background: rgba(30, 40, 50, .45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: #fff; z-index: 41; display: flex; flex-direction: column; overflow-y: auto; box-shadow: -4px 0 20px rgba(0, 0, 0, .12); }
.drawer[hidden], .drawer-bg[hidden] { display: none; }
.dh { position: sticky; top: 0; background: #fff; display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1.5px solid var(--line); z-index: 2; }
.dh h2 { flex: 1; font-size: 21px; }
.dh .x { position: static; box-shadow: none; background: var(--surface-2); }
.bag-list { padding: 8px 16px; display: flex; flex-direction: column; }
.bag-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bi-ph { width: 64px; height: 80px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 28px; }
.bi-ph img { width: 100%; height: 100%; object-fit: cover; }
.bi-info { flex: 1; min-width: 0; }
.bi-tot { font-weight: 800; white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty button { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: 17px; font-weight: 800; cursor: pointer; }
.qty span { min-width: 18px; text-align: center; font-weight: 800; }
.qty .rm { width: auto; border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; border-radius: 0; }
.bag-sum { padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.line { display: flex; justify-content: space-between; gap: 10px; }
.line.total { font-size: 18px; border-top: 1.5px dashed var(--line); padding-top: 8px; }
.line.total b { color: var(--pink); font-family: 'Baloo 2'; font-size: 22px; }

/* Checkout */
.ck { padding: 4px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.ck h3 { font-size: 17px; margin-top: 8px; color: var(--teal-dark); }
.fl { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 800; color: var(--muted); }
.fl input, .fl textarea { font: inherit; font-size: 16px; color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.fl input:focus, .fl textarea:focus { outline: none; border-color: var(--teal); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.addr { display: flex; flex-direction: column; gap: 10px; }
.addr[hidden] { display: none; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--teal); background: #f0fafb; }
.opt input { margin-top: 3px; accent-color: var(--teal); }
.opt small { display: block; color: var(--muted); font-size: 12px; }
.ck .bag-sum { padding: 10px 0 20px; }

/* Pedido */
.order { max-width: 560px; margin: 10px auto; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.order .ico { font-size: 56px; }
.order h1 { font-size: 30px; color: var(--teal-dark); }
.order p { margin: 0; color: var(--muted); }
.order-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 8px; }

/* Diversos */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 46px; }
.empty .btn { margin-top: 12px; }
.loading { display: grid; place-items: center; padding: 80px; }
.spin { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.spin.sm { width: 16px; height: 16px; border-width: 3px; border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 60; font-weight: 700; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.toast[hidden] { display: none; }
.foot { background: #fff; border-top: 4px solid transparent; border-image: var(--rainbow) 1; margin-top: 30px; }
.foot-in { max-width: 1180px; margin: 0 auto; padding: 20px 16px; display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: center; justify-content: space-between; }
.foot .links { display: flex; gap: 16px; }
.foot a { font-weight: 800; text-decoration: none; }

/* Frete pelo CEP */
.cep-row { display: flex; gap: 8px; }
.cep-row input { flex: 1; min-width: 0; }
.cep-row .btn { padding: 8px 14px; }
.frete-msg { padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.frete-msg.ok { background: #eaf6dd; color: #3f7414; }
.frete-msg.warn { background: #fbe1e3; }
#endBox { display: flex; flex-direction: column; gap: 10px; }
#endBox[hidden] { display: none; }
.fl input[readonly] { background: var(--surface-2); color: var(--muted); }
.spin.xs { width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }

.two > * { min-width: 0; }
.fl input, .fl textarea { width: 100%; min-width: 0; }
.drawer { overflow-x: hidden; }

.qty button:disabled { opacity: .35; cursor: not-allowed; }
.foot-bottom { max-width: 1180px; margin: 0 auto; padding: 10px 16px 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.foot-bottom a { color: var(--teal-dark); font-weight: 800; text-decoration: none; }
.foot-bottom a:hover { text-decoration: underline; }
.foot-bottom .lojista { color: var(--muted); }
