:root {
  --bg: #fef6e9;
  --surface: #fffdf8;
  --ink: #181718;
  --muted: #6a6360;
  --accent: #f77f00;
  --accent-2: #23a6b8;
  --line: #f1dbbf;
  --danger: #c23d3d;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(32, 24, 18, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 15%, #ffdcae 0, transparent 40%),
    radial-gradient(circle at 85% 85%, #b7eff7 0, transparent 35%),
    var(--bg);
  position: relative;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.4;
  z-index: 0;
}

.orb-one {
  width: 280px;
  height: 280px;
  background: #ffc56b;
  top: -70px;
  right: -60px;
}

.orb-two {
  width: 320px;
  height: 320px;
  background: #70d2e0;
  bottom: -120px;
  left: -90px;
}

.site-header,
main,
.cart-panel,
.toast {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem clamp(1rem, 2vw, 2rem);
}

.logo-wrap h1 {
  font-family: "Bungee", cursive;
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  color: #d15400;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.header-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

input,
select,
textarea,
button {
  font: inherit;
}

input[type="search"],
select {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
}

.cart-button,
.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: 700;
}

.cart-button,
.primary-button {
  background: linear-gradient(135deg, var(--accent), #ff9f1c);
  color: white;
}

.primary-link-button {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #ff9f1c);
  color: white;
  text-decoration: none;
}

.cart-button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.cart-count {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  background: #1a1a1a;
  border-radius: 50%;
  font-size: 0.8rem;
}

main {
  padding: 0 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  animation: rise 0.7s ease;
}

.hero h2 {
  margin-top: 0.4rem;
  margin-bottom: 0.6rem;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
}

.hero p {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.hero-card {
  background: linear-gradient(170deg, #1d4e89, #2d7aa0);
  color: #f8fcff;
  border-radius: 14px;
  padding: 0.9rem;
  min-width: 220px;
}

.hero-card p {
  margin: 0.5rem 0;
}

.filters {
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

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

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.6rem;
  animation: rise 0.45s ease;
}

.product-art {
  aspect-ratio: 4/3;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  background: linear-gradient(150deg, #fff6ea, #f8ede4);
  overflow: hidden;
}

.product-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card h3 {
  margin: 0;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.product-meta p {
  margin: 0;
}

.price {
  font-size: 1.15rem;
  font-weight: 800;
}

.tag {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

.product-card button {
  border: 0;
  border-radius: 10px;
  padding: 0.6rem;
  background: #13293d;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.admin-panel {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: 16px;
  background: #fff9f0;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.admin-panel h3 {
  margin: 0.25rem 0 0.8rem;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  align-items: end;
}

.admin-form label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
  min-width: 0;
}

.admin-form input,
.admin-form select {
  border: 1px solid #e5d6c4;
  border-radius: 10px;
  padding: 0.6rem;
  width: 100%;
  box-sizing: border-box;
}

.admin-form input[type="file"] {
  padding: 0.45rem;
  background: #fff;
}

.owner-modal .admin-form > button {
  grid-column: 1 / -1;
  width: 100%;
}

#productForm .photo-field {
  grid-column: 1 / -1;
}

#productForm .add-toy-button {
  grid-column: 1 / -1;
  width: 100%;
}

/* Force a stacked layout in the owner product form to prevent any overlap. */
#productForm {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.admin-products {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.45rem;
}

.admin-auth {
  display: flex;
  gap: 0.6rem;
  margin: 0.7rem 0;
}

.admin-auth input {
  flex: 1;
  border: 1px solid #e5d6c4;
  border-radius: 10px;
  padding: 0.6rem;
}

.admin-hint {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  border: 1px dashed #e4cfaf;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  background: white;
}

.admin-item p {
  margin: 0;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(390px, 100vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid #f0dfc9;
  box-shadow: -18px 0 30px rgba(16, 14, 13, 0.15);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

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

.cart-header,
.cart-footer {
  padding: 1rem;
  border-bottom: 1px solid #f3e4d0;
}

.cart-footer {
  border-top: 1px solid #f3e4d0;
  border-bottom: 0;
}

.cart-footer p {
  margin: 0.35rem 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-cart {
  background: transparent;
  border: 1px solid #d9c9b4;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.tax-button {
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 0.45rem;
  border: 1px solid #d5c4ae;
  background: #fff8ef;
  color: #4e3b2b;
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.cart-items {
  padding: 1rem;
  overflow: auto;
  display: grid;
  gap: 0.8rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed #edd8bb;
}

.cart-item h4,
.cart-item p {
  margin: 0;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid #d3c3af;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.remove-btn {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
}

.empty-cart {
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%) translateY(140%);
  background: #13293d;
  color: white;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  transition: transform 0.25s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-controls {
    width: 100%;
  }

  .header-controls input {
    flex: 1;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-card {
    min-width: 0;
  }

  .admin-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

.owner-modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 11, 9, 0.45);
  display: none;
  place-items: center;
  padding: 1rem;
  z-index: 4;
}

.owner-modal.open {
  display: grid;
}

.owner-modal-card {
  width: min(820px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #efdfca;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
}
