
:root {
  --red: #ed2939;
  --black: #111;
  --gray: #777;
  --bg: #f5f4f1;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body { margin: 0; background: var(--bg); color: var(--black); font: 14px Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; flex-wrap: wrap; gap: 20px;
  padding: 16px 4%; background: var(--black); color: white;
  border-bottom: 3px solid var(--red);
}
.brand { font-size: 23px; font-weight: 1000; white-space: nowrap; }
.brand span, footer span { color: var(--red); }
.search { display: flex; flex: 1; min-width: 180px; max-width: 420px; }
.search input { width: 100%; min-width: 0; padding: 12px; border: 0; }
.search button { border: 0; padding: 0 13px; background: var(--red); color: white; font-weight: bold; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-left: auto; }
nav a, nav button { border: 0; background: none; color: white; font-size: 12px; font-weight: bold; text-transform: uppercase; }
nav a:hover, nav button:hover { color: var(--red); }

.container { width: min(1300px, 94%); margin: auto; }
.hero {
  min-height: 330px; margin: 22px 0; padding: 42px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  color: white; background: linear-gradient(100deg, #111 30%, #111b), url("https://images.unsplash.com/photo-1523398002811-999ca8dec234?auto=format&fit=crop&w=1400&q=80") center/cover;
}
.tag { color: #ffcf32; font-weight: bold; letter-spacing: 2px; }
.hero h1 { margin: 5px 0; font-size: clamp(42px, 7vw, 75px); line-height: .95; }
.hero h1 span { color: var(--red); }
.hero p { line-height: 1.6; }
.button { display: inline-block; border: 0; padding: 13px 18px; background: var(--red); color: white; font-weight: 900; }
.button:hover { background: #c91d2b; }
section { scroll-margin-top: 130px; }
.section-title { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; border-bottom: 3px solid var(--black); margin-bottom: 18px; }
.section-title h2 { font-size: 25px; margin: 0 0 12px; font-weight: 1000; }
.section-title span { color: var(--gray); font-size: 11px; font-weight: bold; }
.categories { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 16px; }
.categories button, .outline { padding: 10px 15px; border: 1px solid #ccc; background: white; font-weight: bold; }
.categories button.active, .categories button:hover { background: var(--black); color: white; border-color: var(--black); }

.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.product { display: flex; flex-direction: column; background: white; border: 1px solid #e2e2e2; transition: transform .2s; }
.product:hover { transform: translateY(-3px); }
.product img { width: 100%; height: 210px; object-fit: contain; background: #eee; }
.product h3 { margin: 12px 12px 5px; font-size: 14px; }
.product p { margin: 5px 12px; color: var(--gray); line-height: 1.4; }
.product .price { margin: 8px 12px; font-size: 17px; font-weight: 900; color: var(--black); }
.product button { margin: auto 10px 10px; padding: 12px; background: var(--black); color: white; border: 0; font-weight: bold; }
.product button:hover { background: var(--red); }

.panel { margin: 35px 0; padding: 22px; background: white; border: 1px solid #ddd; }
.cart-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #ddd; }
.cart-row img { width: 75px; height: 75px; object-fit: contain; background: #eee; }
.cart-row h3 { margin: 0 0 8px; }
.cart-row button { padding: 6px 10px; margin: 3px; border: 1px solid #ddd; background: white; }
.total { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-top: 20px; font-size: 18px; }
.status { color: var(--gray); line-height: 1.5; }
.order { padding: 14px; margin: 10px 0; background: #f5f5f5; border: 1px solid #ddd; overflow-wrap: anywhere; }
footer { margin-top: 45px; padding: 30px; background: var(--black); color: white; text-align: center; font-weight: 900; }
#messageBox { position: fixed; bottom: 15px; right: 15px; z-index: 20; max-width: 90%; padding: 12px 16px; color: white; background: var(--black); }
#messageBox:empty { display: none; }

.auth-page { width: min(430px, 92%); margin: 45px auto; padding: 30px; background: white; border-top: 5px solid var(--red); }
.auth-page h1 { text-transform: uppercase; }
.auth-page label { display: block; margin: 15px 0 6px; font-weight: bold; }
.auth-page input { width: 100%; padding: 12px; border: 1px solid #ccc; }
.auth-page button[type="submit"] { width: 100%; margin-top: 20px; padding: 13px; background: var(--red); color: white; border: 0; font-weight: bold; }
.auth-page .brand { display: block; margin: 18px 0; }
.auth-message { line-height: 1.5; overflow-wrap: anywhere; }

@media (max-width: 950px) {
  .header { gap: 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  nav { width: 100%; margin: 0; justify-content: space-between; gap: 8px; }
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .product img { height: 150px; }
  .hero { padding: 25px; min-height: 270px; }
  .hero h1 { font-size: 45px; }
  nav a, nav button { font-size: 10px; }
  .panel { padding: 14px; }
}
