:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-soft: #f0f9ff;
  --success: #16a34a;
  --danger: #dc2626;
  --header-bg: #ffffff;
  --header-border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-sm: 5px;
}

[data-theme="dark"] {
  --bg: #111111;
  --surface: #1e1e1e;
  --surface-2: #252525;
  --border: #383838;
  --text: #e8e8e8;
  --text-muted: #888888;
  --primary: #38bdf8;
  --primary-dark: #7dd3fc;
  --primary-soft: rgba(14,165,233,0.12);
  --success: #22c55e;
  --danger: #f87171;
  --header-bg: #111111;
  --header-border: #282828;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Header ---------- */
.header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
[data-theme="dark"] .header {
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.header-inner {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 24px; max-width: 1200px; margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.5rem; flex-shrink: 0; align-self: center; }
.brand img { display: block; }
.brand:hover { text-decoration: none; }
.brand-text { color: var(--primary); letter-spacing: -0.04em; }
.brand img { height: 36px; width: auto; }

.search { flex: 1; display: flex; align-items: center; position: relative; }
.search input {
  flex: 1; width: 100%; padding: 11px 20px 11px 46px;
  border: 2px solid var(--border); border-radius: 28px;
  background: var(--surface-2); color: var(--text);
  outline: none; font-size: 0.94rem; transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px rgba(14,165,233,0.15); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}
[data-theme="dark"] .search input {
  background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12); color: var(--text);
}
[data-theme="dark"] .search input::placeholder { color: rgba(255,255,255,0.35); }
[data-theme="dark"] .search input:focus { border-color: var(--primary); background: rgba(255,255,255,0.1); }
[data-theme="dark"] .search-icon { color: rgba(255,255,255,0.4); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------- Botões base ---------- */
.icon-btn {
  background: transparent; border: none; color: var(--text-muted);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s;
}
.icon-btn:hover { background: transparent; color: var(--primary-dark); }
.alert-bell-btn { position: relative; }
.bell-badge {
  position: absolute; top: 3px; right: 3px;
  width: 10px; height: 10px;
  background: var(--primary); border-radius: 50%;
  border: 2px solid var(--header-bg);
  pointer-events: none;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  height: 38px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 0.88rem; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); text-decoration: none; }
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(14,165,233,0.4);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-disabled { background: var(--text-muted) !important; border-color: var(--text-muted) !important; color: #fff !important; box-shadow: none !important; opacity: .6; pointer-events: none; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); box-shadow: 0 2px 8px rgba(220,38,38,.35); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-block { width: 100%; justify-content: center; border-radius: 8px; }
.btn-post { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; font-weight: 700; padding: 0 18px; border-radius: 6px; box-shadow: 0 2px 8px rgba(14,165,233,0.35); }
.btn-post:hover { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; color: #fff !important; }
.post-icon { color: #fff; font-size: 1.1rem; font-weight: 700; }

.btn-google { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

[data-theme="dark"] .header .icon-btn { color: rgba(255,255,255,0.65); }
[data-theme="dark"] .header .icon-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
[data-theme="dark"] .header .btn:not(.btn-post):not(.btn-primary) {
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.14);
}
[data-theme="dark"] .header .btn:not(.btn-post):not(.btn-primary):hover {
  border-color: var(--primary); color: var(--primary); background: rgba(14,165,233,0.1);
}

.avatar { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; }

.avatar-btn {
  list-style: none; cursor: pointer; padding: 0; border: none; background: none;
  display: flex; align-items: center;
}
.avatar-btn::-webkit-details-marker { display: none; }
.avatar-lg {
  width: 38px; height: 38px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border); transition: border-color .15s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar-btn:hover .avatar-lg,
details[open] .avatar-btn .avatar-lg { border-color: var(--primary); }
.avatar-initials {
  background: var(--primary); color: #fff;
  font-weight: 700; font-size: 0.9rem; border-radius: 6px;
}
.profile-menu { min-width: 220px; padding: 6px; }
.profile-menu-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 8px;
}
.profile-menu-name { font-weight: 700; font-size: 0.9rem; line-height: 1.2; }
.profile-menu-email { font-size: 0.78rem; color: var(--text-muted); }
.profile-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.profile-menu a { grid-column: 1 / -1; gap: 9px; color: var(--text-muted); }
.profile-menu a:hover { color: var(--text); }
.profile-menu-sair:hover { color: var(--danger) !important; }

/* ---------- Subnav ---------- */
.subnav { background: var(--header-bg); border-bottom: 1px solid var(--header-border); }
.subnav-inner { display: flex; align-items: center; gap: 2px; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.navlink {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px;
  font-weight: 600; font-size: 0.88rem; color: var(--text-muted);
  border-bottom: 2px solid transparent; cursor: pointer; transition: color .15s; white-space: nowrap;
}
.navlink:hover { color: var(--text); text-decoration: none; }
.navlink.active { color: var(--primary); border-bottom-color: var(--primary); }
[data-theme="dark"] .navlink { color: rgba(255,255,255,0.7); }
[data-theme="dark"] .navlink:hover { color: #ffffff; }

/* dropdowns */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown[open] > summary { color: var(--primary); }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: -20px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px; min-width: 300px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.dropdown-menu a {
  padding: 7px 10px; border-radius: 6px; color: var(--text); font-size: 0.88rem;
  display: flex; align-items: center; gap: 9px; line-height: 1;
}
.dropdown-menu a:hover { background: var(--surface-2); text-decoration: none; color: var(--primary-dark); }


/* ---------- Feed header + segmented control ---------- */
.feed-head {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-orient: horizontal; -webkit-box-direction: normal;
  -ms-flex-direction: row; flex-direction: row;
  -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: 12px; margin: 20px auto 16px; max-width: 900px; width: 100%;
}
.feed-head h1 { margin: 0; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; }
.seg {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -ms-flex-negative: 0; flex-shrink: 0;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 6px; padding: 3px; gap: 2px;
}
.seg a {
  padding: 6px 16px; border-radius: 4px; font-size: 0.86rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
}
.seg a:hover { color: var(--text); }
.seg a.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .seg a { color: rgba(255,255,255,0.75); }
[data-theme="dark"] .seg a:hover { color: #fff; }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--primary); color: #fff; border-radius: 9px;
  font-size: 0.72rem; font-weight: 700; margin-left: 5px;
}
.seg a.active .tab-badge { background: rgba(255,255,255,0.35); color: #fff; }

/* ---------- Feed de ofertas ---------- */
.grid { display: flex; flex-direction: column; gap: 8px; padding-bottom: 50px; max-width: 900px; margin: 0 auto; }

.deal-row {
  display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s; cursor: pointer; position: relative;
}
.card-wa-btn {
  display: none; position: absolute; top: 8px; right: 8px; z-index: 1;
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: #25d366;
  align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0;
}
.card-wa-btn:hover { border-color: var(--primary); color: #25d366; }
.deal-row:hover { box-shadow: var(--shadow); border-color: var(--primary); }

.deal-thumb {
  position: relative; flex: 0 0 140px; width: 140px; height: 140px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; padding: 8px;
}
.deal-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.deal-thumb .placeholder { font-size: 2.4rem; opacity: .3; }

.deal-content { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 0; }
.deal-info { display: flex; flex-direction: column; gap: 6px; }
.deal-info .card-title { margin-bottom: 4px; }
.deal-info .price-row { margin-top: 6px; }
.deal-foot { padding-top: 12px; margin-top: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.deal-time { margin-left: auto; }

/* ---------- Cards genéricos ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s;
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary); }

.card-img { position: relative; aspect-ratio: 16/11; background: var(--surface-2); display: flex; align-items: center; justify-content: center; padding: 10px; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card-img .placeholder { font-size: 2.4rem; opacity: .3; }

.badge {
  position: absolute; top: 8px; left: 8px; background: var(--success); color: #fff;
  font-size: 0.72rem; font-weight: 800; padding: 3px 8px; border-radius: 4px;
}
.badge-coupon { background: var(--primary); }
.badge-expired { background: var(--text-muted); }

.card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-cat { font-size: 0.74rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.card-author-avatar { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; vertical-align: middle; margin-right: 2px; }
.card-title { font-weight: 700; font-size: 0.97rem; margin: 0; line-height: 1.35; }
.card-title a { color: var(--text); pointer-events: none; }
.card-title a:hover { color: var(--text); }

.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font-size: 1.1rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.price-old { text-decoration: line-through; color: var(--text-muted); font-size: 0.85rem; }
.price-sep { color: var(--border); font-size: 0.85rem; margin: 0 4px; }
.foot-sep { color: var(--border); font-size: 0.85rem; }
.store { font-size: 0.88rem; color: var(--text-muted); }
.store strong { color: var(--text); font-weight: 700; }
.store-link { color: inherit; text-decoration: none; }
.store-link:hover strong { color: var(--primary); }

.coupon-box {
  display: flex; align-items: center; gap: 8px; background: var(--primary-soft);
  border: 1px dashed var(--primary); border-radius: var(--radius-sm); padding: 8px 11px;
}
.coupon-code { font-family: "SF Mono", ui-monospace, monospace; font-weight: 800; letter-spacing: 1px; color: var(--primary-dark); flex: 1; }
.coupon-box--disabled { background: var(--surface-2); border-color: var(--text-muted); opacity: .6; pointer-events: none; }
.coupon-box--disabled .coupon-code { color: var(--text-muted); }

.card-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; }

/* like (temperatura) */
.like-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; height: 28px;
  background: transparent; border: none; border-radius: 0;
  color: var(--text-muted); cursor: pointer; font-size: 0.88rem; font-weight: 600; transition: all .15s;
}
.like-btn .like-icon { transition: all .15s; flex-shrink: 0; }
.like-btn:not([disabled]):hover { background: var(--primary-soft); color: var(--primary); }
.like-btn:not([disabled]):hover .like-icon { stroke: var(--primary); }
.like-btn[disabled] { pointer-events: none; }
.like-btn--disabled { color: var(--text-muted) !important; opacity: .6; }
.like-btn--disabled .like-icon { stroke: var(--text-muted) !important; }
.like-btn.active { color: var(--primary); }
.like-btn.active .like-icon { stroke: var(--primary); fill: var(--primary); }

/* botão deletar (admin) */
.btn-delete-deal {
  background: none; border: none; cursor: pointer; font-size: 0.95rem;
  color: var(--text-muted); padding: 0; opacity: 0.5; transition: opacity .15s, color .15s;
}
.btn-delete-deal:hover { opacity: 1; color: var(--danger); }

/* comments link */
.deal-stat-group {
  display: inline-flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden;
}
.deal-stat-meta { margin-left: auto; }
.comments-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; height: 28px;
  background: transparent; border: none; border-left: 1px solid var(--border); border-radius: 0;
  cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--text-muted); transition: all .15s;
}
.comments-link:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.deal-time, .deal-author {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; height: 28px;
  background: transparent; border: none;
  font-size: 0.82rem; color: var(--text-muted); white-space: nowrap;
}
.deal-author { border-left: 1px solid var(--border); }
.deal-author .card-author-avatar { width: 18px; height: 18px; }

.buy-btn { margin-left: auto; }
.meta { font-size: 0.86rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 3px; }

/* ---------- Forms / auth ---------- */
.page { padding: 6px 0 60px; }
.card-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.auth-wrap { max-width: 420px; margin: 36px auto; }
label { display: block; font-weight: 600; font-size: 0.86rem; margin: 14px 0 5px; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-size: 0.93rem; outline: none;
  transition: border-color .15s, background .15s; font-family: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px rgba(249,115,22,0.1); }
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 0.88rem; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
[data-theme="dark"] .alert-error { background: #2d1515; color: #fca5a5; border-color: #5b1d1d; }
.alert-pending { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
[data-theme="dark"] .alert-pending { background: #2d2006; color: #fcd34d; border-color: #78520a; }

.divider { text-align: center; color: var(--text-muted); margin: 18px 0; font-size: 0.83rem; }

.terms-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 0.84rem; color: var(--text); cursor: pointer; margin-top: 0; }
.terms-check input[type=checkbox] { flex-shrink: 0; appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--border); border-radius: 6px; background: var(--surface-2); cursor: pointer; margin-top: 1px; transition: border-color .15s, background .15s; }
.terms-check input[type=checkbox]:checked { background: var(--primary); border-color: var(--primary); background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5l3.5 3.5L11 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; background-size: 11px; }
.terms-check input[type=checkbox]:focus { box-shadow: 0 0 0 3px rgba(249,115,22,0.15); outline: none; }
.terms-check a { color: var(--text); text-decoration: underline; font-weight: 600; }

/* submit tabs */
.kind-tabs { display: inline-flex; gap: 4px; margin-bottom: 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px; }
.kind-tabs .tab { cursor: pointer; padding: 8px 16px; border-radius: 4px; font-weight: 600; font-size: 0.88rem; color: var(--text-muted); }
.kind-tabs .tab.active { background: var(--primary); color: #fff; }
.hidden { display: none !important; }
.preview-img { max-width: 120px; max-height: 120px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: 8px; }
.spinner { display:inline-block; width:13px; height:13px; border:2px solid var(--border); border-top-color: var(--primary); border-radius:50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Imagem da oferta (submit step 2) ---------- */
.deal-img-section { margin-bottom: 16px; }
.deal-img-box { width: 200px; height: 200px; border-radius: 12px; border: 2px dashed var(--border); overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.deal-img-box img { width: 100%; height: 100%; object-fit: contain; }
.deal-img-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.82rem; text-align: center; padding: 12px; }
.img-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.img-tab { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text-muted); cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all .15s; }
.img-tab.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- Modal alterar imagem ---------- */
.img-modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:9999; align-items:center; justify-content:center; padding:16px; }
.img-modal-overlay.active { display:flex; }
.img-modal-box { background:var(--surface); border-radius:16px; padding:24px; width:100%; max-width:420px; box-shadow:0 8px 40px rgba(0,0,0,0.35); }
.img-modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.img-modal-close { background:none; border:none; font-size:1.1rem; cursor:pointer; color:var(--text-muted); padding:4px 8px; border-radius:6px; }
.img-modal-close:hover { background:var(--surface-2); }
.img-modal-preview { width:100%; height:200px; border-radius:10px; border:1px solid var(--border); background:var(--surface-2); overflow:hidden; display:flex; align-items:center; justify-content:center; }
.img-modal-preview img { max-width:100%; max-height:100%; object-fit:contain; }

/* ---------- Loading overlay (enviar step 1) ---------- */
#loading-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.55); z-index:9999; align-items:center; justify-content:center; }
#loading-overlay.active { display:flex; }
.loading-card { background:var(--surface); border-radius:16px; padding:40px 52px; text-align:center; box-shadow:0 8px 32px rgba(0,0,0,0.3); }
.loading-spinner { width:48px; height:48px; border:4px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:spin .8s linear infinite; margin:0 auto 20px; }
.loading-title { font-size:1.1rem; font-weight:700; margin:0 0 6px; }

/* ---------- Página da oferta (2 colunas) ---------- */
.offer-page { max-width: 1100px; margin: 0 auto; }
.offer-layout {
  display: grid; grid-template-columns: 1fr 360px; gap: 0; align-items: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.offer-card { padding: 22px; text-align: center; }
.offer-meta { color: var(--text-muted); font-size: 0.83rem; margin-bottom: 6px; }
.offer-card h1 { font-size: 1.4rem; margin: 4px 0 14px; }
.offer-author-row { display: flex; align-items: center; gap: 7px; justify-content: center; margin-bottom: 10px; font-size: 0.85rem; color: var(--text-muted); }
.offer-author-avatar { width: 26px; height: 26px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.offer-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.offer-author-name { font-weight: 600; color: var(--text); }
.offer-photo {
  position: relative;
  background: #fff; border-radius: 6px; padding: 24px; border: 1.5px solid #d1d5db;
  display: flex; align-items: center; justify-content: center; min-height: 240px; margin-bottom: 14px;
}
.offer-photo img { max-width: 100%; max-height: 300px; object-fit: contain; }
.offer-expired-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.65); color: #fff;
  font-size: 0.82rem; font-weight: 800; letter-spacing: 0.12em;
  text-align: center; padding: 8px 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.offer-photo-actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.offer-wa-btn, .offer-report-btn {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s; text-decoration: none; flex-shrink: 0;
}
.offer-wa-btn { color: #25d366; }
.offer-report-btn { color: #38bdf8; }
.offer-wa-btn:hover { border-color: var(--primary); color: #25d366; }
.offer-report-btn:hover { border-color: #38bdf8; color: #38bdf8; }
.offer-cta {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-top: 14px; flex-wrap: wrap;
}
.offer-cta-coupon { margin: 0; padding: 0 4px 0 12px; font-size: 0.88rem; flex-shrink: 1; min-width: 0; height: 44px; }
.offer-cta-coupon .coupon-code { font-size: 0.9rem; }
.offer-cta-big { padding: 0 32px; font-size: 1rem; }
.coupon-row { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; justify-content: center; }
.coupon-row .btn { height: 44px; }
.coupon-copy-btn { background: none; border: none; cursor: pointer; color: var(--primary); padding: 0 8px; display: flex; align-items: center; border-left: 1px dashed var(--primary); margin-left: 6px; transition: color .15s; }
.coupon-copy-btn:hover { color: var(--primary-dark); }
.report-options { display: flex; flex-direction: column; gap: 10px; }
.report-opt { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.report-opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.report-opt input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.offer-desc { text-align: left; white-space: pre-line; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }

/* ---------- Panel lateral de comentários ---------- */
.comments-panel {
  padding: 16px; position: sticky; top: 80px;
  display: flex; flex-direction: column; max-height: calc(100vh - 100px);
}

/* ---------- Perfil ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; margin: 8px 0 22px; }
.profile-avatar { width: 100px; height: 100px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; max-width: 480px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.02em; }
.stat-label { color: var(--text-muted); font-weight: 600; font-size: 0.86rem; }

/* dropdowns */
.dropdown-menu--right { left: auto; right: 0; }
.dropdown-menu--list { grid-template-columns: 1fr; min-width: 180px; }

/* admin */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.table th, .table td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--border); font-size: 0.86rem; vertical-align: top; }
.table th { background: var(--surface-2); font-weight: 700; }

.admin-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin-section-title { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.admin-count { background: var(--primary); color: #fff; font-size: 0.75rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-tab { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 10px 16px; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 7px; transition: color .15s; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-tab-panel { min-height: 80px; }
.admin-reason-tag { background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 3px 10px; font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.admin-cards { display: flex; flex-direction: column; gap: 10px; }
.admin-card { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.admin-card--pending { border-left: 3px solid var(--primary); }
.admin-card-thumb { flex: 0 0 64px; width: 64px; height: 64px; background: var(--surface-2); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.admin-card-thumb img { width: 100%; height: 100%; object-fit: contain; }
.admin-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.admin-card-title { font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
.admin-card-meta { font-size: 0.82rem; color: var(--text-muted); }
.admin-aff-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.admin-aff-form input { flex: 1; min-width: 180px; }
.admin-reject-btn { border-color: var(--danger); color: var(--danger); }
.admin-reject-btn:hover { background: rgba(239,68,68,.08); }

.empty { text-align: center; color: var(--text-muted); padding: 60px 0; }
.empty p { margin: 8px 0; }

.footer { border-top: 1px solid var(--border); padding: 24px 20px; text-align: center; color: var(--text-muted); font-size: 0.83rem; margin-top: 20px; }

/* ---------- Alertas Manager ---------- */
.alerts-manager { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.alerts-manager-head { margin-bottom: 14px; }
.alerts-section-title { margin: 0 0 4px; font-size: 1.05rem; }
.alerts-add-form { display: flex; gap: 8px; margin-bottom: 16px; }
.alerts-add-form input { flex: 1; }
.alert-item { border-top: 1px solid var(--border); padding: 9px 0; }
.alert-item:first-child { border-top: none; }
.alert-view { display: flex; align-items: center; gap: 10px; }
.alert-chip { flex: 1; font-weight: 600; font-size: 0.92rem; }
.alert-btns { display: flex; gap: 6px; flex-shrink: 0; }
.alert-del-btn:hover { border-color: var(--danger) !important; color: var(--danger) !important; }
.alert-edit-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.alert-edit-row input { flex: 1; }

/* ---------- Avatar upload (editar perfil) ---------- */
.avatar-upload-row { display: flex; align-items: center; gap: 20px; }
.avatar-upload-row > div:last-child { min-width: 0; overflow: hidden; }
.avatar-upload-row input[type="file"] { max-width: 100%; }
.avatar-upload-form { display: flex; flex-direction: column; }
.avatar-upload-preview {
  width: 110px; height: 110px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary-soft); border: 2px solid var(--border);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 700; color: var(--primary-dark);
}
.avatar-upload-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Comentários ---------- */
.comments-title { margin: 0 0 20px; font-size: 1rem; font-weight: 700; flex-shrink: 0; color: var(--text); }

.comments-list { flex: 1; overflow-y: auto; min-height: 0; }
.comment { display: flex; gap: 12px; padding: 14px 0; }
.comment + .comment { border-top: 1px solid var(--border); }
.comment-op-row { display: flex; gap: 12px; padding: 0 0 14px; border-bottom: 1px solid var(--border); }
.comment-col { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; flex-wrap: wrap; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0;
  background: #e5e7eb;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: #6b7280;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-author { font-weight: 600; font-size: 0.85rem; color: var(--text); }
.comment-author-op { color: var(--primary); }
.comment-op-label { font-size: 0.75rem; color: var(--text-muted); }
.comment-body { margin: 2px 0 6px; white-space: pre-line; font-size: 0.88rem; line-height: 1.55; color: var(--text); word-break: break-word; }
.comment-actions { display: flex; gap: 14px; }
.comment-action-btn { background: none; border: none; cursor: pointer; padding: 0; font-size: 0.78rem; color: var(--text-muted); transition: color .15s; }
.comment-action-btn:hover { color: var(--primary); text-decoration: underline; }
.reply-form { margin: 8px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.reply-form textarea { min-height: 44px; width: 100%; border-radius: 6px; font-size: 0.85rem; padding: 8px 10px; resize: none; }
.reply-form .btn { align-self: flex-end; font-size: 0.82rem; height: 30px; padding: 0 12px; }
.comment-replies { margin-top: 10px; padding-left: 16px; border-left: 2px solid #e5e7eb; display: flex; flex-direction: column; }
.comment-reply { display: flex; gap: 10px; padding: 10px 0; }
.comment-reply + .comment-reply { border-top: 1px solid var(--border); }

/* Input de comentário no rodapé */
.comment-input-form {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px;
}
.comment-input-field {
  flex: 1; padding: 10px 16px; border: 1px solid var(--border); border-radius: 24px;
  background: #f9fafb; color: var(--text); font-size: 0.88rem;
  outline: none; font-family: inherit; transition: border-color .15s;
}
.comment-input-field:focus { border-color: var(--primary); background: #fff; }
.comment-input-field::placeholder { color: #9ca3af; }
.comment-send-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
.comment-send-btn:hover { background: var(--primary-dark); }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .offer-layout { grid-template-columns: 1fr; }
  .comments-panel { position: static; border-left: none; border-top: 1px solid var(--border); max-height: none; }
}
@media (max-width: 760px) {
  .row2 { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .brand img { height: 32px; width: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .dropdown-menu { grid-template-columns: 1fr; min-width: 160px; }
  .feed-head { flex-direction: column; align-items: center; }
  .feed-head h1 { width: 100%; text-align: center; }
  .feed-head .seg { flex-shrink: 0; }
  .feed-head .seg a { flex: 1; justify-content: center; }
}
@media (max-width: 560px) {
  .header-inner { padding: 8px 12px; }
  .deal-thumb { flex-basis: 90px; width: 90px; height: 90px; padding: 6px; }
  .deal-row { gap: 10px; padding: 10px; }
  .card-title { font-size: 0.94rem; }
  .price { font-size: 1.2rem; }
  .deal-stat-meta { display: none; }
  .buy-btn { margin-left: auto; }
  .card-wa-btn { display: flex; }
  .footer { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .offer-card { display: flex; flex-direction: column; }
  .offer-card h1 { order: 1; }
  .offer-photo { order: 2; }
  .offer-card .price-row { order: 3; }
  .offer-card > p.store { order: 4; margin: 4px 0 0; }
  .offer-card .alert-pending { order: 5; }
  .offer-cta { order: 6; flex-direction: column; align-items: stretch; gap: 10px; }
  .offer-cta .like-btn { order: 3; align-self: center; }
  .offer-cta .coupon-row { order: 1; }
  .offer-cta .offer-cta-big { order: 1; }
  .coupon-row { flex-direction: column; gap: 8px; }
  .offer-cta-coupon { height: 60px; padding: 0 12px; font-size: 1rem; justify-content: center; }
  .offer-cta-coupon .coupon-code { font-size: 1.3rem; letter-spacing: 2px; text-align: center; }
  .coupon-row .btn { width: 100%; height: 50px; font-size: 1rem; justify-content: center; }
  .offer-cta-big { width: 100%; height: 50px; font-size: 1rem; justify-content: center; }
  .footer a { display: inline; }
}

/* ── Cookie Banner ───────────────────────────────────── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9998;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
  padding: 16px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.cookie-banner-text { flex: 1; min-width: 220px; font-size: 0.88rem; color: var(--text-muted); }
.cookie-banner-text strong { color: var(--text); }
.cookie-banner-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.cookie-modal-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.cookie-modal-overlay.active { opacity: 1; pointer-events: all; }
.cookie-modal-box { background: var(--surface); border-radius: var(--radius); padding: 24px; max-width: 460px; width: calc(100% - 32px); box-shadow: 0 8px 32px rgba(0,0,0,0.18); display: flex; flex-direction: column; gap: 16px; }
.cookie-category { display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.cookie-category-info { flex: 1; }
.cookie-category-info strong { font-size: 0.9rem; display: block; margin-bottom: 3px; }
.cookie-category-info span { font-size: 0.82rem; color: var(--text-muted); }
.cookie-toggle { position: relative; flex-shrink: 0; margin-top: 2px; }
.cookie-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.cookie-toggle-track { display: block; width: 38px; height: 22px; background: var(--border); border-radius: 11px; cursor: pointer; transition: background .2s; }
.cookie-toggle input:checked + .cookie-toggle-track { background: var(--primary); }
.cookie-toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; }
.cookie-toggle input:checked + .cookie-toggle-track::after { transform: translateX(16px); }
.cookie-toggle input:disabled + .cookie-toggle-track { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 560px) {
  .cookie-banner { padding: 14px 16px; }
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-actions .btn { flex: 1; text-align: center; }
}
