/*
Theme Name: TataPet WooCommerce Theme
Theme URI: https://eltatapet.cl/
Author: Jorge Videla Human Skills
Description: Tema WordPress/WooCommerce convertido desde frontend HTML/CSS/JS de catálogo El Tata Pet.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: tatapet
*/

:root {
  --orange: #f5822d;
  --yellow: #ffe06a;
  --cream: #fffdf9;
  --nav: #faeadb;
  --paper: #fff6e9;
  --brown: #5a2424;
  --muted: #80645c;
  --line: #efd8c7;
  --green: #5f8f4e;
  --red: #b85b46;
  --shadow: 0 14px 30px rgba(92, 40, 23, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: #333;
  font-family: "Roboto Flex", Arial, sans-serif;
  font-size: 16px;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.top-strip {
  background: var(--yellow);
  color: #3f2b24;
  text-align: center;
  padding: 10px 16px;
  font-size: 15px;
}

.site-header {
  min-height: 132px;
  background: var(--orange);
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: clamp(22px, 5vw, 70px);
  padding: 24px clamp(22px, 6vw, 70px);
}
.brand img { width: min(245px, 48vw); display: block; }
.screen-reader-text {
  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 {
  display: grid;
  grid-template-columns: 1fr 86px;
  width: min(940px, 100%);
  min-height: 66px;
  border-radius: 12px;
  overflow: hidden;
}
.header-search input {
  border: 0;
  padding: 0 24px;
  color: #5a2424;
  background: #fffdf9;
  font-size: clamp(18px, 2vw, 28px);
  min-width: 0;
}
.header-search input::placeholder { color: #8b7470; opacity: 1; }
.header-search button {
  border: 0;
  background: #ffc36e;
  color: var(--brown);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.header-search svg {
  width: 40px;
  height: 40px;
  fill: currentColor;
}
.cart-button {
  position: relative;
  border: 0;
  color: #fff;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}
.cart-icon {
  width: 58px;
  height: 58px;
  display: block;
}
.cart-count {
  position: absolute;
  top: -7px;
  left: 30px;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #c65a83;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}

.pet-nav {
  background: var(--nav);
  min-height: 80px;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  align-items: center;
  padding: 0 clamp(14px, 5vw, 66px);
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
  overflow-x: auto;
}
.pet-nav a {
  color: #4f2a29;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 70px;
  white-space: nowrap;
  font-size: 17px;
}
.nav-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
  display: inline-block;
}

main { overflow: hidden; }
.intro-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  max-width: 1060px;
  margin: 0 auto;
  padding: 34px 22px 28px;
}
.intro-copy h1 {
  color: var(--brown);
  font-size: clamp(29px, 3vw, 34px);
  line-height: 1.55;
  max-width: 420px;
  margin: 0;
  font-weight: 800;
  letter-spacing: 0;
}
.support-card {
  background: var(--paper);
  color: var(--brown);
  width: 214px;
  min-height: 118px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
}
.support-card p { margin: 0; line-height: 1.45; }
.phone-mark { width: 64px; height: 64px; fill: var(--brown); flex: 0 0 auto; }

.hero-slider {
  max-width: 1190px;
  margin: 8px auto 34px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 0;
}
.hero-image {
  min-height: clamp(245px, 33vw, 395px);
  background-image: url("./assets/banners/bannerperrito-envio-gratis.webp");
  background-size: cover;
  background-position: center;
}
.slide-arrow {
  border: 0;
  background: transparent;
  color: var(--brown);
  font-size: 48px;
  cursor: pointer;
  line-height: 1;
}

.service-row {
  max-width: 1120px;
  margin: 0 auto 38px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.service-row article {
  border: 1px solid var(--line);
  background: #fffaf3;
  border-radius: 8px;
  min-height: 104px;
  padding: 20px;
}
.service-row strong { color: var(--brown); display: block; margin-bottom: 7px; }
.service-row span { color: var(--muted); line-height: 1.45; }

.category-section, .catalog-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 22px 42px;
}
h2 {
  color: var(--brown);
  font-size: clamp(27px, 3vw, 34px);
  margin: 0 0 24px;
  letter-spacing: 0;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  align-items: end;
}
.category-card {
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0;
  min-height: 0;
  display: block;
  box-shadow: none;
  cursor: pointer;
  color: var(--brown);
  position: relative;
  transition: transform .18s ease, filter .18s ease;
}
.category-card:hover {
  transform: translateY(-4px);
  filter: drop-shadow(0 14px 22px rgba(92, 40, 23, .12));
}
.category-card img {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.category-count {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.feature-links {
  max-width: 1120px;
  margin: 8px auto 18px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.feature-links a {
  min-height: 170px;
  border-radius: 8px;
  display: flex;
  align-items: end;
  padding: 24px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(0deg, rgba(85,36,31,.74), rgba(85,36,31,.08)), url("./assets/banners/variedad-de-productos-mascotas-pequenas.webp") center/cover;
}
.feature-links a:nth-child(2) { background-position: left center; }
.feature-links a:nth-child(3) { background-position: right center; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.eyebrow {
  color: var(--red);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0;
  margin: 0 0 6px;
}
.catalog-summary {
  color: var(--muted);
  text-align: right;
  line-height: 1.5;
}
.toolbar {
  background: var(--nav);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 2fr;
  gap: 14px;
  margin-bottom: 26px;
}
.search-wrap label {
  display: block;
  color: var(--brown);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}
.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  min-height: 42px;
  padding: 0 12px;
  color: #332826;
}
.filter-buttons {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-buttons button {
  border: 1px solid #e2c3ad;
  color: var(--brown);
  background: #fffaf3;
  border-radius: 999px;
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}
.filter-buttons button.active {
  background: var(--brown);
  border-color: var(--brown);
  color: #fff;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 18px;
}
.product-card {
  background: transparent;
  min-width: 0;
}
.product-media {
  position: relative;
  background: #fff;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #f0e0d2;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}
.placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff7ec, #f8e3cc);
  color: var(--muted);
  text-align: center;
  padding: 18px;
  font-weight: 800;
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  background: #fff;
  color: var(--brown);
  border: 1px solid var(--line);
}
.badge.missing { color: #90432d; }
.product-card h3 {
  color: #352927;
  font-size: 16px;
  line-height: 1.35;
  min-height: 44px;
  margin: 13px 0 8px;
  font-weight: 700;
}
.price {
  color: var(--brown);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
}
.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  min-height: 39px;
}
.product-card button {
  margin-top: 12px;
  width: 100%;
  min-height: 39px;
  border: 0;
  border-radius: 5px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.product-card button.read-more { background: var(--brown); }

.express-band {
  background: var(--orange);
  color: #fff;
  margin-top: 22px;
  padding: 42px clamp(22px, 8vw, 88px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}
.express-band h2 { color: #fff; margin-bottom: 10px; }
.express-band p { max-width: 650px; margin: 0; font-size: 18px; line-height: 1.45; }
.express-band a {
  background: #fff;
  color: var(--brown);
  border-radius: 5px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  font-weight: 800;
  white-space: nowrap;
}
.site-footer {
  background: #fff7ef;
  color: var(--muted);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding: 38px clamp(22px, 7vw, 78px);
  line-height: 1.7;
}
.site-footer strong { color: var(--brown); }
.site-footer nav { display: grid; gap: 4px; margin-top: 8px; }

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 18px;
  }
  .header-search {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 56px;
    grid-template-columns: 1fr 62px;
  }
  .header-search svg { width: 30px; height: 30px; }
  .pet-nav { grid-template-columns: repeat(6, minmax(145px, 1fr)); }
  .intro-band { grid-template-columns: 1fr; }
  .support-card { width: 100%; max-width: 320px; }
  .service-row, .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid, .feature-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr; }
  .section-head, .express-band { align-items: start; flex-direction: column; }
  .catalog-summary { text-align: left; }
  .site-footer { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header { min-height: 108px; padding: 20px; }
  .cart-button span:last-child { display: none; }
  .brand img { width: 190px; }
  .cart-icon { width: 42px; height: 42px; }
  .header-search input { font-size: 18px; padding: 0 16px; }
  .hero-slider { grid-template-columns: 24px 1fr 24px; padding: 0 8px; }
  .slide-arrow { font-size: 36px; }
  .service-row, .category-grid, .feature-links, .products-grid { grid-template-columns: 1fr; }
  .product-card h3 { min-height: auto; }
}

/* WooCommerce compatibility */
.woocommerce main.site-main, .woocommerce-page main.site-main { max-width: 1180px; margin: 0 auto; padding: 40px 20px; }
.woocommerce ul.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; padding: 0; }
.woocommerce ul.products li.product { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); text-align: center; }
.woocommerce ul.products li.product img { border-radius: 14px; object-fit: contain; background: #fff; }
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit { background: var(--orange); color: #fff; border-radius: 999px; font-weight: 700; }
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover { background: var(--brown); color: #fff; }
.woocommerce div.product { max-width: 1180px; margin: 40px auto; padding: 0 20px; }
.woocommerce div.product .product_title { color: var(--brown); }
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button { background: var(--orange); }
