/* CarePets shared theme: tokens, base type, header, buttons, cards, feature
   strip, product cards, cart drawer and footer. Used by every page.
   Homepage-specific layout lives in essentials.css. */

:root {
  --bg: #ffffff;
  --cream: #fdf9f3;
  --surface: #ffffff;
  --text: #13213d;
  --muted: #5d6475;
  --border: #e6e8e3;
  --border-strong: #d7dad3;
  --green: #5f9142;
  --green-ink: #44702d; /* green for text links: readable on white */
  --green-soft: #eef4e8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgb(19 33 61 / .05);
  --wrap: 1296px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 Barlow, system-ui, sans-serif;
}

a { color: inherit; }
p > a { color: var(--green-ink); font-weight: 500; }
p > a:hover { color: var(--text); }

h1, h2, h3 { font-family: Barlow, system-ui, sans-serif; }
h1, h2 { font-weight: 600; line-height: 1.15; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 10px 32px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo img { width: 64px; height: 64px; }
.wordmark { display: block; font-size: 2.6rem; font-weight: 600; line-height: 1; letter-spacing: -.01em; color: var(--text); }
.wordmark em { font-style: normal; color: var(--green); }
.tagline { display: block; font-size: .8rem; letter-spacing: .25em; text-transform: uppercase; margin-top: 4px; padding-left: 2px; }
.site-nav { display: flex; gap: 32px; margin-left: auto; }
.site-nav a { text-decoration: none; font-size: 1.15rem; font-weight: 500; white-space: nowrap; }
.site-nav a:hover { color: var(--green); }
.cart-btn { position: relative; background: none; border: 0; color: var(--text); cursor: pointer; padding: 6px; margin-left: 16px; }
.cart-btn .cart-count {
  position: absolute; top: -4px; right: -8px;
  background: var(--green); color: #fff;
  min-width: 22px; height: 22px; line-height: 22px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; text-align: center; padding: 0 5px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 26px; border: 0; border-radius: var(--radius-sm);
  font: 500 1.25rem/1.6 Barlow, system-ui, sans-serif; text-decoration: none;
  cursor: pointer; transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--text); color: #fff; }

/* Square outline add-to-cart button; widens when it has a text label. */
.add-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 52px; height: 52px; padding: 0 13px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: var(--text);
  font: 500 1.05rem Barlow, system-ui, sans-serif; cursor: pointer;
}
.add-btn:hover { border-color: var(--text); }

/* Small labels */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 10px 18px; margin: 0 0 24px;
  font-size: .95rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
}
.pill svg { color: var(--green); }
.tag {
  position: absolute; top: 12px; left: 12px; z-index: 1; margin: 0;
  background: var(--green); color: #fff; font-size: .95rem; font-weight: 500;
  padding: 3px 10px; border-radius: 6px;
}
.tag-new { background: #a78bfa; }

/* Hero band */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  padding: 40px max(32px, calc((100% - var(--wrap)) / 2)) 64px;
  background: var(--cream);
}
.hero-copy { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.2rem, 3.9vw, 3.6rem); font-weight: 700; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 24px; }
.hero h1 em { font-style: normal; color: var(--green); }
.lead { font-size: 1.35rem; color: var(--muted); max-width: 34ch; margin: 0 0 36px; }
.actions { display: flex; flex-wrap: wrap; gap: 20px; }

/* Feature strip: a card with circle line icons, overlapping the hero band */
.features {
  position: relative;
  width: min(var(--wrap), 100% - 64px);
  margin: -56px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 0;
}
.feature { display: flex; gap: 22px; align-items: center; padding: 0 24px; }
.feature + .feature { border-left: 1px solid var(--border); }
.feature h2 { font-size: 1.4rem; font-weight: 500; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 1.1rem; line-height: 1.4; }
.icon { flex: none; display: grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; background: var(--green-soft); color: var(--text); }
.icon svg { width: 46px; height: 46px; }

/* Sections */
.section { width: min(var(--wrap), 100% - 64px); margin: 0 auto; padding: 48px 0 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 20px; }
.section-head h2, .section > h2 { font-size: 2.1rem; font-weight: 600; margin: 0; }
.section-head p { margin: 0; color: var(--muted); font-size: 1.15rem; }
.section-head a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.15rem; }

/* Product cards */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff;
}
.product img { display: block; width: 100%; aspect-ratio: 300 / 203; object-fit: contain; background: #fefbf9; }
.product-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.product h3 { font-size: 1.3rem; font-weight: 500; margin: 0 0 2px; }
.product-body > p { margin: 0 0 12px; color: var(--muted); font-size: 1.1rem; }
.product-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; }
.price { font-size: 1.5rem; font-weight: 600; }
.price s { color: var(--muted); font-size: 1.1rem; font-weight: 400; margin-left: 6px; }


/* Footer */
.footer { text-align: center; color: var(--muted); font-size: .9rem; padding: 40px 16px; }

/* Cart drawer */
.cart-backdrop { position: fixed; inset: 0; background: rgb(19 33 61 / .35); z-index: 10; }
.cart {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 11;
  width: min(400px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  padding: 24px; display: flex; flex-direction: column; overflow-y: auto;
}
.cart[hidden], .cart-backdrop[hidden] { display: none; }
.cart-head { display: flex; justify-content: space-between; align-items: center; }
.cart-head h2 { margin: 0; font-size: 1.5rem; }
.cart-close { background: none; border: 0; color: var(--text); font-size: 1.2rem; cursor: pointer; padding: 8px; }
.cart-items { list-style: none; padding: 0; margin: 20px 0; }
.cart-items li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); background: #fff; color: var(--text); cursor: pointer; font: inherit; line-height: 1; }
.qty button:hover { border-color: var(--text); }
.cart-line { font-weight: 600; min-width: 3ch; text-align: right; }
.cart-empty { color: var(--muted); }
.cart-foot { margin-top: auto; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.1rem; margin: 0 0 4px; }
.cart-total strong { font-weight: 600; }
.cart-ship { color: var(--muted); font-size: .9rem; margin: 0 0 16px; }
.checkout { width: 100%; padding: 14px 22px; font-size: 1.1rem; }
.checkout:disabled { opacity: .7; cursor: progress; transform: none; }
.checkout-note { color: var(--muted); font-size: .9rem; margin: 12px 0 0; }
.secure-note { color: var(--muted); font-size: .8rem; text-align: center; margin: 10px 0 0; }

@media (max-width: 1100px) {
  .site-nav { gap: 20px; }
  .site-nav a { font-size: 1rem; }
  .features { grid-template-columns: repeat(2, 1fr); row-gap: 24px; }
  .feature:nth-child(3) { border-left: 0; }
  .products { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; padding: 10px 16px 0; gap: 12px; }
  .logo img { width: 48px; height: 48px; }
  .wordmark { font-size: 1.9rem; }
  .tagline { font-size: .65rem; }
  .cart-btn { margin-left: auto; }
  /* Nav drops to its own row and scrolls sideways if it runs out of room. */
  .site-nav {
    order: 3; width: 100%; margin: 0; gap: 16px; justify-content: space-between;
    overflow-x: auto; scrollbar-width: none;
    border-top: 1px solid var(--border); padding: 10px 0;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { font-size: 1rem; }
  .site-nav .nav-extra { display: none; } /* duplicate links that don't fit */
  .hero { grid-template-columns: 1fr; padding: 24px 16px 48px; }
  .pill { font-size: .72rem; letter-spacing: .04em; padding: 8px 12px; gap: 6px; }
  .lead { font-size: 1.15rem; }
  .btn { font-size: 1.1rem; padding: 14px 20px; }
  .features { grid-template-columns: 1fr; width: calc(100% - 32px); margin-top: -32px; }
  .feature + .feature { border-left: 0; border-top: 1px solid var(--border); padding-top: 20px; }
  .icon { width: 64px; height: 64px; }
  .icon svg { width: 36px; height: 36px; }
  .section { width: calc(100% - 32px); }
  .section-head { flex-direction: column; }
  .products { grid-template-columns: 1fr; }
}

/* Contact */
.contact { display: flex; align-items: center; gap: 22px; }
.contact h2 { font-size: 2.1rem; margin: 0 0 4px; }
.contact p { color: var(--muted); font-size: 1.15rem; margin: 0; }

/* Order confirmation */
.thanks { padding: 64px 16px 80px; background: var(--cream); text-align: center; }
.thanks-inner { max-width: 640px; margin: 0 auto; }
.thanks .icon { margin: 0 auto 24px; background: #fff; color: var(--green); }
.thanks h1 { font-size: clamp(2.2rem, 3.9vw, 3.2rem); font-weight: 700; line-height: 1.12; margin: 0 0 20px; }
.thanks h1 em { font-style: normal; color: var(--green); white-space: nowrap; }
.thanks .lead { margin: 0 auto 20px; max-width: 40ch; }
.thanks p:not(.lead):not(.pill) { color: var(--muted); font-size: 1.1rem; margin: 0 0 32px; }

@media (max-width: 760px) {
  .contact h2 { font-size: 1.8rem; }
  .contact { align-items: flex-start; }
  .thanks { padding: 48px 16px 64px; }
}
