@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #ffffff;
  --text: #191919;
  --muted: #777777;
  --card: #f5f5f5;
  --accent: #b88955;
  --border: #e5e5e5;
  --shadow: 0 10px 30px #0000000c;
}

body.dark {
  --bg: #151515;
  --text: #ffffff;
  --muted: #bbbbbb;
  --card: #252525;
  --accent: #d3a36c;
  --border: #383838;
  --shadow: 0 10px 30px #00000030;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition:
    background 0.3s,
    color 0.3s;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  text-decoration: none;
  color: inherit;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 18px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.logo {
  font-size: 25px;
  font-weight: 800;
}

.logo span {
  color: var(--accent);
}

.navbar nav {
  display: flex;
  gap: 25px;
}

.navbar nav a:hover {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  gap: 9px;
}

.nav-actions button,
.close-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
}

#cartCount {
  color: var(--accent);
  font-weight: 800;
}

.hero {
  min-height: 540px;
  display: flex;
  align-items: center;
  padding: 60px 9%;
  color: white;
  background:
    linear-gradient(90deg, #000000c9, #00000020),
    url("https://images.unsplash.com/photo-1483985988355-763728e1935b?w=1600")
      center/cover;
}

.hero-content {
  max-width: 550px;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 15px;
}

.hero h1 {
  font-size: clamp(45px, 7vw, 76px);
  line-height: 1.08;
  margin-bottom: 20px;
}

.hero p:not(.eyebrow) {
  line-height: 1.8;
  margin-bottom: 30px;
  max-width: 420px;
}

.primary-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px 22px;
  border-radius: 5px;
  font-weight: 700;
  text-align: center;
}

.primary-btn:hover {
  filter: brightness(0.9);
}

.benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 28px 6%;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.products-section {
  max-width: 1200px;
  margin: auto;
  padding: 85px 20px;
}

.section-heading {
  text-align: center;
  margin-bottom: 35px;
}

.section-heading h2,
.about-section h2 {
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 10px;
}

.section-heading p {
  color: var(--muted);
}

.shop-tools {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
}

.shop-tools input {
  flex: 1;
}

.shop-tools input,
.shop-tools select {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  outline-color: var(--accent);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.product-card {
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-card img {
  width: 100%;
  height: 260px;
  display: block;
  object-fit: cover;
  background: var(--card);
}

.product-info {
  padding: 17px;
}

.product-info small {
  color: var(--muted);
}

.product-info h3 {
  font-size: 16px;
  margin: 8px 0;
}

.product-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.price {
  color: var(--accent);
  font-weight: 800;
}

.add-btn {
  border: none;
  border-radius: 5px;
  padding: 10px 12px;
  background: var(--text);
  color: var(--bg);
}

.add-btn:hover {
  background: var(--accent);
  color: white;
}

.empty-message {
  text-align: center;
  padding: 35px;
  color: var(--muted);
}

.about-section {
  padding: 80px 20px;
  text-align: center;
  background: var(--card);
}

.features {
  max-width: 1100px;
  margin: 40px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.features article {
  background: var(--bg);
  padding: 30px 20px;
  border-radius: 10px;
}

.features article > span {
  font-size: 30px;
}

.features h3 {
  margin: 15px 0 8px;
}

.features p {
  color: var(--muted);
  font-size: 14px;
}

.newsletter {
  padding: 75px 20px;
  text-align: center;
}

.newsletter h2 {
  font-size: 32px;
  margin-bottom: 10px;
}

.newsletter p {
  color: var(--muted);
  margin-bottom: 22px;
}

.newsletter form {
  display: flex;
  gap: 10px;
  max-width: 450px;
  margin: auto;
}

.newsletter input {
  flex: 1;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--card);
  color: var(--text);
}

.newsletter button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 5px;
}

footer {
  padding: 30px 15px;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}

/* Side panel */

.side-panel {
  position: fixed;
  z-index: 31;
  top: 0;
  right: -450px;
  width: min(420px, 100%);
  height: 100%;
  background: var(--bg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: right 0.3s;
}

.side-panel.open {
  right: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  font-size: 21px;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
}

.panel-footer {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.total-row,
.checkout-summary {
  display: flex;
  justify-content: space-between;
  margin-bottom: 17px;
}

.full-btn {
  width: 100%;
}

.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item img {
  width: 65px;
  height: 75px;
  object-fit: cover;
  border-radius: 5px;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-info p {
  color: var(--accent);
  margin: 5px 0;
}

.quantity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity button {
  padding: 4px 9px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.remove-btn {
  background: none;
  color: #d44;
  border: none;
  font-size: 12px;
}

/* Modals */

.modal {
  display: none;
  position: fixed;
  z-index: 40;
  inset: 0;
  padding: 20px;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  width: min(500px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  padding: 25px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.modal-content form {
  display: flex;
  flex-direction: column;
}

.modal-content label {
  margin: 15px 0 7px;
  font-weight: 600;
  font-size: 14px;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  outline-color: var(--accent);
  width: 100%;
}

.checkout-summary {
  margin-top: 22px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.demo-notice {
  color: #b87928;
  background: #b8792818;
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 18px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: #0009;
}

.overlay.show {
  display: block;
}

.success-content {
  text-align: center;
}

.success-icon {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  margin: 10px auto 20px;
  background: #219b661b;
  color: #219b66;
  font-size: 35px;
  border-radius: 50%;
}

.success-content h2 {
  margin-bottom: 12px;
}

.success-content p {
  color: var(--muted);
  margin-bottom: 15px;
}

.success-content h3 {
  color: var(--accent);
  margin-bottom: 20px;
}

.order-card {
  padding: 17px 0;
  border-bottom: 1px solid var(--border);
}

.order-card p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.order-card strong {
  color: var(--accent);
}

#toast {
  position: fixed;
  z-index: 60;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 100px);
  padding: 13px 20px;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
  max-width: 90%;
  text-align: center;
}

#toast.show {
  transform: translate(-50%, 0);
}

/* Responsive */

@media (max-width: 850px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-card img {
    height: 230px;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 14px;
    flex-wrap: wrap;
  }

  .logo {
    font-size: 20px;
  }

  .navbar nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 25px;
    font-size: 13px;
  }

  .nav-actions {
    gap: 5px;
  }

  .nav-actions button {
    padding: 8px;
    font-size: 12px;
  }

  .hero {
    min-height: 440px;
    padding: 40px 7%;
  }

  .benefits {
    grid-template-columns: 1fr;
    text-align: left;
    padding: 20px 9%;
  }

  .products-section {
    padding: 60px 13px;
  }

  .shop-tools {
    flex-direction: column;
  }

  .product-grid {
    gap: 12px;
  }

  .product-card img {
    height: 190px;
  }

  .product-info {
    padding: 12px;
  }

  .product-info h3 {
    font-size: 14px;
  }

  .product-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .add-btn {
    width: 100%;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .newsletter form {
    flex-direction: column;
  }

  .modal-content {
    padding: 18px;
  }
}
