:root {
  --background: #f8fafc;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-light: rgba(255, 255, 255, 0.92);
  --primary: #6ea8fe;
  --primary-hover: #5b93f7;
  --secondary: #8b7cf6;
  --text: #1f2937;
  --text-muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --max-width: 1200px;
  --font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

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

html {
  color-scheme: light;
}

body {
  font-family: var(--font-family);
  background: radial-gradient(circle at top, #eef6ff 0%, #f8fafc 45%, #ffffff 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: underline;
  color: var(--primary);
}

p {
  line-height: 1.5em;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--border);
}

.container {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 24px;
}

.navbar {
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7cc7ff, #9f8cff);
  box-shadow: 0 10px 24px rgba(110, 168, 254, 0.25);
}

nav {
  display: flex;
  gap: 24px;
}

nav a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color .2s ease;
}

nav a:hover {
  color: var(--primary);
}

main {
  flex: 1;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 48px 24px;
}
h1 {
  margin-bottom: 1em;
}
.content {
  padding: 40px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 60px var(--shadow);
}
/* Form styles */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
form label {
  font-weight: 500;
}
form input,
form textarea {
  font-family: var(--font-family);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-light);
  transition: all 0.2s ease;
  outline: none;
  box-shadow: none;
}
form input:focus,
form textarea:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--shadow);
}
form button {
  align-self: flex-start;
  padding: 12px 24px;
  background: var(--primary);
  color: var(--surface-light);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: bold;
}
form button:hover {
  background: var(--primary-hover);
  transition: all 0.2s ease;
  outline: none;
}

/* Footer styles */
footer {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.45);
  border-top: 1px solid var(--border);
}

footer strong {
  color: var(--primary);
}

::selection {
  background: #dbeafe;
  color: var(--text);
}

@media (max-width: 768px) {
  .navbar {
    height: auto;
    padding: 18px 0;
    flex-direction: column;
    gap: 18px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .content {
    padding: 28px;
  }
}

/* Form interaction states (denox-form.js) */
.field-error {
  display: block;
  color: #c0392b;
  font-size: 0.85rem;
  margin: 2px 0 10px;
  min-height: 1em;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #c0392b;
  outline-color: #c0392b;
}

.success {
  display: block;
  color: #1e7e34;
  background: #e6f4ea;
  border: 1px solid #b7e0c2;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
}

form[aria-busy="true"] button[type="submit"] {
  opacity: 0.6;
  cursor: progress;
}

/* Products showcase (layout-showcase) */
.content-wide {
  max-width: 1100px;
}

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

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.product-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: #f4f6f8;
}

.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-initial {
  font-size: 3rem;
  font-weight: 700;
  color: #9aa7b2;
}

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

.product-card-body h2 {
  font-size: 1.05rem;
  margin: 0;
}

.product-card-description {
  font-size: 0.88rem;
  color: #5b6770;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-weight: 700;
  color: #1e7e34;
}

.empty-state {
  color: #5b6770;
  background: #f4f6f8;
  border-radius: 8px;
  padding: 18px;
}

/* Product view (layout-product) */
.breadcrumb {
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.product-view {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 720px) {
  .product-view {
    grid-template-columns: minmax(260px, 420px) 1fr;
    align-items: start;
  }
}

.product-view-media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: #f4f6f8;
  border-radius: 12px;
  overflow: hidden;
}

.product-view-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-price-large {
  font-size: 1.6rem;
  margin: 8px 0 14px;
}

.product-view-description {
  line-height: 1.6;
  color: #3c464e;
}

.product-view-meta {
  font-size: 0.85rem;
  color: #8a97a1;
}

/* Standalone error pages */
.error-page {
  max-width: 560px;
  margin: 12vh auto;
  text-align: center;
  padding: 0 20px;
}

/* Product gallery (multiple images) */
.product-view-media-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.product-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: #f4f6f8;
}

/* Product image carousel */
.product-carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: 12px;
  background: #f4f6f8;
  aspect-ratio: 1 / 1;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track img {
  flex: 0 0 100%;
  width: 100%;
  object-fit: cover;
  scroll-snap-align: start;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.carousel-counter {
  position: absolute;
  right: 12px;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.78rem;
  padding: 2px 9px;
  border-radius: 999px;
}
