:root {
  --accent: #009999;
  --accent-dark: #007a7a;
  --danger: #d92b2b;
  --navy: #16263f;
  --navy-soft: #22385c;
  --sand: #f6f4ef;
  --ink: #1d2733;
  --muted: #66707c;
  --line: #e4e1da;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(22, 38, 63, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--sand);
  color: var(--ink);
  line-height: 1.55;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

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

/* ---------- header ---------- */
.topbar {
  background: var(--accent);
  color: var(--white);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  letter-spacing: 0.3px;
}

header.site {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--navy);
  white-space: nowrap;
}
.logo span { color: var(--accent); }

.search-form {
  flex: 1;
  display: flex;
  max-width: 460px;
}
.search-form input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
}
.search-form input:focus { border-color: var(--navy); }
.search-form button {
  border: none;
  background: var(--navy);
  color: var(--white);
  padding: 0 16px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-size: 15px;
}
.search-form button:hover { background: var(--navy-soft); }

.cart-link {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}
.cart-count {
  background: var(--accent);
  color: var(--white);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  padding: 0 6px;
}

nav.cats {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 10px;
}
nav.cats a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}
nav.cats a:hover, nav.cats a.active { background: var(--navy); color: var(--white); }
nav.cats a.clearance { color: var(--accent); }
nav.cats a.clearance:hover, nav.cats a.clearance.active { background: var(--accent); color: var(--white); }
nav.cats a.pool-finder { color: var(--accent); }
nav.cats a.pool-finder:hover, nav.cats a.pool-finder.active { background: var(--accent); color: var(--white); }
nav.cats a.swim-meet { color: var(--accent); }
nav.cats a.swim-meet:hover, nav.cats a.swim-meet.active { background: var(--accent); color: var(--white); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-soft) 55%, #35558a 100%);
  color: var(--white);
  border-radius: var(--radius);
  margin-top: 24px;
  padding: 56px 48px;
  position: relative;
  overflow: hidden;
}
.hero h1 { font-size: 40px; margin: 0 0 10px; letter-spacing: -1px; }
.hero p { font-size: 17px; margin: 0 0 24px; opacity: 0.9; max-width: 520px; }
.hero .wave {
  position: absolute;
  right: -40px;
  bottom: -60px;
  font-size: 220px;
  opacity: 0.12;
  transform: rotate(-8deg);
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--accent-dark); color: var(--white); }
.btn.secondary { background: var(--navy); }
.btn.secondary:hover { background: var(--navy-soft); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.ghost:hover { background: var(--navy); color: var(--white); }
.btn:disabled { background: #b8bec6; cursor: not-allowed; }
.btn.small { padding: 7px 14px; font-size: 13px; }

/* ---------- sections ---------- */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 40px 0 18px;
}
.section-title h2 { margin: 0; font-size: 24px; letter-spacing: -0.4px; }
.section-title a { font-weight: 600; font-size: 14px; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.cat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s ease;
}
.cat-card:hover { transform: translateY(-3px); }
.cat-card img { width: 100%; height: 140px; object-fit: cover; }
.cat-card .body { padding: 14px 16px 16px; }
.cat-card h3 { margin: 0 0 4px; font-size: 17px; color: var(--navy); }
.cat-card p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-3px); }
.card img { width: 100%; height: 180px; object-fit: cover; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card .sub { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 4px; }
.card h3 { margin: 0 0 8px; font-size: 15.5px; line-height: 1.35; color: var(--ink); }
.card .price-row { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.price { font-weight: 800; font-size: 17px; color: var(--navy); }
.price.sale { color: var(--accent); }
.price-was { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.badge.out { background: var(--muted); }

/* ---------- shop page ---------- */
.page-head { margin: 28px 0 6px; }
.page-head h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -0.6px; }
.page-head p { margin: 0; color: var(--muted); }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0 20px;
}
.chip {
  border: 1.5px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.chip.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.filter-row select {
  margin-left: auto;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  background: var(--white);
}

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- product page ---------- */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  margin-top: 30px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.product-layout img { width: 100%; border-radius: 8px; background: var(--sand); }
.product-info h1 { margin: 0 0 8px; font-size: 27px; letter-spacing: -0.5px; }
.product-info .sub { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; }
.product-info .price-row { margin: 14px 0; display: flex; align-items: center; gap: 10px; }
.product-info .price { font-size: 26px; }
.product-info .desc { color: var(--ink); }
.stock-note { font-size: 13.5px; font-weight: 600; margin: 6px 0 18px; }
.stock-note.in { color: #1c7c3c; }
.stock-note.low { color: #c07b00; }
.stock-note.out { color: var(--danger); }

.opt-row { margin-bottom: 16px; }
.opt-row label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.opt-row select, .opt-row input[type="number"] {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14.5px;
  background: var(--white);
  min-width: 110px;
}

/* ---------- cart / checkout ---------- */
.cart-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cart-table th, .cart-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.cart-table th { background: var(--navy); color: var(--white); font-size: 13px; letter-spacing: 0.5px; text-transform: uppercase; }
.cart-table input[type="number"] { width: 64px; border: 1.5px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.link-btn { background: none; border: none; color: var(--danger); font-weight: 600; cursor: pointer; font-size: 13.5px; padding: 0; }
.link-btn:hover { text-decoration: underline; }

.summary-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.summary-card h3 { margin: 0 0 14px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14.5px; }
.summary-row.total { font-weight: 800; font-size: 18px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.free-ship-note { font-size: 12.5px; color: #1c7c3c; font-weight: 600; }

.checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 24px; align-items: start; }
.cart-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-top: 24px; align-items: start; }

form.checkout { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
form.checkout h3 { margin: 0 0 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
form.checkout label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
form.checkout input, form.checkout textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14.5px;
  font-family: inherit;
}
form.checkout input:focus, form.checkout textarea:focus { outline: none; border-color: var(--navy); }

.alert { background: #fdecec; border: 1px solid #f5b5b5; color: #8e1c1c; border-radius: 8px; padding: 12px 16px; margin: 14px 0; font-size: 14px; }
.confirm-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 32px;
  text-align: center;
  margin-top: 40px;
}
.confirm-card .check { font-size: 54px; }
.confirm-card h1 { margin: 10px 0 6px; }
.confirm-card .order-id { font-family: ui-monospace, Consolas, monospace; background: var(--sand); padding: 6px 14px; border-radius: 8px; display: inline-block; font-weight: 700; margin: 10px 0 18px; }

/* ---------- admin ---------- */
.admin-tabs { display: flex; gap: 8px; margin: 24px 0 18px; }
.admin-tabs button {
  border: 1.5px solid var(--line);
  background: var(--white);
  border-radius: 8px;
  padding: 9px 20px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.admin-tabs button.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { background: var(--navy); color: var(--white); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table select { border: 1.5px solid var(--line); border-radius: 6px; padding: 5px 8px; }

.admin-form { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 24px; }
.admin-form h3 { margin: 0 0 14px; }
.admin-form .form-grid { grid-template-columns: repeat(3, 1fr); }
.admin-form label { display: block; font-weight: 700; font-size: 12.5px; margin-bottom: 3px; }
.admin-form input, .admin-form select, .admin-form textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
}
.admin-form .actions { display: flex; gap: 10px; margin-top: 14px; }

.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-new { background: #fff3cd; color: #8a6100; }
.status-processing { background: #d8e7ff; color: #1c4d9c; }
.status-shipped { background: #d9f2e3; color: #1c7c3c; }
.status-completed { background: #e6e6e6; color: #444; }
.status-cancelled { background: #fdecec; color: #a12020; }

.login-card { max-width: 380px; margin: 80px auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; text-align: center; }
.login-card input { width: 100%; border: 1.5px solid var(--line); border-radius: 8px; padding: 11px 14px; font-size: 15px; margin: 14px 0; }

/* ---------- footer ---------- */
footer.site {
  margin-top: 64px;
  background: var(--navy);
  color: #c6d0de;
  padding: 36px 0;
  font-size: 14px;
}
footer.site .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
footer.site a { color: #ffffff; }
footer.site a:hover { color: #7fd6d6; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .header-row { flex-wrap: wrap; }
  .search-form { order: 3; max-width: none; width: 100%; }
  .product-layout, .checkout-layout, .cart-layout { grid-template-columns: 1fr; }
  .hero { padding: 36px 24px; }
  .hero h1 { font-size: 30px; }
  .form-grid, .admin-form .form-grid { grid-template-columns: 1fr; }
  .cart-table th:nth-child(2), .cart-table td:nth-child(2) { display: none; }
}
