:root {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --accent: #60a5fa;
  --text: #e7ebf3;
  --muted: #93a0b8;
  --border: #262f45;
  --bg: #0b1220;
  --surface: #131b2e;
  --surface-alt: #1a2338;
  --white: #ffffff;
  --danger: #f87171;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

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

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 576px) {
  .container {
    max-width: 540px;
    padding-inline: 20px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
    padding-inline: 24px;
  }
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.site-header__logo img {
  height: 44px;
  width: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 2px solid var(--border);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: var(--white) !important;
  padding: 10px;
  border-radius: 999px;
  font-weight: 700;
}

.cart-link:hover {
  background: var(--accent);
}

.cart-count {
  background: var(--white);
  color: var(--primary-dark);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  padding: 0 5px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer__channel {
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent);
}

.btn-whatsapp {
  background: #25d366;
  color: var(--white);
}

.btn-whatsapp:hover {
  background: #1ebe5b;
}

.btn-share {
  background: #3925d3;
  color: var(--white);
}

.btn-share:hover {
  background: #2e1ebe;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--bg);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn.is-added {
  background: #22c55e;
  color: var(--white);
}

/* Icon-only buttons (product card actions) */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
}

.btn-icon-whatsapp:hover {
  background: #25d366;
  color: var(--white);
}

.btn-icon.is-added {
  background: #22c55e;
  color: var(--white);
}

/* Hero */
.hero {
  background-color: var(--primary-dark);
  background-image:
    linear-gradient(rgba(11, 18, 32, 0.72), rgba(11, 18, 32, 0.72)),
    url('/img/logo-dark-text.png');
  background-repeat: no-repeat, repeat-x;
  background-size: cover, auto 100%;
  background-position: center, center;
  color: var(--white);
  padding: 56px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  margin: 0 0 12px;
}

.hero p {
  margin: 0 0 24px;
  opacity: 0.9;
}

/* Trust bar */
.trust-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.trust-bar__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.trust-item svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* Sections */
.section {
  /* padding-block only: this class is combined with .container on the same
     element (class="section container"), and the padding shorthand would
     reset the container's horizontal padding-inline back to 0. */
  padding-block: 40px;
}

.section-title {
  font-size: 1.4rem;
  margin: 0 0 20px;
  color: var(--text);
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card__link {
  display: flex;
  flex-direction: column;
  color: inherit;
  flex: 1;
}

.product-card__link:hover {
  text-decoration: none;
}

.product-card__photo {
  aspect-ratio: 1 / 1;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-card__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.product-card__price {
  color: var(--accent);
  font-weight: 700;
}

.product-card__actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

/* Search form */
.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
}

/* Product detail */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 720px) {
  .product-detail {
    grid-template-columns: 1fr 1fr;
  }
}

.product-detail__photo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-detail__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail__price {
  font-size: 1.6rem;
  color: var(--accent);
  font-weight: 800;
  margin: 12px 0;
}

.product-detail__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.delivery-info {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.delivery-info strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.9rem;
}

.delivery-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
}

/* Cart */
.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}

.cart-item__photo {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-alt);
}

.cart-item__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}

.cart-item__qty {
  width: 56px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  background: var(--surface-alt);
  color: var(--text);
}

.cart-item__remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
}

.cart-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.cart-summary__total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--surface-alt);
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  font-weight: 800;
  margin-bottom: 14px;
}

.step h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.05rem;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* CTA banner */
.cta-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cta-banner h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  color: var(--text);
}

.cta-banner p {
  margin: 0;
  color: var(--muted);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* Description modal */
.description-modal {
  width: min(560px, calc(100% - 32px));
  max-height: min(80vh, 640px);
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.description-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.description-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.description-modal__header h3 {
  margin: 0;
}

.description-modal__close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.description-modal__close:hover {
  color: var(--text);
}

.description-modal__price {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.2rem;
  margin: 8px 0 16px;
}

.description-modal__body {
  color: var(--muted);
}

/* Category filter */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.category-filter .btn {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 28px;
  justify-content: center;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}

a.pagination__link:hover {
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
}

.pagination__link--active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.pagination__link--disabled {
  color: var(--muted);
  opacity: 0.5;
}

/* Accessibility utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header search (persistent, all pages) */
.site-header__search-row {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search__input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px; /* prevents iOS Safari from zooming in on focus */
  background: var(--surface-alt);
  color: var(--text);
}

.header-search__submit {
  flex-shrink: 0;
}

.btn-icon-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-icon-primary:hover {
  background: var(--accent);
}

/* Search suggestions dropdown (shared by header + hero search forms) */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.search-suggestions__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
}

.search-suggestions__item:last-child {
  border-bottom: none;
}

.search-suggestions__item:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

.search-suggestions__price {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.search-suggestions__empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Hero search (bigger, primary instance) */
.hero-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 6px 6px 16px;
}

.hero-search__icon {
  display: inline-flex;
  color: var(--muted);
  flex-shrink: 0;
}

.hero-search__input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.hero-search__input:focus {
  outline: none;
}

.hero-search__submit {
  flex-shrink: 0;
}

.hero__catalog-link {
  margin-top: 4px;
}

/* Category cards grid */
.categories-section {
  padding-block: 28px;
}

.category-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

@media (min-width: 720px) {
  .category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    overflow-x: visible;
  }
}

.category-card {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  color: var(--text);
}

@media (min-width: 720px) {
  .category-card {
    width: auto;
  }
}

.category-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.category-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  font-weight: 800;
  font-size: 1.1rem;
}

.category-card__name {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Trust bar counter item */
.trust-item--counter {
  color: var(--text);
}

.trust-item__count {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.05rem;
}

/* Featured product wrapper: badge + explicit "view details" CTA around the shared product card */
.featured-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.featured-item__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  background: rgba(34, 197, 94, 0.9);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.featured-item__cta {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Floating sticky WhatsApp button */
.whatsapp-float {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #25d366;
  color: var(--white);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.whatsapp-float:hover {
  background: #1ebe5b;
  text-decoration: none;
}

.whatsapp-float svg {
  width: 26px;
  height: 26px;
}
