:root {
  --primary: #1e3c5a;
  --secondary: #f4a261;
  --accent: #e76f51;
  --bg: #f5f8fa;
  --text: #333;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Poppins", sans-serif; }
html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }
body { background: var(--bg); color: var(--text); overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
header {
  background: #fff; padding: 15px 5%; display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); position: sticky; top: 0; z-index: 100; flex-wrap: wrap; gap: 15px;
}
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer; }
.logo-img { height: 85px; width: 85px; border-radius: 50%; object-fit: contain; background: #fff; }
.header-controls { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; flex-grow: 1; justify-content: flex-end; }

/* Search Bar */
.search-bar { display: flex; align-items: center; background: #f0f2f5; padding: 8px 15px; border-radius: 20px; width: 100%; max-width: 250px; }
.search-bar input { border: none; background: transparent; outline: none; width: 100%; font-size: .9rem; }
.search-btn { background: none; border: none; cursor: pointer; font-size: 1.1rem; padding-left: 5px; }

.hamburger { display: none; background: none; border: none; font-size: 1.8rem; color: var(--primary); cursor: pointer; }

.nav-links { display: flex; gap: 20px; font-weight: 600; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text); transition: .2s; cursor: pointer; }
.nav-links a:hover { color: var(--accent); }

.cart-icon { font-size: 1.5rem; cursor: pointer; position: relative; display: flex; align-items: center; gap: 5px; font-weight: 600; }
.cart-count { position: absolute; top: -8px; left: 15px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 6px; border-radius: 50%; }

/* Mobile nav */
@media (max-width: 768px) {
  .hamburger { display: block; order: 3; }
  .header-controls { order: 2; flex-grow: 1; justify-content: flex-end; }
  .search-bar { max-width: 180px; padding: 6px 10px; }

  .nav-links {
    position: absolute; top: 100%; left: 0; width: 100%; background: #fff; flex-direction: column; padding: 0;
    box-shadow: 0 5px 10px rgba(0,0,0,.1); max-height: 0; overflow: hidden; transition: max-height .3s ease-out;
  }
  .nav-links.active { max-height: 250px; padding: 20px 0; }
  .nav-links a { width: 100%; text-align: center; padding: 10px 0; }
}
@media (max-width: 480px) {
   .logo span { display: none; }
}

/* Page views */
.page-view { display: none; width: 100%; flex-grow: 1; }
.page-view.active { display: block; animation: fadeIn .4s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px);} to { opacity:1; transform: translateY(0);} }

/* Hero */
.hero {
  background: linear-gradient(rgba(255,255,255,.4), rgba(255,255,255,.8)),
    url("https://images.unsplash.com/photo-1543466835-00a7907e9de1?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80") center/cover;
  color: var(--primary); text-align: center; padding: 80px 20px; min-height: 50vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 15px; font-weight: 700; max-width: 800px; }
.hero p { font-size: clamp(1rem, 2vw, 1.2rem); max-width: 600px; font-weight: 600; color: #444; }
.hero-checks { display: flex; gap: 15px; margin-top: 20px; font-weight: 600; color: var(--accent); flex-wrap: wrap; justify-content: center; }

/* Categories */
.category-wrapper { text-align: center; padding: 50px 20px; background: #fff; }
.category-wrapper h2 { margin-bottom: 35px; font-size: 2.2rem; color: var(--primary); position: relative; }
.category-wrapper h2::after {
  content:""; position:absolute; width:80px; height:3px; background:var(--accent);
  bottom:-8px; left:50%; transform:translateX(-50%); border-radius:3px;
}
.visual-categories { display:flex; justify-content:center; gap:25px; flex-wrap:wrap; max-width:1100px; margin:0 auto; }

.cat-mini-banner {
  width:135px; height:135px; border-radius:24px; display:flex; flex-direction:column; justify-content:center; align-items:center;
  box-shadow:0 10px 30px rgba(30,60,90,.15); color:#fff; gap:8px;
}
.cat-mini-banner .emoji { font-size:3.8rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.cat-mini-banner span { font-weight:700; font-size:1.15rem; letter-spacing:.8px; text-shadow:0 2px 6px rgba(0,0,0,.4); }

.bg-all{ background:linear-gradient(135deg,#a18cd1 0%,#fbc2eb 100%);}
.bg-dog{ background:linear-gradient(135deg,#84fab0 0%,#8fd3f4 100%);}
.bg-cat{ background:linear-gradient(135deg,#ff9a9e 0%,#fecfef 100%);}
.bg-bird{ background:linear-gradient(135deg,#f6d365 0%,#fda085 100%);}

/* Promo */
.promo-container {
  max-width:1200px; margin:40px auto; padding:0 20px; display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:20px;
}
.promo-card {
  border-radius:16px; padding:30px; color:#fff; display:flex; flex-direction:column; justify-content:center;
  min-height:200px; box-shadow:0 5px 15px rgba(0,0,0,.08); transition:transform .3s;
}
.promo-card:hover { transform: translateY(-5px); }
.promo-card.blue{ background:linear-gradient(45deg,#4facfe 0%,#00f2fe 100%);}
.promo-card.red{ background:linear-gradient(45deg,#ff0844 0%,#ffb199 100%);}
.promo-card.orange{ background:linear-gradient(45deg,#f6d365 0%,#fda085 100%);}

/* Sections */
.container { max-width:1200px; margin:0 auto 40px; padding:0 20px; width:100%; }
.section-header { text-align:center; margin:60px 0 20px; font-size:2rem; color:var(--primary); }

.fancy-page-header { text-align:center; margin:40px 0 30px; }
.fancy-page-header h2 { font-size:2.4rem; color:var(--primary); margin-bottom:8px; position:relative; }
.fancy-page-header h2::after {
  content:""; position:absolute; width:90px; height:4px; background:linear-gradient(to right,var(--accent),#f4a261);
  bottom:-10px; left:50%; transform:translateX(-50%); border-radius:4px;
}
.fancy-page-header p { color:#555; font-size:1.1rem; max-width:620px; margin:0 auto; line-height:1.5; }
.loading { text-align:center; margin:40px; font-weight:600; color:#666; }

/* Filters */
.page-filters { display:flex; justify-content:center; gap:10px; margin-bottom:30px; flex-wrap:wrap; }
.filter-btn {
  padding:8px 20px; border:2px solid var(--primary); background:transparent; color:var(--primary);
  border-radius:20px; font-weight:600; cursor:pointer; transition:.3s; appearance:none;
}
.filter-btn:hover, .filter-btn.active-filter { background:var(--primary); color:#fff; }

/* Pet grid */
.pet-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:25px; margin-top:20px; align-items:stretch; }

.pet-card {
  background:#fff; border-radius:20px; overflow:hidden; box-shadow:0 8px 25px rgba(0,0,0,.08);
  display:flex; flex-direction:column; transition:all .3s; height:100%;
}
.pet-card:hover { transform:translateY(-8px); box-shadow:0 20px 40px rgba(30,60,90,.15); }

.pet-media-wrap { width:100%; aspect-ratio:4/3; overflow:hidden; background:#eee; }
.pet-image { width:100%; height:100%; object-fit:cover; display:block; background:#eee; cursor: pointer; }

.pet-info { padding:22px; flex-grow:1; display:flex; flex-direction:column; gap:8px; }
.pet-name { font-size:1.2rem; color:var(--primary); font-weight:700; line-height:1.3; }
.pet-price { font-size:1.2rem; color:var(--accent); font-weight:700; margin:4px 0 8px; }
.pet-desc { font-size: 0.85rem; color: #666; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.pet-actions { margin-top:auto; display:flex; gap:8px; }
.buy-btn,.cart-btn {
  width:100%; border:none; padding:12px 14px; border-radius:12px; font-weight:700; cursor:pointer;
  transition:.3s; font-size:.95rem; letter-spacing:.3px; flex:1;
}
.buy-btn{ background:var(--primary); color:#fff; }
.buy-btn:hover{ background:#163148; }
.cart-btn{ background:var(--accent); color:#fff; }
.cart-btn:hover{ background:#d05b3f; }

/* Empty */
.empty-state {
  text-align:center; padding:60px 20px; background:#fff; border-radius:16px; box-shadow:0 5px 15px rgba(0,0,0,.03);
  margin:40px auto; max-width:600px; display:none;
}
.empty-state h3{ color:var(--primary); font-size:1.5rem; margin-bottom:10px; }
.empty-state p{ color:#666; font-size:1.1rem; line-height:1.6; }
.empty-icon{ font-size:3rem; margin-bottom:15px; }

/* Cart */
.cart-overlay {
  position:fixed; top:0; right:-100%; width:100%; height:100dvh; background:rgba(0,0,0,.5);
  z-index:1000; transition:.3s; display:flex; justify-content:flex-end;
}
.cart-overlay.active { right:0; }
.cart-panel {
  width:400px; max-width:100%; background:#fff; height:100%; display:flex; flex-direction:column;
  box-shadow:-5px 0 15px rgba(0,0,0,.1);
}
.cart-header { display:flex; justify-content:space-between; align-items:center; border-bottom:2px solid #eee; padding:20px; }
.close-cart { background:none; border:none; font-size:1.5rem; cursor:pointer; color:red; }
.cart-items { flex-grow:1; overflow-y:auto; padding:20px; }
.cart-item { display:flex; justify-content:space-between; margin-bottom:15px; border-bottom:1px solid #eee; padding-bottom:10px; align-items:center; }
.remove-btn { background:#ff4757; color:#fff; border:none; padding:6px 12px; border-radius:5px; cursor:pointer; font-size:.85rem; font-weight:600; }

.cart-footer {
  border-top:2px solid #eee; padding:20px; background:#fff; padding-bottom:calc(20px + env(safe-area-inset-bottom));
}
.cart-total { font-size:1.5rem; font-weight:700; display:flex; justify-content:space-between; margin-bottom:15px; color:var(--primary); }
.checkout-btn {
  width:100%; background:var(--accent); color:#fff; padding:15px; border:none; border-radius:8px; font-size:1.2rem; font-weight:700; cursor:pointer;
}
.checkout-btn:hover { background:#d05b3f; }

/* Floating */
.floating-container { position:fixed; bottom:40px; right:20px; display:flex; flex-direction:column; gap:15px; z-index:900; align-items:flex-end; }
.float-btn {
  width:50px; height:50px; border-radius:50%; display:flex; justify-content:center; align-items:center;
  font-size:1.5rem; text-decoration:none; box-shadow:0 4px 10px rgba(0,0,0,.2); transition:.3s; cursor:pointer;
}
.home-btn { background:var(--primary); color:#fff; opacity:0; pointer-events:none; }
.home-btn.visible { opacity:1; pointer-events:auto; }
.wa-btn {
  background:#25d366; color:#fff; width:auto; height:auto; padding:12px 20px; border-radius:30px;
  font-size:1rem; font-weight:600; gap:8px;
}
.wa-btn:hover { transform:scale(1.05); }

/* Footer */
footer { background:var(--primary); color:#fff; text-align:center; padding:40px 20px; margin-top:auto; }
footer h3 { margin-bottom:10px; }
footer p { opacity:.8; font-size:.9rem; }

/* Media Modal */
.media-modal {
  display: none; position: fixed; z-index: 2000; top: 0; left: 0;
  width: 100%; height: 100%; background-color: rgba(0,0,0,0.9);
  justify-content: center; align-items: center;
}
.media-modal.active { display: flex; animation: fadeIn 0.3s; }
.media-modal-content { max-width: 90%; max-height: 90%; text-align: center; }
.media-modal-content img, .media-modal-content video {
  max-width: 100%; max-height: 85vh; border-radius: 8px; object-fit: contain;
}
.close-modal {
  position: absolute; top: 20px; right: 30px; color: white;
  font-size: 40px; font-weight: bold; cursor: pointer;
}

/* Small screens */
@media (max-width: 600px) {
  .pet-grid { grid-template-columns:1fr 1fr; gap:14px; }
  .pet-info { padding:14px; }
  .pet-name { font-size:1rem; }
  .pet-price { font-size:1rem; margin:8px 0; }
  .pet-actions { flex-direction: column; gap:6px; }
  .buy-btn,.cart-btn { font-size:.84rem; padding:8px; }
  .fancy-page-header h2 { font-size:1.8rem; }
  .section-header { font-size:1.6rem; }
}
