:root {
  --shopee: #ee4d2d;
  --shopee-dark: #d73211;
  --shopee-light: #ffeeed;
  --text: rgba(0, 0, 0, 0.87);
  --muted: rgba(0, 0, 0, 0.54);
  --line: rgba(0, 0, 0, 0.09);
  --bg: #f5f5f5;
  --header: linear-gradient(-180deg, #f53d2d, #f63);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

.shopee-container { width: 1200px; max-width: calc(100% - 24px); margin: 0 auto; }

/* ---------- header ---------- */
.shopee-header { background: var(--header); color: #fff; }
.shopee-header__top { display: flex; align-items: center; gap: 12px; height: 32px; font-size: 13px; }
.shopee-header__top nav { display: flex; gap: 14px; margin-left: auto; align-items: center; }
.shopee-header__top a { color: #fff; opacity: .92; }
.shopee-header__top a:hover { opacity: 1; text-decoration: underline; }
.shopee-header__main { display: flex; align-items: center; gap: 34px; padding: 16px 0 14px; }
.shopee-logo { display: flex; align-items: center; gap: 8px; color: #fff; flex: none; }
.shopee-logo__img { height: 48px; width: auto; display: block; }
.shopee-search { flex: 1; display: flex; background: #fff; border-radius: 3px; padding: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.shopee-search input { flex: 1; border: 0; outline: 0; padding: 8px 12px; font-size: 14px; border-radius: 3px; }
.shopee-search button { border: 0; background: var(--shopee); color: #fff; padding: 0 22px; border-radius: 3px; cursor: pointer; display: grid; place-items: center; }
.shopee-cart { position: relative; color: #fff; padding: 4px 6px; display: grid; place-items: center; }
.shopee-cart__count { position: absolute; top: -4px; right: -6px; background: #fff; color: var(--shopee); border-radius: 10px; font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center; font-weight: 700; }

/* ---------- breadcrumb ---------- */
.breadcrumb { padding: 16px 0 6px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--shopee); }

/* ---------- product layout ---------- */
.pdp { display: grid; grid-template-columns: 40% 1fr; gap: 22px; background: #fff; padding: 18px; border-radius: 3px; }
.pdp__gallery { position: relative; }
.pdp__main-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #fafafa; border-radius: 3px; border: 1px solid var(--line); }
.pdp__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pdp__thumbs::-webkit-scrollbar { display: none; }
.pdp__thumb { width: 68px; height: 68px; flex: none; object-fit: cover; display: block; border: 2px solid transparent; border-radius: 3px; background: #fafafa; cursor: pointer; }
.pdp__thumb.is-active { border-color: var(--shopee); }
.pdp__badge { position: absolute; top: 8px; left: 8px; background: var(--shopee); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 2px; }

.pdp__title { font-size: 20px; font-weight: 600; line-height: 1.3; margin: 0 0 6px; }
.pdp__meta { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.pdp__rating { color: var(--shopee); font-weight: 600; border-bottom: 1px solid var(--shopee); }
.pdp__rating-star { color: #ffc107; }
.pdp__sold { color: var(--text); }

.pdp__price { background: #fafafa; padding: 12px 14px; margin: 12px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pdp__price-old { text-decoration: line-through; color: var(--muted); font-size: 14px; }
.pdp__price-now { font-size: 30px; color: var(--shopee); font-weight: 500; }
.pdp__price-off { background: var(--shopee); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 5px; border-radius: 2px; text-transform: uppercase; }

.pdp__row { display: flex; gap: 12px; padding: 8px 0; align-items: flex-start; font-size: 14px; }
.pdp__row-label { width: 110px; color: var(--muted); flex: none; padding-top: 4px; }
.pdp__options { display: flex; flex-wrap: wrap; gap: 8px; }
.pdp__opt { border: 1px solid var(--line); background: #fff; padding: 6px 14px; border-radius: 2px; cursor: pointer; min-width: 60px; text-align: center; }
.pdp__opt.is-active { border-color: var(--shopee); color: var(--shopee); }
.pdp__opt:hover { border-color: var(--shopee); }

.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: #fff; cursor: pointer; color: var(--muted); font-size: 16px; }
.qty input { width: 50px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; outline: 0; }
.pdp__stock { font-size: 13px; color: var(--muted); margin-left: 8px; align-self: center; }

.pdp__actions { display: flex; gap: 12px; margin: 18px 0 6px; }
.btn { border-radius: 2px; padding: 12px 26px; font-size: 15px; cursor: pointer; border: 1px solid transparent; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn--primary { background: var(--shopee); color: #fff; }
.btn--primary:hover { background: var(--shopee-dark); }
.btn--outline { background: var(--shopee-light); color: var(--shopee); border-color: var(--shopee); }
.btn--outline:hover { background: #ffe6e3; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.pdp__shop { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: #fff; border-radius: 3px; margin-top: 14px; }
.pdp__shop-avatar { width: 54px; height: 54px; border-radius: 50%; background: #eee; flex: none; overflow: hidden; border: 1px solid var(--line); }
.pdp__shop-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp__shop-main { min-width: 0; }
.pdp__shop-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pdp__shop-badge { background: var(--shopee); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 2px; text-transform: uppercase; letter-spacing: .2px; display: inline-flex; align-items: center; gap: 3px; line-height: 1.5; }
.pdp__shop-badge svg { flex: none; }
.pdp__shop-meta { font-size: 13px; color: var(--muted); margin-top: 1px; }
.pdp__shop-rep { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.pdp__shop-stars { color: #ffc107; letter-spacing: 1px; }
.pdp__shop-score { color: var(--shopee); font-weight: 700; }
.pdp__shop-rep-sep { color: var(--line); }
.pdp__shop-actions { margin-left: auto; display: flex; gap: 8px; }

/* reputação da loja */
.shop-rep { display: flex; gap: 24px; align-items: stretch; flex-wrap: wrap; }
.shop-rep__score { text-align: center; padding: 6px 20px 6px 0; border-right: 1px solid var(--line); min-width: 132px; }
.shop-rep__score strong { font-size: 34px; color: var(--shopee); line-height: 1; font-weight: 600; }
.shop-rep__score span { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.shop-rep__stars { color: #ffc107; letter-spacing: 2px; font-size: 14px; margin-top: 4px; }
.shop-rep__label { font-size: 11.5px; color: var(--muted); margin: 4px 0 0; }
.shop-rep__grid { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 8px 22px; flex: 1; align-content: center; }
.shop-rep__cell { display: flex; flex-direction: column; gap: 1px; }
.shop-rep__k { font-size: 12px; color: var(--muted); }
.shop-rep__v { font-size: 14px; font-weight: 600; }

.card { background: #fff; border-radius: 3px; padding: 16px 18px; margin-top: 14px; }
.card__title { font-size: 16px; font-weight: 700; margin: 0 0 12px; text-transform: uppercase; color: var(--text); }
.desc { font-size: 14px; line-height: 1.7; color: rgba(0,0,0,.8); white-space: pre-wrap; word-break: break-word; }
.desc img { margin: 8px 0; border-radius: 3px; }

.specs { display: grid; grid-template-columns: 160px 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.specs div { background: #fff; padding: 9px 12px; font-size: 14px; }
.specs div:nth-child(odd) { background: #fafafa; color: var(--muted); }

/* ---------- sticky mobile bar ---------- */
.mobile-bar { display: none; }

/* ---------- checkout ---------- */
.checkout-head { background: var(--header); color: #fff; }
.checkout-head__inner { display: flex; align-items: center; gap: 14px; height: 84px; }
.checkout-head__title { font-size: 18px; font-weight: 600; border-left: 1px solid rgba(255,255,255,.4); padding-left: 14px; }
.checkout-body { padding: 20px 0 60px; }
.checkout-card { background: #fff; border-radius: 5px; padding: 20px; margin-bottom: 14px; }
.checkout-card__title { font-size: 16px; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.checkout-step { color: var(--shopee); font-weight: 700; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.field-grid .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 3px; padding: 9px 11px; outline: 0; background: #fff; }
.field input:focus, .field select:focus { border-color: var(--shopee); }
.field .hint { font-size: 12px; color: var(--muted); }
.field.is-invalid input { border-color: #e53935; }

.pay-methods { display: grid; gap: 8px; }
.pay-option { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; cursor: pointer; }
.pay-option.is-active { border-color: var(--shopee); background: #fff8f7; }
.pay-option__icon { width: 38px; height: 26px; border-radius: 3px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.pay-option__icon--pix { background: #32bcad; }
.pay-option__icon--card { background: #2c3e50; }
.pay-option__name { font-weight: 600; }
.pay-option__desc { font-size: 12px; color: var(--muted); }
.pay-option input { margin-left: auto; accent-color: var(--shopee); }

.summary { position: sticky; top: 16px; }
.summary__row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.summary__row--total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 16px; }
.summary__total { color: var(--shopee); font-size: 22px; font-weight: 600; }
.summary__item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.summary__item img { width: 56px; height: 56px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
.summary__item-title { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }

/* ---------- pix / result ---------- */
.pix-box { text-align: center; padding: 10px 0 4px; }
.pix-qr { width: 260px; height: 260px; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: #fff; }
.pix-code { display: flex; gap: 8px; margin-top: 6px; }
.pix-code input { flex: 1; border: 1px solid var(--line); border-radius: 3px; padding: 9px 11px; font-family: ui-monospace, monospace; font-size: 12px; }
.pix-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; padding: 8px 14px; border-radius: 20px; background: #fff5e6; color: #b26a00; }
.pix-status.is-paid { background: #e8f7ea; color: #1b7a3d; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot--pulse { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.result { max-width: 620px; margin: 40px auto; background: #fff; border-radius: 6px; padding: 34px; text-align: center; }
.result__icon { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; font-size: 30px; color: #fff; }
.result__icon--ok { background: #26aa99; }
.result__icon--card { background: var(--shopee); }
.result__code { font-family: ui-monospace, monospace; background: #f5f5f5; padding: 8px 12px; border-radius: 3px; display: inline-block; margin: 10px 0; }

.alert { border-radius: 3px; padding: 11px 14px; font-size: 13px; margin-bottom: 14px; }
.alert--warn { background: #fff8e6; border: 1px solid #ffe08a; color: #7a5b00; }
.alert--err { background: #fdecea; border: 1px solid #f5c2c0; color: #a52924; }
.shake { animation: shake .5s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 2px; background: #f1f1f1; color: var(--muted); }

/* ---------- home ---------- */
.hero { background: var(--header); color: #fff; padding: 26px 0; }
.hero h1 { margin: 0 0 6px; font-size: 24px; }
.grid-products { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 18px 0 40px; }
.product-card { background: #fff; border-radius: 3px; overflow: hidden; border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.product-card:hover { border-color: var(--shopee); transform: translateY(-2px); }
.product-card__img { aspect-ratio: 1/1; background: #fafafa; overflow: hidden; }
.product-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card__body { padding: 9px 10px 12px; }
.product-card__title { font-size: 13px; line-height: 1.35; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-card__price { color: var(--shopee); font-size: 16px; font-weight: 600; margin-top: 8px; }
.product-card__sold { font-size: 12px; color: var(--muted); }

.footer { background: #fff; border-top: 4px solid var(--shopee); padding: 26px 0; color: var(--muted); font-size: 12px; }
.footer__cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.footer h4 { color: var(--text); font-size: 12px; text-transform: uppercase; margin: 0 0 8px; }
.footer a { display: block; padding: 2px 0; }
.footer a:hover { color: var(--shopee); }

.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #f7f7f7 37%, #f0f0f0 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- frete ---------- */
.ship-text { font-size: 13px; color: #00a326; font-weight: 500; line-height: 1.45; }
.summary__row--full { align-items: center; }
.summary__row--full .ship-text { font-size: 12.5px; text-align: right; }

/* ---------- barra fixa do checkout (mobile) ---------- */
.checkout-bar { display: none; }

@media (max-width: 1100px) {
  .pdp { grid-template-columns: 1fr; }
  .grid-products { grid-template-columns: repeat(3, 1fr); }
  .checkout-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .shopee-header__main { gap: 14px; }
  .shopee-logo__img { height: 38px; }
}

/* ---------- mobile: layout igual ao app da Shopee ---------- */
@media (max-width: 768px) {
  .grid-products { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .footer__cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body { padding-bottom: 0; -webkit-tap-highlight-color: transparent; }
  body.page-pdp { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  body.page-checkout { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }

  /* header compacto e fixo */
  .shopee-header { position: sticky; top: 0; z-index: 40; }
  .shopee-header__top { display: none; }
  .shopee-header__main { gap: 8px; padding: 8px 0; }
  .shopee-container { max-width: calc(100% - 16px); }
  .shopee-logo__img { height: 30px; }
  .shopee-search { padding: 2px; }
  .shopee-search input { padding: 9px 9px; font-size: 16px; min-height: 38px; }
  .shopee-search button { padding: 0 13px; }
  .shopee-cart { padding: 2px; }
  .shopee-cart img { width: 22px; height: 22px; }

  /* página de produto */
  .breadcrumb { padding: 8px 0 4px; font-size: 12px; }
  .pdp { padding: 0; border-radius: 0; gap: 0; }
  .pdp__gallery { padding: 0; }
  .pdp__main-img { border: 0; border-radius: 0; }
  .pdp__badge { top: 10px; left: 10px; font-size: 12px; }
  .pdp__thumbs { padding: 8px 10px 6px; gap: 6px; }
  .pdp__thumb { width: 54px; height: 54px; }
  .pdp__info { padding: 10px 12px 14px; }
  .pdp__title { font-size: 15px; line-height: 1.35; }
  .pdp__meta { font-size: 12px; gap: 10px; padding: 6px 0 8px; flex-wrap: wrap; }
  .pdp__price { padding: 10px 12px; margin: 8px 0 4px; }
  .pdp__price-now { font-size: 24px; }
  .pdp__price-old { font-size: 13px; }
  .pdp__row { gap: 10px; padding: 7px 0; font-size: 13px; }
  .pdp__row-label { width: 74px; font-size: 13px; }
  .ship-text { font-size: 12.5px; }
  .pdp__opt { padding: 7px 12px; font-size: 13px; min-width: 48px; }
  .qty button { width: 34px; height: 34px; }
  .qty input { width: 44px; font-size: 16px; }
  .pdp__actions { display: none; }
  .pdp__shop { margin-top: 8px; padding: 12px; gap: 10px; }
  .pdp__shop-avatar { width: 42px; height: 42px; }
  .pdp__shop-name { font-size: 14px; }
  .pdp__shop-meta { font-size: 12px; }
  .pdp__shop-rep { font-size: 11.5px; gap: 5px; }
  .pdp__shop-actions .btn { padding: 7px 10px; font-size: 12px; }
  .shop-rep { flex-direction: column; gap: 12px; }
  .shop-rep__score { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; text-align: left; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .shop-rep__score strong { font-size: 26px; }
  .shop-rep__score span { display: inline; margin: 0; }
  .shop-rep__stars { margin: 0; }
  .shop-rep__label { width: 100%; margin: 0; }
  .shop-rep__grid { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .card { padding: 14px 12px; margin-top: 8px; border-radius: 0; }
  .card__title { font-size: 14px; }
  .specs { grid-template-columns: 40% 1fr; }
  .specs div { padding: 8px 10px; font-size: 13px; }
  .desc { font-size: 13.5px; }

  /* barra fixa de compra */
  .mobile-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff;
    border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    gap: 8px; z-index: 45; box-shadow: 0 -1px 6px rgba(0,0,0,.06);
  }
  .mobile-bar .btn { flex: 1; padding: 13px 8px; font-size: 14px; border-radius: 3px; min-height: 46px; }

  /* home */
  .hero { padding: 16px 0; }
  .hero h1 { font-size: 18px; }
  .hero p { font-size: 12.5px; }
  .grid-products { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px 0 18px; }
  .product-card { border-radius: 3px; }
  .product-card__body { padding: 8px 8px 10px; }
  .product-card__title { font-size: 12px; height: 32px; }
  .product-card__price { font-size: 15px; margin-top: 6px; }
  .product-card__sold { font-size: 11px; }
  .footer { padding: 18px 0; }
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 14px; }

  /* checkout */
  .checkout-head__inner { height: 56px; gap: 10px; }
  .checkout-head__title { font-size: 15px; padding-left: 10px; }
  .checkout-head__inner > span:last-child { display: none; }
  .checkout-body { padding: 10px 0 24px; }
  .checkout-card { padding: 14px; border-radius: 6px; margin-bottom: 10px; }
  .checkout-card__title { font-size: 15px; margin-bottom: 12px; }
  .field-grid { grid-template-columns: 1fr; gap: 10px; }
  .field input, .field select, .field textarea { padding: 11px; font-size: 16px; }
  .pay-option { padding: 11px; gap: 10px; }
  .pay-option__desc { font-size: 11.5px; }
  .checkout-layout { gap: 10px; }
  .summary { display: none; }
  .checkout-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; align-items: center; gap: 10px;
    background: #fff; border-top: 1px solid var(--line); padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    z-index: 45; box-shadow: 0 -1px 6px rgba(0,0,0,.06);
  }
  .checkout-bar__total { display: grid; }
  .checkout-bar__total span { font-size: 11px; color: var(--muted); }
  .checkout-bar__total strong { font-size: 18px; color: var(--shopee); }
  .checkout-bar .btn { flex: 1; padding: 12px; }

  /* pagamento / resultado */
  .pix-qr { width: 220px; height: 220px; }
  .pix-code { flex-direction: column; }
  .pix-code .btn { width: 100%; }
  .result { margin: 14px 8px; padding: 22px 16px; }
  .result__code { font-size: 13px; }
}

@media (max-width: 380px) {
  .grid-products { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .shopee-logo__img { height: 26px; }
  .pdp__row-label { width: 66px; }
  .ship-text { font-size: 12px; }
}
