/* ============================================================
   Drogaria MegaPopular — styles
   ============================================================ */

:root {
  --red: #c8102e;
  --red-dark: #a30c23;
  --red-deep: #6b0510;
  --yellow: #ffd400;
  --yellow-soft: #ffe14d;
  --pink: #fcebe8;
  --cream: #faf7f0;
  --ink: #211f1f;
  --muted: #6c6a72;
  --line: #ece6dd;
  --brand-dark: #8c0a18;
  --shadow: 0 14px 34px rgba(80, 12, 22, 0.08);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, p, ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

:focus-visible {
  outline: 3px solid rgba(255, 212, 0, 0.9);
  outline-offset: 2px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 24px;
  height: 24px;
  flex: none;
  display: block;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ============ TOP BAR ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--yellow);
  color: #2a2320;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
}

.topbar-emoji {
  font-size: 0.95rem;
  line-height: 1;
}

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(100deg, #bd0d24 0%, #c8102e 45%, #d81231 100%);
  transition: box-shadow 0.2s ease;
}

.site-header.is-stuck {
  box-shadow: 0 12px 28px rgba(60, 0, 10, 0.28);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--yellow);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-eyebrow {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 5px;
}

.brand-name {
  font-size: 1.4375rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #fff;
}

/* Search */
.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 470px;
  margin: 0 auto;
}

.search .icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: #9a9298;
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 13px 18px 13px 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.search input::placeholder {
  color: #a29aa0;
}

.search input:focus {
  box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.55);
}

/* Cart button */
.cart-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--yellow);
  color: #2a2320;
  font-size: 0.9375rem;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cart-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.cart-btn .icon {
  width: 20px;
  height: 20px;
}

.cart-count {
  display: none;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  place-items: center;
}

.cart-count.is-visible {
  display: grid;
}

.cart-btn.is-bumped {
  animation: bump 0.4s ease;
}

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ============ HERO ============ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(112deg, #6b0510 0%, #8f0a19 28%, #c0102a 66%, #e42330 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 85% 18%, rgba(255, 255, 255, 0.14), transparent 56%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  align-items: center;
  gap: 64px;
  padding-top: 50px;
  padding-bottom: 62px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 6px;
  background: #241c1c;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-badge-hl {
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--yellow);
  color: #241c1c;
}

.hero-badge-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  color: #fff;
}

.hero-badge-label .icon {
  width: 13px;
  height: 13px;
  color: var(--yellow-soft);
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.35rem, 4.45vw, 4.05rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: #fff;
}

.hero h1 span {
  display: block;
  color: var(--yellow);
}

.hero-copy p {
  max-width: 480px;
  margin: 20px 0 30px;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
}

.btn-yellow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 38px;
  border-radius: 999px;
  background: var(--yellow);
  color: #1e1b1b;
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-yellow:hover {
  background: var(--yellow-soft);
  transform: translateY(-2px);
}

.hero-media {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.hero-frame {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.hero-frame::before {
  content: "";
  position: absolute;
  inset: 16px -16px -18px 18px;
  border-radius: 30px;
  background: var(--yellow);
}

.hero-frame img {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 0.92;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: 26px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}

/* ============ FEATURES ============ */
.features {
  position: relative;
  z-index: 2;
  background: var(--cream);
  padding-top: 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-radius: 16px;
  background: #fff;
  border-bottom: 3px solid var(--yellow);
  box-shadow: 0 10px 26px rgba(80, 12, 22, 0.09);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}

.feature-icon .icon {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feature-card p {
  margin-top: 3px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ============ CATALOG ============ */
.catalog {
  padding-top: 72px;
  padding-bottom: 96px;
  scroll-margin-top: 96px;
}

.catalog-title {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: var(--red);
  line-height: 1.1;
}

.catalog-sub {
  margin-top: 8px;
  font-size: 0.9375rem;
  color: #7a7580;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 32px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #e7e0d6;
  background: #fff;
  color: #24242a;
  font-size: 0.875rem;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.chip .icon {
  width: 16px;
  height: 16px;
}

.chip:hover {
  border-color: #d8cec0;
  transform: translateY(-1px);
}

.chip.is-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 8px 18px rgba(200, 16, 46, 0.28);
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(80, 12, 22, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(80, 12, 22, 0.12);
}

.product-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  background: var(--pink);
}

.product-icon {
  width: 86px;
  height: 86px;
  color: var(--red);
  opacity: 0.92;
}

.discount-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--yellow);
  color: #2a2320;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.product-info {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 20px;
  flex: 1;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.product-desc {
  margin-top: 4px;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}

.price-old {
  display: block;
  min-height: 15px;
  margin-top: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #a19aa2;
  text-decoration: line-through;
}

.price {
  display: block;
  margin-top: 1px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--red);
}

.add-btn {
  margin-top: 14px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  transition: background 0.18s ease, transform 0.12s ease;
}

.add-btn:hover {
  background: var(--red-dark);
}

.add-btn:active {
  transform: scale(0.985);
}

.add-btn.is-added {
  background: #15803d;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 60px 20px 40px;
  text-align: center;
  color: var(--muted);
}

.empty-state .icon {
  width: 42px;
  height: 42px;
  color: #cbc2b6;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.empty-state span {
  font-size: 0.875rem;
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--brand-dark);
  color: #f0d9dc;
  padding: 46px 0 54px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1.05fr;
  gap: 44px;
  align-items: start;
}

.footer-brand {
  min-width: 0;
}

.brand--footer .brand-name {
  font-size: 1.375rem;
}

.footer-tagline {
  margin-top: 20px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.78);
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 6px;
}

.footer-info li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
}

.footer-info .icon {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
}

.footer-note {
  padding-top: 6px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

/* ============ CART DRAWER ============ */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(30, 4, 8, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(400px, 100%);
  height: 100%;
  background: #fff;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -20px 0 50px rgba(40, 0, 8, 0.25);
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.cart-head h2 {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f4efe7;
  color: var(--ink);
  transition: background 0.18s ease;
}

.icon-btn:hover {
  background: #ebe3d8;
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.cart-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  overflow-y: auto;
}

.cart-empty {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
}

.cart-empty .icon {
  width: 44px;
  height: 44px;
  color: #d8cfc3;
  margin-bottom: 6px;
}

.cart-empty p {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
}

.cart-empty span {
  font-size: 0.8125rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid #f2ece3;
}

.cart-item-thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--pink);
  color: var(--red);
}

.cart-item-thumb .icon {
  width: 26px;
  height: 26px;
}

.cart-item-main h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.cart-item-price {
  display: block;
  margin-top: 3px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 9px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.qty button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--red);
}

.qty button:hover {
  background: #fbefec;
}

.qty button .icon {
  width: 14px;
  height: 14px;
}

.qty span {
  min-width: 22px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
}

.cart-item-remove {
  padding: 4px;
  color: #b8afa3;
  transition: color 0.18s ease;
}

.cart-item-remove:hover {
  color: var(--red);
}

.cart-item-remove .icon {
  width: 17px;
  height: 17px;
}

.cart-foot {
  padding: 20px 24px 26px;
  border-top: 1px solid var(--line);
  background: #fffdf9;
}

.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
}

.cart-total strong {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--red);
  letter-spacing: -0.02em;
}

.checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 800;
  transition: background 0.18s ease, opacity 0.18s ease;
}

.checkout-btn:hover {
  background: var(--red-dark);
}

.checkout-btn .icon {
  width: 18px;
  height: 18px;
}

.checkout-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.cart-note {
  margin-top: 12px;
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
  color: #a09890;
}

body.no-scroll {
  overflow: hidden;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1040px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
    gap: 40px;
  }

  .footer-grid {
    gap: 32px;
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 44px;
    padding-bottom: 56px;
  }

  .hero-copy p {
    max-width: 560px;
  }

  .hero-media {
    justify-content: flex-start;
  }

  .hero-frame {
    max-width: 360px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 14px;
    padding-bottom: 16px;
  }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin: 0;
  }

  .cart-btn {
    margin-left: auto;
  }

  .brand-name {
    font-size: 1.25rem;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 720px) {
  .topbar {
    font-size: 0.75rem;
    padding: 10px 14px;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.9rem);
  }

  .hero-badge {
    font-size: 0.625rem;
  }

  .catalog {
    padding-top: 56px;
    padding-bottom: 72px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    padding: 14px 18px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-note {
    grid-column: auto;
  }

  .footer-tagline {
    margin-top: 14px;
  }
}

@media (max-width: 520px) {
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .product-media {
    aspect-ratio: 1 / 0.82;
  }

  .btn-yellow {
    width: 100%;
  }

  .filters {
    gap: 8px;
  }

  .chip {
    padding: 9px 14px;
    font-size: 0.8125rem;
  }

  .cart-btn {
    padding: 10px 16px;
    font-size: 0.875rem;
  }
}

@media (max-width: 400px) {
  .cart-btn-label {
    display: none;
  }

  .cart-btn {
    padding: 10px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
