:root {
  --color-black: #000000;
  --color-white: #ffffff;
  --color-red: #e2231a;
  --color-bisque: bisque;
  --font-main: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--color-black);
  line-height: 1.4;
}

a {
  color: inherit;
}

.button {
  display: inline-block;
  font-family: var(--font-main);
  background-color: var(--color-black);
  color: var(--color-white);
  text-decoration: none;
  text-align: center;
  padding: 15px 25px;
  font-weight: bold;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.button:hover {
  transform: scale(1.05);
}

.button-primary {
  background-color: var(--color-red);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  background-color: var(--color-black);
  color: var(--color-white);
}

.wordmark {
  font-weight: bold;
  font-size: 16px;
  line-height: 1.2;
}

.wordmark span {
  color: var(--color-red);
}

.site-header nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
}

.site-header nav a {
  color: var(--color-white);
  text-decoration: none;
  font-weight: bold;
}

.site-header nav a:hover {
  text-decoration: underline;
}

.cart-toggle {
  position: relative;
  background: none;
  border: 2px solid var(--color-white);
  border-radius: 10px;
  color: var(--color-white);
  font-size: 20px;
  padding: 8px 14px;
  cursor: pointer;
}

.cart-badge {
  display: inline-block;
  min-width: 18px;
  padding: 2px 5px;
  border-radius: 100px;
  background-color: var(--color-red);
  color: var(--color-white);
  font-size: 12px;
  font-weight: bold;
  vertical-align: top;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background-color: var(--color-black);
  color: var(--color-white);
}

.hero-content h1 {
  font-size: 28px;
  margin-bottom: 15px;
}

.hero-content p {
  font-size: 18px;
  margin-bottom: 25px;
}

/* Catalog */
.catalog {
  padding: 60px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.catalog h2 {
  font-size: 26px;
  margin-bottom: 30px;
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* Footer */
.site-footer {
  padding: 40px 20px 20px;
  background-color: var(--color-black);
  color: var(--color-white);
  text-align: center;
}

.footer-wordmark {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  list-style: none;
  margin-bottom: 20px;
}

.footer-links a {
  text-decoration: none;
  font-weight: bold;
}

.footer-links a:hover {
  text-decoration: underline;
}

.site-footer hr {
  border: none;
  height: 1px;
  background-color: var(--color-bisque);
  margin: 20px 0;
}

.site-footer p {
  color: rgb(193, 193, 193);
  font-size: 14px;
}

/* Product cards */
.product-card {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--color-black);
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--color-white);
}

.product-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background-color: var(--color-white);
  background-image: linear-gradient(45deg, #000 25%, transparent 25%),
    linear-gradient(-45deg, #000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000 75%),
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
}

.product-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: var(--color-red);
  color: var(--color-white);
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 100px;
}

.product-name {
  font-size: 16px;
  padding: 12px 12px 0;
  min-height: 44px;
}

.product-price {
  font-size: 18px;
  font-weight: bold;
  padding: 8px 12px;
}

.product-add {
  margin: 0 12px 12px;
  border-radius: 10px;
  font-size: 14px;
  padding: 10px 15px;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 40;
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Cart drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 340px;
  max-width: 90vw;
  background-color: var(--color-white);
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background-color: var(--color-black);
  color: var(--color-white);
}

.drawer-close {
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 24px;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-empty {
  text-align: center;
  color: #777;
  margin-top: 20px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.cart-item-name {
  font-weight: bold;
  font-size: 14px;
}

.cart-item-price {
  font-size: 13px;
  color: #555;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-black);
  border-radius: 6px;
  background-color: var(--color-white);
  cursor: pointer;
  font-weight: bold;
}

.qty-value {
  min-width: 18px;
  text-align: center;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--color-red);
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 6px;
}

.cart-footer {
  padding: 20px;
  border-top: 2px solid var(--color-black);
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 15px;
}

.cart-footer .button {
  width: 100%;
}

/* Checkout modal */
.hidden {
  display: none;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: 400px;
  max-width: 90vw;
  background-color: var(--color-white);
  border-radius: 10px;
  padding: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 60;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

.modal h2 {
  margin-bottom: 10px;
}

.modal p {
  margin-bottom: 20px;
  color: #555;
}

#checkout-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#checkout-form label {
  font-weight: bold;
  font-size: 14px;
  margin-top: 10px;
}

#checkout-form input {
  padding: 10px;
  border: 2px solid var(--color-black);
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 14px;
}

#checkout-form button {
  margin-top: 20px;
}

#checkout-thanks-view {
  text-align: center;
}

#checkout-thanks-view .button {
  margin-top: 10px;
}

.hero {
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.08) 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
}

@media (min-width: 768px) {
  .site-header {
    padding: 20px 40px;
  }

  .hero-content h1 {
    font-size: 36px;
  }

  .hero-content p {
    font-size: 20px;
  }
}

@media (min-width: 1024px) {
  .site-header {
    padding: 20px 80px;
  }

  .hero {
    padding: 120px 20px;
  }

  .hero-content h1 {
    font-size: 44px;
  }

  .catalog {
    padding: 80px 40px;
  }
}

@media (max-width: 480px) {
  .site-header {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .site-header nav {
    order: 3;
    width: 100%;
    justify-content: center;
    display: flex;
  }

  .cart-drawer {
    width: 100%;
    max-width: 100vw;
  }
}
