* {
  box-sizing: border-box;
}

a {
  color: #111;
}

button {
  -webkit-appearance: none;
  appearance: none;
  color: #111;
  font-family: inherit;
}

body {
  margin: 0;
  font-family: 'Onest', system-ui, sans-serif;
  background: #faf9f7;
  color: #111;
}

.cat-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.cat-header-logo {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
}

.cat-header-logo svg {
  display: block;
  height: 22px;
  width: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.header-cart-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.header-cart-bar button {
  padding: 7px 12px;
  border-radius: 999px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.header-cart-bar button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.lang-switcher {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.lang-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.lang-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

@media (max-width: 400px) {
  .cat-header {
    padding: 8px 10px;
    gap: 6px;
  }

  .cat-header-logo svg {
    height: 18px;
  }

  .header-right {
    gap: 6px;
  }

  .header-cart-bar {
    font-size: 11px;
    gap: 4px;
  }

  .header-cart-bar button {
    padding: 6px 9px;
    font-size: 11px;
  }

  .lang-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

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

@media (max-width: 900px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  /* On mobile the header cart bar + dedicated cart step already cover this,
     so the in-page sidebar copy is just dead weight at the bottom. */
  .cart-sidebar {
    display: none;
  }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card-body {
    padding: 10px 12px 12px;
    gap: 6px;
  }

  .product-name {
    font-size: 14px;
  }

  .product-description {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-more-info {
    font-size: 11px;
  }

  .product-price-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .product-price {
    font-size: 14px;
  }

  .add-to-cart-btn {
    width: 100%;
    padding: 8px;
  }
}

.product-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eceae6;
}

.product-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.product-description {
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

.product-more-info {
  font-size: 12px;
  color: #666;
  text-decoration: underline;
}

.product-more-info:hover {
  color: #111;
}

.format-toggle {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 999px;
  overflow: hidden;
  margin-top: auto;
}

.format-toggle button {
  flex: 1;
  border: none;
  background: #fff;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.format-toggle button.active {
  background: #111;
  color: #fff;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.product-price {
  font-size: 16px;
  font-weight: 700;
}

.add-to-cart-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.add-to-cart-btn:hover {
  background: #333;
}

/* Cart sidebar — always visible while shopping, no toggle/close */
.cart-sidebar {
  position: sticky;
  top: 88px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 110px);
}

.cart-sidebar h3 {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid #eee;
}

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

.cart-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.cart-line-info {
  flex: 1;
}

.cart-line-name {
  font-size: 14px;
  font-weight: 600;
}

.cart-line-format {
  font-size: 12px;
  color: #999;
}

.cart-line-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-line-qty button {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
}

.cart-line-qty span {
  min-width: 18px;
  text-align: center;
  font-size: 14px;
}

.cart-line-remove {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 12px;
}

.cart-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #eee;
}

.cart-total {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

#btn-checkout {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

#btn-checkout:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.cart-empty {
  color: #999;
  text-align: center;
  padding: 40px 0;
  font-size: 14px;
}

/* Client form step */
.client-form-wrap,
.confirmation-wrap,
.cart-review-wrap {
  max-width: 480px;
  margin: 40px auto;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  border: 1px solid #eee;
}

.cart-review-wrap h2 {
  margin-top: 0;
}

.cart-review-wrap .cart-lines {
  padding: 0;
  max-height: none;
}

.cart-review-footer {
  margin-top: 16px;
  border-top: 1px solid #eee;
  padding-top: 16px;
}

.step-hint {
  color: #777;
  font-size: 14px;
  margin-top: -8px;
}

.field-group {
  margin-bottom: 14px;
}

.field-group label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
}

.field-group input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
}

#btn-submit-order,
#btn-cart-to-client {
  background: #111;
  color: #fff;
}

.btn-secondary {
  background: #f0f0ee;
  color: #111;
}

.form-error {
  color: #c0392b;
  font-size: 13px;
  min-height: 16px;
}

.confirmation-wrap {
  text-align: center;
}

#btn-order-again {
  margin-top: 16px;
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

#btn-order-again:hover {
  background: #333;
}
