:root {
  --color-bg: #f7f5f2;
  --color-surface: #ffffff;
  --color-text: #2c2416;
  --color-muted: #6b6358;
  --color-accent: #8b5a2b;
  --color-accent-dark: #6d4520;
  --color-border: #e3ddd4;
  --color-success: #2d6a4f;
  --color-error: #b42318;
  --shadow-sm: 0 1px 3px rgba(44, 36, 22, 0.08);
  --shadow-md: 0 8px 24px rgba(44, 36, 22, 0.12);
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1100px, 100% - 2rem);
  margin-inline: auto;
}

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  padding: 1.25rem 0 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-top: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0;
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--color-muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--color-text);
}

.tab.active {
  color: var(--color-accent-dark);
  border-bottom-color: var(--color-accent);
}

main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.category-header {
  margin-bottom: 1.75rem;
}

.category-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.category-header p {
  margin: 0;
  color: var(--color-muted);
  max-width: 60ch;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.content-block,
.content-section,
.content-subsection {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.content-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-title {
  margin: 0;
  font-size: 1.35rem;
  color: var(--color-accent-dark);
}

.subsection-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.section-text {
  margin: 0;
  color: var(--color-muted);
  max-width: 72ch;
  line-height: 1.65;
}

.subsections {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.content-subsection {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.gallery-item {
  margin: 0;
}

.gallery-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--color-bg),
    var(--color-bg) 8px,
    #ece7df 8px,
    #ece7df 16px
  );
}

.gallery-info-btn {
  appearance: none;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgb(37 59 184);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: background 0.15s, transform 0.15s;
}

.gallery-media-clickable {
  cursor: zoom-in;
}

.gallery-info-btn:hover {
  background: rgb(37 59 184);
  transform: scale(1.08);
}

.lightbox-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 1.25rem;
  width: min(960px, calc(100% - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.lightbox-dialog::backdrop {
  background: rgba(44, 36, 22, 0.65);
}

.lightbox-dialog[open] {
  display: flex;
}

.lightbox-close {
  align-self: flex-end;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-caption {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
  text-align: center;
}

.info-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 1.5rem;
  width: min(520px, calc(100% - 2rem));
  box-shadow: var(--shadow-md);
}

.info-dialog::backdrop {
  background: rgba(44, 36, 22, 0.45);
}

.info-price {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-accent-dark);
}

.info-description {
  color: var(--color-text);
  line-height: 1.6;
}

.info-description :first-child {
  margin-top: 0;
}

.info-description :last-child {
  margin-bottom: 0;
}

.gallery-item figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
}

.section-request-btn {
  align-self: flex-start;
  margin-top: 0.5rem;
}

.request-selectors {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.selector-name {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.thumb-select {
  position: relative;
}

.thumb-select-trigger {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.thumb-select-trigger:hover,
.thumb-select.open .thumb-select-trigger {
  border-color: var(--color-accent);
}

.thumb-select-placeholder {
  color: var(--color-muted);
}

.thumb-select-value {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.thumb-select-caret {
  color: var(--color-muted);
  flex-shrink: 0;
}

.thumb-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
}

.thumb-select-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
}

.thumb-select-option:hover,
.thumb-select-option.selected {
  background: var(--color-bg);
}

.thumb-select-thumb {
  width: 2rem;
  height: 2rem;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-bg);
}

.thumb-select-thumb-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-muted);
  background: #ece7df;
}

.thumb-select-label {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.25rem 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.request-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(480px, calc(100% - 2rem));
  box-shadow: var(--shadow-md);
}

.request-dialog::backdrop {
  background: rgba(44, 36, 22, 0.45);
}

.request-dialog form {
  padding: 1.5rem;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.dialog-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0;
}

.dialog-item {
  margin: 0 0 1.25rem;
  padding: 0.65rem 0.85rem;
  background: var(--color-bg);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-field input,
.form-field textarea {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.form-error {
  color: var(--color-error);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.form-success {
  color: var(--color-success);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .brand h1 {
    font-size: 1.25rem;
  }

  .category-header h2 {
    font-size: 1.4rem;
  }
}
