/* ==========================================================================
   AutoboxyPrešov — Dark Technical Automotive Catalog & Rental Styling
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Automotive Typography */
  --font-display: "Exo 2", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Dark-First Technical Slate Palette */
  --bg-primary: #0f1115;
  --bg-surface: #171a21;
  --bg-elevated: #1d212b;
  --bg-subtle: #1d212b;
  --bg-media: #12151c;
  --header-bg: rgba(15, 17, 21, 0.96);

  --text-main: #f3f5f8;
  --text-muted: #9aa4b2;
  --text-light: #6b7688;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: var(--accent);

  /* Dynamic Brand Accent (overridden by /api/site-settings) */
  --accent: #3b82f6;
  --accent-contrast: #ffffff;

  /* Status Badges */
  --badge-available-bg: rgba(34, 197, 94, 0.16);
  --badge-available-text: #86efac;
  --badge-reserved-bg: rgba(234, 179, 8, 0.16);
  --badge-reserved-text: #fde047;
  --badge-sold-bg: rgba(255, 255, 255, 0.07);
  --badge-sold-text: #9aa4b2;

  --table-stripe: rgba(255, 255, 255, 0.025);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --card-hover-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  color-scheme: light;

  --bg-primary: #f3f5f8;
  --bg-surface: #ffffff;
  --bg-elevated: #eef1f6;
  --bg-subtle: #eef1f6;
  --bg-media: #f6f8fb;
  --header-bg: rgba(255, 255, 255, 0.96);

  --text-main: #11141a;
  --text-muted: #525d6d;
  --text-light: #717d8f;

  --border-color: rgba(15, 17, 21, 0.10);
  --border-strong: rgba(15, 17, 21, 0.20);
  --border-focus: var(--accent);

  --badge-available-bg: #ecfdf5;
  --badge-available-text: #166534;
  --badge-reserved-bg: #fefce8;
  --badge-reserved-text: #854d0e;
  --badge-sold-bg: #f1f5f9;
  --badge-sold-text: #475569;

  --table-stripe: rgba(15, 17, 21, 0.028);
  --card-shadow: 0 2px 12px rgba(15, 17, 21, 0.05);
  --card-hover-shadow: 0 12px 28px rgba(15, 17, 21, 0.11);
}

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

html {
  background-color: var(--bg-primary);
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.55;
  letter-spacing: -0.005em;
  min-height: 100dvh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  max-height: 38px;
  height: auto;
  width: auto;
  max-width: 148px;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-phone-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.header-phone-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: border-color var(--transition), background-color var(--transition);
}

.theme-toggle-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.theme-toggle-btn:focus-visible,
.header-phone-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Hero & Compact Dark Filter Bar
   ========================================================================== */
.hero {
  padding: 40px 0 28px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.85rem);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 10px;
  color: var(--text-main);
}

.hero p {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 640px;
  margin: 0 auto 28px;
}

.gallery-filter-controls {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  box-shadow: var(--card-shadow);
}

/* Segmented Control: Všetky / Na predaj / Na prenájom */
.filter-bar {
  display: inline-flex;
  align-items: center;
  align-self: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin: 0;
  max-width: 100%;
}

.filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.filter-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .filter-btn:hover {
  background: rgba(15, 17, 21, 0.05);
}

.filter-btn.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  font-weight: 700;
}

.filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gallery-search-row,
.box-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.box-filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-elevated);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa4b2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 9px 34px 9px 13px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-width: 155px;
  transition: border-color var(--transition), background-color var(--transition);
}

.box-filter-select:hover {
  border-color: var(--border-strong);
}

.box-filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

.gallery-search-input {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 360px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color var(--transition);
}

.gallery-search-input::placeholder {
  color: var(--text-muted);
}

.gallery-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-reset-btn {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 0.84rem;
}

.filter-reset-btn:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

.gallery-result-hint {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==========================================================================
   Roof Box Catalog Grid & Cards
   ========================================================================== */
.box-catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 48px;
  align-items: stretch;
}

@media (max-width: 1279px) {
  .box-catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .box-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

.box-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.box-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--card-hover-shadow);
}

.box-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 50% 48%, #1e2330 0%, var(--bg-media) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .box-card-img-wrap {
  background: radial-gradient(circle at 50% 48%, #ffffff 0%, #edf0f5 100%);
}

.box-card-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.28s ease;
}

[data-theme="light"] .box-card-img-wrap img {
  border-color: rgba(15, 23, 42, 0.08);
}

.box-card:hover .box-card-img-wrap img {
  transform: scale(1.03);
}

.box-card-photos-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 17, 21, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f3f5f8;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 6px;
}

.box-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.box-card-brand-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
}

.box-card-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.28;
  color: var(--text-main);
  margin: -4px 0 0;
}

.box-spec-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.box-spec-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  line-height: 1.25;
}

.box-spec-pill.is-dims {
  color: var(--text-muted);
  font-weight: 600;
}

.box-card-prices {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.box-price-tag {
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  line-height: 1.2;
}

.box-price-tag.is-sale {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.box-price-tag.is-rent {
  border-color: var(--border-strong);
}

.box-price-tag.is-rent strong {
  color: var(--text-main);
  font-weight: 800;
}

.box-price-tag.is-unavail {
  color: var(--text-muted);
  font-weight: 600;
}

/* Load More */
.load-more-container {
  display: flex;
  justify-content: center;
  margin: 12px 0 56px;
}

.load-more-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 13px 30px;
  border-radius: 10px;
  font-size: 0.94rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), background-color var(--transition);
  box-shadow: var(--card-shadow);
}

.load-more-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ==========================================================================
   FAQ Accordion Section
   ========================================================================== */
.faq-section {
  padding: 40px 0 44px;
  border-top: 1px solid var(--border-color);
}

.faq-header {
  margin-bottom: 22px;
}

.faq-header h2 {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.faq-subtitle {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.5;
  margin: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: border-color var(--transition), background-color var(--transition);
  overflow: hidden;
}

.faq-item:hover,
.faq-item[open] {
  border-color: var(--accent);
}

.faq-question {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-main);
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 12px;
}

.faq-question-text {
  flex: 1;
  min-width: 0;
}

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.2s ease, color var(--transition), border-color var(--transition), background-color var(--transition);
}

.faq-item:hover .faq-icon {
  color: var(--accent);
  border-color: var(--accent);
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.faq-answer {
  padding: 0 20px 18px;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.65;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.faq-answer p {
  margin: 0;
  white-space: pre-line;
}

@media (max-width: 640px) {
  .faq-section {
    padding: 32px 0 36px;
  }

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

  .faq-question {
    padding: 14px 15px;
    font-size: 0.94rem;
    gap: 10px;
  }

  .faq-answer {
    padding: 12px 15px 15px;
    font-size: 0.9rem;
    line-height: 1.6;
  }
}

/* ==========================================================================
   About & Rental Info Section
   ========================================================================== */
.about-section {
  padding: 44px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 36px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  align-items: start;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.about-intro h2 {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.about-intro p {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 18px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 13px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: border-color var(--transition), color var(--transition);
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rental-info-col {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px 22px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.rental-info-col strong {
  color: var(--text-main);
  font-weight: 700;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  padding: 24px 0 calc(28px + env(safe-area-inset-bottom));
  color: var(--text-muted);
  font-size: 0.84rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.footer-admin-link {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: color var(--transition);
}

.footer-admin-link:hover {
  color: var(--text-muted);
}

/* ==========================================================================
   Shared Form Controls, Buttons & Badges (Public + Admin CMS)
   ========================================================================== */
.edit-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.edit-input,
.edit-select {
  width: 100%;
  padding: 10px 13px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.94rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color var(--transition);
}

.edit-input:focus,
.edit-select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea.edit-input {
  resize: vertical;
  min-height: 86px;
}

.edit-select {
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border: 1px solid var(--accent);
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 0.94rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}

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

.btn-edit-save {
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-edit-save:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-color-green,
.badge-available {
  background: var(--badge-available-bg);
  color: var(--badge-available-text);
  border: 1px solid rgba(34, 197, 94, 0.28);
}

.badge-color-yellow,
.badge-reserved {
  background: var(--badge-reserved-bg);
  color: var(--badge-reserved-text);
  border: 1px solid rgba(234, 179, 8, 0.30);
}

.badge-color-gray,
.badge-sold {
  background: var(--badge-sold-bg);
  color: var(--badge-sold-text);
  border: 1px solid var(--border-strong);
}

.badge-color-blue {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.30);
}

.badge-color-purple {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.30);
}

.badge-color-red {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.30);
}

[data-theme="light"] .badge-color-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.22);
}

[data-theme="light"] .badge-color-purple {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: rgba(109, 40, 217, 0.22);
}

[data-theme="light"] .badge-color-red {
  background: #fef2f2;
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.22);
}

.settings-error,
.inquiry-feedback.error {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.36);
  color: #fca5a5;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
}

.settings-success,
.inquiry-feedback.success {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.36);
  color: #86efac;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
}

[data-theme="light"] .settings-error,
[data-theme="light"] .inquiry-feedback.error {
  background: #fee2e2;
  color: #991b1b;
  border-color: rgba(153, 27, 27, 0.24);
}

[data-theme="light"] .settings-success,
[data-theme="light"] .inquiry-feedback.success {
  background: #dcfce7;
  color: #166534;
  border-color: rgba(22, 101, 52, 0.24);
}

/* Admin CMS Modal Helpers (kept compatible with admin.html) */
.edit-modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 820px;
  width: 95%;
  max-height: 92dvh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.5);
  padding: 32px 36px;
}

.edit-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.edit-photo-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-subtle);
  border: 2px solid transparent;
  cursor: pointer;
}

.edit-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.edit-photo-thumb .remove-photo-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.edit-photo-thumb:hover .remove-photo-btn {
  opacity: 1;
}

.edit-photo-thumb.cover-photo {
  border-color: #22c55e;
}

.edit-photo-thumb.cover-photo::after {
  content: "Cover";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(34, 197, 94, 0.88);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  padding: 3px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Full-Screen Roof Box Detail Modal (Technical Datasheet & Calculator)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(8, 10, 14, 0.86);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.detail-modal-overlay {
  z-index: 150;
  padding: 16px;
}

.detail-modal-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  max-width: 1280px;
  width: 100%;
  height: min(92dvh, 880px);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.65);
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.detail-header-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.detail-header-title .modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  color: var(--text-main);
}

.detail-header-meta {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.detail-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.detail-header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), background-color var(--transition);
}

.detail-header-action-btn:hover {
  border-color: var(--accent);
}

.modal-close-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.modal-close-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.detail-close-btn {
  position: static;
}

.detail-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 22px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow-x: auto;
}

.detail-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.detail-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-elevated);
}

.detail-tab-btn.active {
  background: var(--bg-elevated);
  color: var(--text-main);
  border-color: var(--accent);
}

.detail-tab-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.detail-tab-panel.active {
  display: flex;
  flex-direction: column;
}

/* Tab 1: Datasheet Specs & Highlighted Inquiry/Calculator Panel */
.info-tab-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  padding: 24px 26px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  height: 100%;
  align-items: start;
}

.info-preview-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.info-thumb-wrap {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-media);
  width: 152px;
  height: 114px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: border-color var(--transition);
}

.info-thumb-wrap:hover {
  border-color: var(--accent);
}

.box-info-thumb {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .box-info-thumb {
  border-color: rgba(15, 23, 42, 0.08);
}

.info-thumb-zoom-hint {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 17, 21, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f3f5f8;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.box-detail-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* Technical Datasheet Striped Table */
.box-specs-table-wrap {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.box-specs-heading {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 16px;
  margin: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
}

.box-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.box-specs-table tr {
  border-bottom: 1px solid var(--border-color);
}

.box-specs-table tr:last-child {
  border-bottom: none;
}

.box-specs-table tbody tr:nth-child(even) {
  background: var(--table-stripe);
}

.box-specs-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 14px 10px 16px;
  width: 50%;
  vertical-align: top;
}

.box-specs-table td {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  padding: 10px 16px 10px 12px;
  vertical-align: top;
}

/* Highlighted Inquiry & Rental Calculator Panel */
.inquiry-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--accent);
  border-radius: 14px;
  padding: 20px 22px;
  align-self: start;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .inquiry-card {
  box-shadow: 0 6px 20px rgba(15, 17, 21, 0.06);
}

.inquiry-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px;
}

.inquiry-mode-btn {
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}

.inquiry-mode-btn:hover {
  color: var(--text-main);
}

.inquiry-mode-btn.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.rental-calc-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rental-dates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rental-min-warn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.34);
}

[data-theme="light"] .rental-min-warn {
  color: #b45309;
}

.rental-calc-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.rental-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--text-muted);
}

.rental-calc-row.is-discount {
  color: #4ade80;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.10);
  border-radius: 6px;
  padding: 5px 8px;
}

[data-theme="light"] .rental-calc-row.is-discount {
  color: #15803d;
  background: rgba(22, 163, 74, 0.10);
}

.rental-calc-row.is-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-strong);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.rental-calc-row.is-total span:last-child {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}

.rental-calc-row.is-deposit {
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rental-calc-row.is-deposit strong {
  color: var(--text-main);
  font-weight: 700;
}

/* Tab 2: Photo Gallery & Deep Zoom */
.detail-stage-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.detail-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--bg-media);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.detail-stage.is-zoomed {
  cursor: grab;
}

.detail-stage.is-zoomed:active {
  cursor: grabbing;
}

.detail-transform-layer {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 92%;
  max-height: 92%;
  transform-origin: center center;
  transition: transform 0.06s ease-out;
}

.detail-canvas-frame {
  position: relative;
  display: inline-block;
  line-height: 0;
}

#modalMainImage {
  display: block;
  max-width: 82vw;
  max-height: 60dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] #modalMainImage {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.1);
}

.modal-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 17, 21, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f3f5f8;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 5;
  transition: background-color var(--transition), border-color var(--transition);
}

.modal-nav-arrow:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.modal-nav-arrow.prev { left: 12px; }
.modal-nav-arrow.next { right: 12px; }

.detail-bottom-bar {
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.detail-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-zoom-group {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
}

.detail-tool-btn {
  background: var(--bg-surface);
  border: none;
  border-right: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color var(--transition);
}

.detail-zoom-group .detail-tool-btn:last-child {
  border-right: none;
}

.detail-tool-btn:hover {
  background: var(--bg-elevated);
}

.detail-zoom-readout {
  min-width: 56px;
  font-variant-numeric: tabular-nums;
}

.modal-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-shrink: 0;
  height: 58px;
  align-items: center;
}

.modal-thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-media);
  flex-shrink: 0;
  transition: border-color var(--transition);
}

[data-theme="light"] .modal-thumb {
  border-color: rgba(15, 23, 42, 0.08);
}

.modal-thumb.active {
  border-color: var(--accent);
}

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

/* Global Toast */
.platenko-toast {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 320;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

/* ==========================================================================
   Mobile & Tablet Responsive Finish (incl. 390px viewport & 100dvh modals)
   ========================================================================== */
@media (max-width: 860px) {
  .info-tab-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 14px;
  }

  .nav-inner {
    height: 60px;
    gap: 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo {
    max-height: 32px;
    max-width: 92px;
  }

  .brand-title {
    font-size: 1.18rem;
  }

  .brand-subtitle {
    font-size: 0.62rem;
  }

  .header-phone-btn {
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .theme-toggle-btn {
    padding: 7px 10px;
  }

  .theme-toggle-btn span {
    display: none;
  }

  .hero {
    padding: 26px 0 20px;
  }

  .hero p {
    font-size: 0.94rem;
    margin-bottom: 20px;
  }

  .detail-modal-overlay {
    padding: 0;
  }

  .detail-modal-shell {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .detail-header {
    padding: 12px 14px;
    gap: 8px;
  }

  .detail-header-title .modal-title {
    font-size: 1.12rem;
  }

  .detail-header-action-btn .action-btn-label {
    display: none;
  }

  .detail-header-action-btn {
    padding: 6px 10px;
  }

  .detail-tabs {
    padding: 8px 14px;
  }

  #modalMainImage {
    max-width: 96vw;
    max-height: 58dvh;
  }

  .info-preview-row {
    flex-direction: column;
  }

  .info-thumb-wrap {
    width: 100%;
    height: 180px;
  }
}

@media (max-width: 639px) {
  .box-catalog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery-filter-controls {
    padding: 10px;
    gap: 8px;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    align-self: stretch;
  }

  .filter-btn {
    padding: 8px 6px;
    font-size: 0.8rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .box-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .box-filter-select {
    min-width: 0;
    width: 100%;
    font-size: 0.84rem;
    padding: 9px 28px 9px 10px;
  }

  .gallery-search-input {
    grid-column: 1 / -1;
    max-width: none;
    width: 100%;
  }

  .filter-reset-btn,
  .gallery-result-hint {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .rental-dates-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .header-phone-btn {
    font-size: 0.76rem;
    padding: 6px 9px;
  }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .box-card:hover,
  .box-card:hover .box-card-img-wrap img,
  .load-more-btn:hover,
  .btn-primary:hover {
    transform: none;
  }
}
