:root {
  --navy: #1B2A4A;
  --orange: #F5A623;
  --orange-dark: #d68f17;
  --text: #1B2A4A;
  --muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #FFF7E6;
  --line: #e5e7eb;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

.header {
  background: var(--navy);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header .brand {
  display: flex;
  align-items: center;
}
.header .brand img {
  height: 28px;
  width: auto;
  display: block;
}
@media (max-width: 480px) { .header .brand img { height: 24px; } }
.header .nav { display: flex; gap: 20px; align-items: center; }
.header .nav a { color: #fff; font-weight: 600; font-size: 14px; }
.header .nav a:hover { color: var(--orange); text-decoration: none; }
.cart-btn {
  position: relative;
  background: var(--orange);
  color: var(--navy);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 14px;
}
.cart-btn:hover { background: var(--orange-dark); color: var(--navy); text-decoration: none; }
.cart-count {
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
  min-width: 18px;
  display: inline-block;
  text-align: center;
}

.container { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }

.hero {
  text-align: center;
  padding: 40px 20px 24px;
}
.hero h1 {
  font-size: 36px;
  margin: 0 0 8px;
  color: var(--navy);
}
.hero p {
  color: var(--muted);
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.product-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  color: var(--text);
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  text-decoration: none;
}
.product-card-img-wrap {
  background: #f4f4f4;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff; /* breed-tee mockups are transparent PNGs; match the white Printful photos */
}
.product-card-body { padding: 16px; }
.product-card-body h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}
.product-card-body .price {
  margin: 0;
  color: var(--orange);
  font-weight: 800;
  font-size: 16px;
}

/* PDP */
.pdp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 16px;
}
@media (max-width: 720px) { .pdp { grid-template-columns: 1fr; gap: 24px; } }
.pdp-img-wrap {
  background: #f4f4f4;
  border-radius: 12px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.pdp-img-wrap img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.pdp-thumb-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pdp-thumb {
  width: 80px;
  height: 80px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  transition: border-color 0.1s, transform 0.1s;
}
.pdp-thumb:hover { border-color: var(--orange); transform: translateY(-1px); }
.pdp-thumb.selected { border-color: var(--orange); }
.pdp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  background: #f4f4f4;
  display: block;
}
.pdp h1 {
  font-size: 28px;
  margin: 0 0 8px;
}
.pdp .price {
  color: var(--orange);
  font-weight: 800;
  font-size: 22px;
  margin: 0 0 20px;
}
.pdp .field { margin-bottom: 18px; }
.pdp .field label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.option-group { display: flex; flex-wrap: wrap; gap: 8px; }
.option-btn {
  border: 2px solid var(--line);
  background: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.1s, background 0.1s;
}
.option-btn:hover { border-color: var(--orange); }
.option-btn.selected { border-color: var(--orange); background: var(--bg-soft); color: var(--navy); }
.option-select {
  width: 100%;
  max-width: 360px;
  border: 2px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}
.option-select:focus { outline: none; border-color: var(--orange); }
.option-btn.unavailable {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.qty-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  color: var(--navy);
}
.qty-btn:hover { border-color: var(--orange); }
.qty-val { font-weight: 800; min-width: 28px; text-align: center; font-size: 16px; }

.btn-primary {
  background: var(--orange);
  color: var(--navy);
  border: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
  transition: background 0.1s;
}
.btn-primary:hover { background: var(--orange-dark); }
.btn-primary:disabled { background: #d1d5db; color: #6b7280; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary:hover { background: var(--navy); color: #fff; text-decoration: none; }

/* Cart */
.cart-empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th { text-align: left; padding: 12px 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; border-bottom: 2px solid var(--line); }
.cart-table td { padding: 16px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #f4f4f4; }
.cart-row-name { font-weight: 700; }
.cart-row-variant { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cart-totals { text-align: right; font-size: 18px; font-weight: 800; margin: 16px 0 24px; }
.cart-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
}
.cart-remove:hover { color: #b91c1c; }

/* Phones: the 5-column cart table needs ~431px and runs off-screen on mobile.
   Collapse each row into a stacked card so checkout stays within the viewport. */
@media (max-width: 560px) {
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody { display: block; width: 100%; }
  .cart-table tr {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    grid-template-areas:
      "img info remove"
      "img qty  sub";
    column-gap: 12px;
    row-gap: 8px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .cart-table td { display: block; border: none; padding: 0; }
  .cart-table td:nth-child(1) { grid-area: img; align-self: start; }
  .cart-table td:nth-child(2) { grid-area: info; }
  .cart-table td:nth-child(3) { grid-area: qty; }
  .cart-table td:nth-child(4) { grid-area: sub; justify-self: end; text-align: right !important; }
  .cart-table td:nth-child(5) { grid-area: remove; justify-self: end; }
}

.message { padding: 16px; border-radius: 6px; margin: 16px 0; font-size: 14px; }
.message.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.message.info { background: var(--bg-soft); color: #92400e; border-left: 3px solid var(--orange); }

.footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 48px;
}
.footer a { color: var(--orange); }

/* Product description under Add to Cart */
.pdp-desc { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--text); font-size: 15.5px; line-height: 1.6; }
.pdp-desc p { margin: 0 0 12px; }
.pdp-desc ul { margin: 0 0 14px; padding-left: 20px; }
.pdp-desc li { margin: 4px 0; }
.pdp-desc .pdp-note { color: var(--muted); font-size: 14px; margin: 0; }
