/* ============================================
   MIMO ANIMAL — Estilos
   Paleta: crema cálida, verde salvia, terracota suave
   ============================================ */

:root {
  --cream: #FBF7F0;
  --cream-deep: #F3EBDD;
  --ink: #2C2620;
  --ink-soft: #6B6459;
  --sage: #7C9070;
  --sage-deep: #5E7355;
  --clay: #D08B6A;
  --clay-deep: #B9704F;
  --wa: #25D366;
  --wa-deep: #1DA851;
  --card: #FFFFFF;
  --line: #E8DECF;
  --shadow: 0 4px 20px rgba(44, 38, 32, 0.06);
  --shadow-lg: 0 12px 40px rgba(44, 38, 32, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito Sans', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 247, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  font-size: 24px;
}

.logo-text {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.cart-btn {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}

.cart-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--clay);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--cream-deep) 0%, var(--cream) 100%);
  padding: 64px 20px 72px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "🐾";
  position: absolute;
  font-size: 280px;
  right: -60px;
  bottom: -80px;
  opacity: 0.05;
  transform: rotate(-15deg);
  pointer-events: none;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 13px;
  font-weight: 700;
  color: var(--sage-deep);
  margin-bottom: 16px;
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(38px, 8vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-title em {
  font-style: italic;
  color: var(--clay-deep);
}

.hero-sub {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 460px;
  margin-bottom: 32px;
}

.hero-cta {
  display: inline-block;
  background: var(--sage-deep);
  color: white;
  text-decoration: none;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 100px;
  transition: transform 0.15s, background 0.15s;
}

.hero-cta:hover {
  background: var(--ink);
  transform: translateY(-2px);
}

/* ---------- Main / Categorías ---------- */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.cat-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  position: sticky;
  top: 72px;
  z-index: 30;
  padding: 8px 0;
  background: var(--cream);
}

.cat-chip {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 20px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-chip:hover {
  border-color: var(--sage);
  color: var(--ink);
}

.cat-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

/* ---------- Grid de productos ---------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-soft);
  padding: 60px 0;
  font-size: 16px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.product-img {
  aspect-ratio: 1;
  background: var(--cream-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  overflow: hidden;
}

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

.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-cat {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sage-deep);
  margin-bottom: 6px;
}

.product-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.product-desc {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 14px;
  flex: 1;
}

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

.product-price {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
}

.add-btn {
  background: var(--sage-deep);
  color: white;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.add-btn:hover {
  background: var(--ink);
}

.add-btn:active {
  transform: scale(0.95);
}

.empty-cat {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-soft);
  padding: 60px 0;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--cream);
  padding: 56px 20px;
  text-align: center;
}

.footer-inner .logo-mark {
  font-size: 40px;
}

.footer-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 24px;
  margin-top: 8px;
}

.footer-tag {
  color: rgba(251, 247, 240, 0.6);
  margin-bottom: 24px;
}

.footer-wa {
  display: inline-block;
  background: var(--wa);
  color: white;
  text-decoration: none;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 100px;
  transition: background 0.15s;
}

.footer-wa:hover {
  background: var(--wa-deep);
}

/* ---------- Carrito ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 38, 32, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s;
  z-index: 50;
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: var(--cream);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(44, 38, 32, 0.15);
}

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

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.cart-header h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
}

.cart-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink-soft);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background 0.15s;
}

.cart-close:hover {
  background: var(--cream-deep);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.cart-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 60px 20px;
}

.cart-empty-mark {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.4;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.cart-item-emoji {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--cream-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  overflow: hidden;
}

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

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

.cart-item-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.cart-item-price {
  color: var(--ink-soft);
  font-size: 14px;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}

.qty-btn:hover {
  border-color: var(--sage);
  background: var(--sage);
  color: white;
}

.qty-num {
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.cart-total-row span:first-child {
  font-weight: 600;
  color: var(--ink-soft);
}

.cart-total-row span:last-child {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 28px;
}

.cart-checkout {
  width: 100%;
  background: var(--wa);
  color: white;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  padding: 15px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cart-checkout:hover {
  background: var(--wa-deep);
}

.cart-checkout:active {
  transform: scale(0.98);
}

.cart-checkout:disabled {
  background: var(--line);
  color: var(--ink-soft);
  cursor: not-allowed;
}

.cart-note {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .hero {
    padding: 48px 20px 56px;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-body {
    padding: 12px;
  }
  .product-name {
    font-size: 16px;
  }
  .product-price {
    font-size: 19px;
  }
  .add-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  .cat-nav {
    top: 68px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cat-nav::-webkit-scrollbar {
    display: none;
  }
  .cat-chip {
    white-space: nowrap;
  }
}
