/* River City Hardware */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --accent: #b91c1c;
  --accent-hover: #991b1b;
  --border: #e7e5e4;
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  color: var(--accent-hover);
}

.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
}

.agency-back-bar {
  position: sticky;
  top: 0;
  z-index: 300;
  background: #1c1917;
  color: #fafaf9;
  text-align: left;
  padding: 0.55rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(185, 28, 28, 0.45);
}

.agency-back-bar a {
  color: #fca5a5;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.store-top {
  background: #292524;
  color: #e7e5e4;
  font-size: 0.85rem;
  text-align: center;
  padding: 0.4rem 1rem;
}

.store-top a {
  color: #fecaca;
}

.hw-header {
  position: sticky;
  top: 2.75rem;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.hw-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}

.hw-logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hw-logo span {
  color: var(--accent);
}

.hw-nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 0.45rem;
  cursor: pointer;
}

.hw-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.35rem;
  align-items: center;
}

.hw-nav a {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
}

.hw-nav a:hover,
.hw-nav a[aria-current="page"] {
  color: var(--text);
}

.cart-link .cart-count {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.15rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  border: 2px solid var(--border);
  color: var(--text);
}

.hero-hw {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  background: linear-gradient(135deg, #fef2f2 0%, #fff 50%);
}

.hero-hw-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 860px) {
  .hero-hw-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-hw h1 {
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  font-weight: 800;
}

.hero-hw p {
  color: var(--muted);
  margin: 0 0 1.25rem;
  max-width: 42ch;
}

.hero-hw-img {
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.2);
}

.hero-hw-img img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

section {
  padding: clamp(2.25rem, 5vw, 3.5rem) 0;
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.section-lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 56ch;
}

.cat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.25s ease;
  color: inherit;
  text-decoration: none;
  display: block;
}

.cat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 32px -20px rgba(185, 28, 28, 0.25);
  transform: translateY(-3px);
}

a.cat-card-visual {
  position: relative;
  min-height: 148px;
  padding: 0;
  overflow: hidden;
}

.cat-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

a.cat-card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 15, 15, 0.72), transparent 55%);
  pointer-events: none;
}

a.cat-card-visual:hover .cat-card-bg {
  transform: scale(1.08);
}

.cat-card-label {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  z-index: 1;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.catalog-cat-banner {
  margin: 0 0 1.25rem;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px -28px rgba(0, 0, 0, 0.18);
}

.catalog-cat-banner img {
  width: 100%;
  aspect-ratio: 21/9;
  object-fit: cover;
  display: block;
  max-height: 220px;
}

.catalog-cat-banner figcaption {
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  position: sticky;
  top: calc(2.75rem + 2.85rem);
  z-index: 25;
  padding: 0.65rem 0;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
}

.catalog-toolbar a {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.catalog-toolbar a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.catalog-block {
  margin-bottom: 3rem;
}

.catalog-block .section-title {
  scroll-margin-top: 8rem;
}

.product-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  box-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.15);
  border-color: rgba(185, 28, 28, 0.35);
}

.product-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover img {
  transform: scale(1.04);
}

.product-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-body .btn {
  margin-top: auto;
  width: 100%;
}

.product-body h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.product-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.product-price {
  font-weight: 800;
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.cart-table th,
.cart-table td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.cart-summary {
  max-width: 380px;
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: 0 12px 40px -28px rgba(0, 0, 0, 0.12);
}

.cart-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.cart-row.total {
  font-weight: 800;
  font-size: 1.05rem;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 2px solid var(--border);
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.qty-row button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 560px) {
  .form-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.card-ui {
  background: linear-gradient(145deg, #1c1917, #44403c);
  border-radius: 14px;
  padding: 1.25rem;
  margin: 1rem 0;
}

.card-ui label {
  color: #a8a29e;
}

.card-ui input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.success-banner {
  display: none;
  padding: 1rem;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  font-weight: 700;
  margin-bottom: 1rem;
}

.success-banner.visible {
  display: block;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.hw-footer {
  background: #1c1917;
  color: #a8a29e;
  padding: 2rem 0;
  font-size: 0.9rem;
  margin-top: 2rem;
}

.hw-footer h3 {
  color: #fff;
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
}

.hw-footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .hw-footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  height: 260px;
}

.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .hw-nav-toggle {
    display: grid;
    place-items: center;
  }

  .hw-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: 8.5rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
  }

  .hw-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .hw-nav ul {
    flex-direction: column;
    align-items: stretch;
  }
}
