:root {
  --red: #c40000;
  --red-dark: #990000;
  --ink: #151515;
  --muted: #6d6d6d;
  --line: #e8e8e8;
  --soft: #f6f6f6;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(18, 18, 18, 0.1);
  --shadow-soft: 0 10px 28px rgba(18, 18, 18, 0.08);
  --radius: 18px;
  --speed: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, #fafafa 48%, #f3f3f3 100%);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(232, 232, 232, 0.9);
  backdrop-filter: blur(16px);
}

.header-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--red);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(196, 0, 0, 0.28);
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.search-box {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  transition: border var(--speed), box-shadow var(--speed), background var(--speed);
}

.search-box:focus-within {
  background: var(--white);
  border-color: rgba(196, 0, 0, 0.35);
  box-shadow: 0 0 0 4px rgba(196, 0, 0, 0.1);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.cart-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.cart-button {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--white);
  background: var(--ink);
  transition: transform var(--speed), background var(--speed);
}

.cart-button:hover {
  transform: translateY(-2px);
  background: var(--red);
}

.cart-button.pulse {
  animation: cartPulse 220ms ease;
}

.cart-icon {
  font-size: 1.25rem;
}

.cart-count {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 800;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: stretch;
  padding: 34px 0 24px;
}

.hero-content {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 58px);
  border-radius: 26px;
  background:
    linear-gradient(120deg, rgba(21, 21, 21, 0.82), rgba(196, 0, 0, 0.78)),
    url("https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&w=1400&q=80") center/cover;
  color: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.eyebrow,
.section-title p,
.cart-header p {
  margin: 0;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffdede;
}

.hero h1 {
  max-width: 710px;
  margin: 14px 0;
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-link,
.secondary-link,
.ghost-button,
.checkout-button,
.mercado-pago,
.add-button {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  transition: transform var(--speed), box-shadow var(--speed), background var(--speed), color var(--speed);
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
}

.primary-link {
  color: var(--red);
  background: var(--white);
}

.secondary-link {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.primary-link:hover,
.secondary-link:hover,
.ghost-button:hover,
.checkout-button:hover,
.mercado-pago:hover,
.add-button:hover {
  transform: translateY(-2px);
}

.delivery-panel {
  display: grid;
  gap: 16px;
}

.delivery-panel div {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.delivery-panel span {
  font-size: 2rem;
}

.delivery-panel small {
  color: var(--muted);
  line-height: 1.45;
}

.offers-section,
.history-section {
  padding: 42px 0 18px;
}

.section-title h2 {
  margin: 6px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  letter-spacing: 0;
}

.offers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.offer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 130px;
  padding: 20px;
  border-radius: var(--radius);
  color: var(--white);
  background: linear-gradient(135deg, var(--red), #1c1c1c);
  box-shadow: var(--shadow-soft);
}

.offer-card span {
  font-size: 2.5rem;
}

.offer-card h3 {
  margin: 0 0 6px;
}

.offer-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
}

.shop-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 36px 0;
}

.categories-panel {
  position: sticky;
  top: 98px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
  text-align: left;
  transition: background var(--speed), color var(--speed), transform var(--speed);
}

.category-button:hover,
.category-button.active {
  color: var(--white);
  background: var(--red);
  transform: translateX(2px);
}

.products-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  color: var(--red);
  background: #fff0f0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 8px 20px rgba(18, 18, 18, 0.05);
  transition: transform var(--speed), box-shadow var(--speed), border-color var(--speed);
}

.product-card:hover {
  border-color: rgba(196, 0, 0, 0.22);
  box-shadow: var(--shadow-soft);
  transform: translateY(-5px);
}

.product-media {
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #f7f7f7, #fff);
  font-size: 3rem;
}

.product-card h3 {
  margin: 0;
  font-size: 1rem;
}

.product-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price {
  color: var(--red);
  font-size: 1.25rem;
  font-weight: 800;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.add-button,
.checkout-button,
.mercado-pago {
  min-height: 46px;
  color: var(--white);
  background: var(--red);
  box-shadow: 0 12px 22px rgba(196, 0, 0, 0.2);
}

.add-button:active,
.cart-button:active {
  transform: scale(0.97);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 280px;
  text-align: center;
}

.empty-state span {
  font-size: 3rem;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.history-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-bottom: 42px;
}

.history-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 8px 18px rgba(18, 18, 18, 0.05);
}

.history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.cart-drawer.open {
  pointer-events: auto;
}

.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity var(--speed);
}

.cart-drawer.open .cart-backdrop {
  opacity: 1;
}

.cart-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: min(440px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background: var(--white);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 220ms ease;
}

.cart-drawer.open .cart-panel {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-header h2 {
  margin: 3px 0 0;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--soft);
  color: var(--ink);
}

.cart-items {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}

.cart-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  animation: itemIn 180ms ease;
}

.cart-item-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--soft);
  font-size: 1.7rem;
}

.cart-item h3,
.cart-item p {
  margin: 0;
}

.cart-item p {
  color: var(--muted);
  font-size: 0.86rem;
}

.item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.qty-control button {
  width: 34px;
  height: 32px;
  border: 0;
  background: var(--soft);
  cursor: pointer;
  font-weight: 800;
}

.qty-control span {
  min-width: 34px;
  text-align: center;
  font-weight: 800;
}

.remove-button {
  border: 0;
  color: var(--red);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.payment-box,
.cart-summary {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--soft);
}

.payment-box label,
.cart-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-box label {
  justify-content: flex-start;
  cursor: pointer;
}

.mercado-pago {
  background: #009ee3;
  box-shadow: 0 12px 22px rgba(0, 158, 227, 0.2);
}

.total-row {
  padding-top: 10px;
  border-top: 1px solid #dedede;
}

.total-row strong {
  color: var(--red);
  font-size: 1.25rem;
}

.checkout-button {
  width: 100%;
  flex: 0 0 auto;
}

.checkout-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 140;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: min(340px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  animation: toastIn 220ms ease;
}

.hidden {
  display: none !important;
}

@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cartPulse {
  50% {
    transform: scale(1.08);
  }
}

@media (max-width: 980px) {
  .header-shell {
    grid-template-columns: 1fr auto;
  }

  .search-box {
    grid-column: 1 / -1;
    order: 3;
    margin-bottom: 12px;
  }

  .hero,
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .delivery-panel,
  .offers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .categories-panel {
    position: static;
  }

  .category-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  main,
  .header-shell {
    width: min(100% - 22px, 1180px);
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 0.9rem;
  }

  .hero-content {
    min-height: 430px;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: 2.35rem;
  }

  .delivery-panel,
  .offers-grid,
  .category-list,
  .products-grid {
    grid-template-columns: 1fr;
  }

  .products-head,
  .history-top {
    align-items: stretch;
    flex-direction: column;
  }

  .ghost-button {
    width: 100%;
  }

  .cart-panel {
    padding: 18px;
  }
}
