
:root {
  --primary: #136f63;
  --secondary: #f05d5e;
  --accent: #f6c85f;
  --background: #f7f6f1;
  --surface: #ffffff;
  --text: #1f2a2e;
  --muted: color-mix(in srgb, var(--text) 62%, white);
  --line: color-mix(in srgb, var(--text) 14%, white);
  --topbar-background: color-mix(in srgb, var(--surface) 92%, transparent);
  --catalog-heading: var(--text);
  --catalog-subtitle: var(--muted);
  --catalog-price: var(--primary);
  --category-button-text: var(--catalog-heading);
  --category-button-active-text: white;
  --mobile-category-button-text: var(--category-button-text);
  --mobile-category-button-active-text: var(--category-button-active-text);
  --mobile-catalog-list-background: transparent;
  --mobile-catalog-list-text: var(--text);
  --shadow: 0 18px 45px rgba(24, 43, 53, 0.13);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--text);
}

button,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.storefront {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-background);
  backdrop-filter: blur(16px);
}

.topbar-inner,
.main {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.store-info {
  width: min(1160px, calc(100% - 32px));
  margin: 12px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-info span {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 800;
}

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

.logo,
.logo-fallback {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex: 0 0 auto;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.logo {
  display: block;
  object-fit: contain;
}

.logo-button {
  border-radius: 8px;
  padding: 0;
  background: var(--topbar-background);
}

.logo-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 3px;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.1;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.topbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.checkout-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  background: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.whatsapp-quick,
.social-button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--primary);
  text-decoration: none;
  font-weight: 900;
}

.whatsapp-quick:hover,
.social-button:hover {
  background: color-mix(in srgb, var(--primary) 86%, black);
}

.whatsapp-quick.native {
  background: #25d366;
}

.whatsapp-quick.native:hover {
  background: #1ebe5d;
}

.whatsapp-quick.disabled {
  pointer-events: none;
  opacity: 0.48;
}

.social-footer {
  width: min(1160px, calc(100% - 32px));
  margin: -12px auto 26px;
  display: flex;
  justify-content: center;
}

.social-footer .social-button {
  width: auto;
  min-width: 140px;
  padding: 0 14px;
  gap: 8px;
}

.cart-shortcut {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--primary);
}

.cart-shortcut:hover {
  background: color-mix(in srgb, var(--primary) 86%, black);
}

.cart-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 21px;
  height: 21px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--secondary);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.cart-count-badge.is-pulsing {
  animation: storefrontBadgePop 260ms ease both;
}

.cart-feedback {
  position: sticky;
  top: 88px;
  z-index: 35;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 16px -44px auto;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 8px;
  padding: 10px 13px;
  color: white;
  background: var(--primary);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 900;
  animation: storefrontToastIn 180ms ease both;
}

.cart-feedback.removed {
  background: var(--secondary);
}

.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  padding: 28px 0 36px;
}

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

.catalog-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--catalog-heading);
}

.catalog-head p {
  margin: 6px 0 0;
  color: var(--catalog-subtitle);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  padding: 0 0 12px;
}

.category-button {
  min-height: 38px;
  max-width: min(240px, 100%);
  white-space: normal;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--category-button-text);
  background: var(--surface);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
}

.category-button.active {
  border-color: var(--primary);
  color: var(--category-button-active-text);
  background: var(--primary);
}

.category-select {
  display: none;
  margin: 0 0 12px;
  color: var(--catalog-heading);
  font-weight: 800;
}

.category-select select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
  font-weight: 800;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.product-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(24, 43, 53, 0.07);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.product-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 3px;
}

.product-card--soldout {
  opacity: 0.86;
}

.product-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.product-media,
.product-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.product-placeholder {
  display: grid;
  place-items: center;
  color: white;
  font-size: 2rem;
  font-weight: 900;
}

.soldout-stamp {
  position: absolute;
  inset: 50% auto auto 50%;
  min-width: 112px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 6px 10px;
  color: white;
  background: color-mix(in srgb, var(--secondary) 88%, black);
  box-shadow: 0 10px 24px rgba(24, 43, 53, 0.18);
  font-size: 0.8rem;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(-10deg);
}

.product-body {
  padding: 14px;
  display: grid;
  gap: 10px;
  flex: 1;
}

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

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

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.price {
  font-weight: 900;
  color: var(--catalog-price);
}

.add-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: white;
  background: var(--secondary);
  font-size: 1.3rem;
  line-height: 1;
}

.add-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.cart-panel {
  position: sticky;
  top: 100px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cart-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cart-head h2 {
  margin: 0;
  font-size: 1rem;
}

.cart-body {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cart-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.cart-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  aspect-ratio: auto;
}

.cart-item .product-placeholder {
  color: white;
  font-size: 0.9rem;
}

.cart-line > div:first-child,
.cart-item > div {
  min-width: 0;
}

.cart-line strong {
  display: block;
  font-size: 0.95rem;
}

.cart-line small {
  color: var(--muted);
}

.cart-line small:last-child {
  color: var(--catalog-price);
  font-weight: 900;
}

.qty-control {
  display: grid;
  grid-template-columns: 34px 34px 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.qty-control button,
.qty-control span {
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.note-field {
  min-height: 82px;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
  font-size: 1.05rem;
}

.checkout-button {
  width: 100%;
  background: var(--primary);
}

.checkout-button.disabled {
  pointer-events: none;
  opacity: 0.48;
}

.option-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 16px;
  display: grid;
  place-items: center;
  background: rgba(20, 27, 30, 0.45);
}

.option-modal {
  width: min(480px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  display: grid;
  gap: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.product-detail-modal {
  width: min(560px, 100%);
}

.product-detail-modal .option-modal-head span {
  color: var(--catalog-price);
  font-weight: 900;
}

.option-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.option-modal-head strong,
.option-modal-head span {
  display: block;
}

.option-modal-head span {
  margin-top: 4px;
  color: var(--muted);
}

.product-detail-media-wrap {
  position: relative;
  width: 100%;
  height: clamp(180px, 34vh, 340px);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.product-detail-media {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(20, 27, 30, 0.56);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
}

.gallery-nav.prev {
  left: 10px;
}

.gallery-nav.next {
  right: 10px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.gallery-thumbs button {
  width: 54px;
  height: 46px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
}

.gallery-thumbs button.active {
  border-color: var(--primary);
}

.gallery-thumbs img,
.gallery-thumbs .product-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  font-size: 0.8rem;
}

.logo-modal {
  width: min(540px, 100%);
}

.logo-modal-media {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface) 86%, var(--background));
}

.logo-modal-media img,
.logo-modal-media .logo-fallback {
  width: min(220px, 72vw);
  height: min(220px, 72vw);
  border-radius: 12px;
  object-fit: contain;
}

.logo-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logo-social-links .social-button,
.logo-social-links .whatsapp-quick {
  width: auto;
  min-width: 132px;
  padding: 0 13px;
  gap: 8px;
}

.logo-address {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 92%, var(--background));
}

.logo-address span {
  color: var(--muted);
  line-height: 1.45;
}

.logo-address a {
  color: var(--primary);
  font-weight: 900;
}

.logo-address iframe {
  width: 100%;
  height: 220px;
  border: 0;
  border-radius: 8px;
}

.product-detail-meta,
.product-detail-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-detail-meta span,
.product-detail-meta strong,
.product-detail-info span {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 800;
}

.product-detail-meta strong {
  border-color: color-mix(in srgb, var(--secondary) 36%, var(--line));
  color: white;
  background: var(--secondary);
}

.product-detail-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.product-detail-note-field {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 900;
}

.dialog-quantity {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-weight: 900;
}

.dialog-quantity .qty-control {
  flex: 0 0 auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-button,
.dialog-button-ghost {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.dialog-button {
  color: white;
  background: var(--primary);
}

.dialog-button:hover {
  background: color-mix(in srgb, var(--primary) 86%, black);
}

.dialog-button.danger {
  background: var(--secondary);
}

.dialog-button.danger:hover {
  background: color-mix(in srgb, var(--secondary) 84%, black);
}

.dialog-button.disabled {
  pointer-events: none;
  opacity: 0.52;
}

.dialog-button-ghost {
  color: var(--muted);
  background: transparent;
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 8%, white);
}

.option-group {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.option-group legend {
  padding: 0 6px;
  font-weight: 900;
}

.option-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-weight: 800;
}

.option-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.item-note-field {
  min-height: 72px;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.powered {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.storefront.animated.is-entering .product-card,
.storefront.animated.is-entering .store-info,
.storefront.animated.is-entering .social-footer {
  animation: storefrontFadeUp 420ms ease both;
}

.storefront.animated.is-entering .product-card:nth-child(2n) {
  animation-delay: 40ms;
}

.storefront.animated.is-entering .product-card:nth-child(3n) {
  animation-delay: 80ms;
}

.storefront.animated .product-card,
.storefront.animated .whatsapp-quick,
.storefront.animated .social-button,
.storefront.animated .cart-shortcut,
.storefront.animated .add-button,
.storefront.animated .dialog-button {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.storefront.animated .product-card:hover,
.storefront.animated .whatsapp-quick:hover,
.storefront.animated .social-button:hover,
.storefront.animated .cart-shortcut:hover,
.storefront.animated .add-button:hover,
.storefront.animated .dialog-button:hover {
  transform: translateY(-1px);
}

.storefront.animated .option-modal {
  animation: storefrontModalIn 180ms ease both;
}

.storefront.animated .cart-count-badge.is-pulsing {
  animation: storefrontBadgePop 260ms ease both;
}

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

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

@keyframes storefrontBadgePop {
  0% {
    transform: scale(0.82);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes storefrontToastIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .storefront.animated *,
  .storefront.animated *::before,
  .storefront.animated *::after,
  .cart-count-badge.is-pulsing,
  .cart-feedback {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .topbar-inner,
  .main {
    width: min(100% - 24px, 680px);
  }

  .topbar-inner {
    min-height: 68px;
  }

  .brand p {
    display: none;
  }

  .main {
    display: block;
    padding-bottom: 28px;
  }

  .catalog-head {
    align-items: start;
    flex-direction: column;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border-radius: 8px;
    padding: 8px;
    color: var(--mobile-catalog-list-text);
    background: var(--mobile-catalog-list-background);
  }

  .product-body {
    color: var(--mobile-catalog-list-text);
  }

  .category-list {
    display: none;
  }

  .category-select {
    display: grid;
    color: var(--mobile-category-button-text);
  }

  .category-select select {
    color: var(--mobile-category-button-active-text);
  }

  .product-body {
    padding: 9px;
    gap: 8px;
  }

  .product-body h3 {
    font-size: 0.9rem;
    line-height: 1.18;
  }

  .product-body p {
    color: color-mix(in srgb, var(--mobile-catalog-list-text) 72%, transparent);
    font-size: 0.78rem;
    line-height: 1.32;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .product-bottom {
    align-items: flex-end;
    gap: 6px;
  }

  .price {
    font-size: 0.84rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .add-button {
    width: 34px;
    height: 34px;
    font-size: 1.08rem;
  }

  .cart-panel {
    position: static;
    inset: auto;
    z-index: auto;
    max-height: none;
    margin-top: 14px;
    border-radius: 8px;
    overflow: hidden;
  }

  .product-detail-media-wrap {
    height: clamp(150px, 26vh, 230px);
  }
}

@media (max-width: 339px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}
