:root {
  --bg: #f6ede6;
  --bg-alt: #fff9f4;
  --ink: #23201d;
  --muted: #6f675f;
  --accent: #d1612f;
  --accent-dark: #9e3f17;
  --line: #e5d5c7;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(80, 36, 15, 0.08);
  --danger: #c0392b;
  --success: #27ae60;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", "Noto Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 0% 0%, #fff9f2 0%, var(--bg) 60%);
  line-height: 1.5;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background: rgba(246, 237, 230, 0.85);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--accent-dark);
}

.nav a.active {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.lang-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

#lang-select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.3rem 0.45rem;
  background: #fff;
  font-size: 0.85rem;
}

.auth-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

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

.auth-btn.logged-in {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent-dark);
}

.user-menu {
  position: relative;
  display: inline-block;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 160px;
  z-index: 50;
  overflow: hidden;
}

.user-menu-dropdown.show {
  display: block;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: var(--bg-alt);
}

/* ===== HERO FULLWIDTH ===== */
.hero-fullwidth {
  position: relative;
  width: min(1120px, 92vw);
  margin: 1.5rem auto 0;
  min-height: 380px;
  overflow: hidden;
  border-radius: var(--radius);
}

.hero-fullwidth-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 380px;
  object-fit: cover;
  object-position: center top;
}

.hero-fullwidth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(35,32,29,0.75) 0%, rgba(35,32,29,0.45) 50%, transparent 100%);
  display: flex;
  align-items: center;
}

.hero-fullwidth-overlay h1 {
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  max-width: 540px;
}

.hero-main-title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.25;
  padding-left: 2rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ===== APP SHOWCASE ===== */
.app-showcase {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: center;
}

.app-showcase-screenshot img {
  width: 100%;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,.12);
}

.app-showcase-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-showcase-info p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .app-showcase {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .app-showcase-screenshot {
    max-width: 240px;
    margin: 0 auto;
  }
  .app-showcase-info {
    align-items: center;
  }
  .hero-fullwidth {
    min-height: 280px;
    border-radius: 12px;
  }
  .hero-fullwidth-img {
    min-height: 280px;
  }
  .hero-fullwidth-overlay {
    background: linear-gradient(0deg, rgba(35,32,29,0.8) 0%, rgba(35,32,29,0.4) 60%, transparent 100%);
    align-items: flex-end;
    padding-bottom: 2rem;
  }
}

/* ===== HERO ===== */
.hero {
  padding: 3.2rem 0 2.6rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.8rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: #ffe9dd;
  border: 1px solid #f6c8af;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  align-self: flex-start;
}

h1,
h2,
h3 {
  margin: 0 0 0.8rem;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.lead {
  color: var(--muted);
  max-width: 62ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
  padding-top: 0.4rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 12px;
  padding: 0.72rem 1rem;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}

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

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

.btn-light {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.btn-light:hover {
  background: var(--bg-alt);
}

.btn-outline {
  color: var(--accent-dark);
  background: transparent;
  border: 1px solid #e9b79f;
}

.btn-outline:hover {
  background: #ffe9dd;
}

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

.btn-danger:hover {
  background: #a93226;
}

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

.btn-success:hover {
  background: #219a52;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.hero-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.photo-card {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--card);
}

.photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

/* ===== SECTIONS ===== */
.section {
  padding: 2.6rem 0;
}

.section[id],
.hero[id] {
  scroll-margin-top: 96px;
}

.section.alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

/* ===== CARDS ===== */
.cards {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.cards.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card .btn {
  margin-top: auto;
  align-self: flex-start;
  margin-top: 0.8rem;
}

/* ===== BLOG CARDS ===== */
.blog-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(80, 36, 15, 0.14);
}

.blog-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.8rem;
}

.blog-card-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.blog-card-excerpt {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.4rem 0 0;
}

/* ===== BLOG FULL VIEW ===== */
.blog-full {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
}

.blog-full-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1.2rem;
}

.blog-full-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.blog-full-content {
  line-height: 1.7;
  color: var(--ink);
}

.blog-full-content p {
  margin: 0 0 1rem;
  color: var(--ink);
}

.blog-back-btn {
  margin-bottom: 1rem;
}

/* ===== SHOP PRODUCT CARDS ===== */
.product-card {
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(80, 36, 15, 0.14);
}

.product-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.8rem;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-dark);
  margin: 0.5rem 0 0;
}

/* ===== COMMUNITY POSTS ===== */
.community-post {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.community-post-img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.8rem;
}

.community-post-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.community-post-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.community-post-text {
  color: var(--muted);
  line-height: 1.6;
}

/* ===== MODALS ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 500px;
  width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
}

.modal h2 {
  margin-bottom: 1.2rem;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 1rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(209, 97, 47, 0.15);
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.form-success {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.form-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.2rem;
  border-bottom: 2px solid var(--line);
}

.form-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

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

/* ===== ADMIN ===== */
.admin-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.admin-section h3 {
  margin-bottom: 1rem;
  color: var(--accent-dark);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-dark);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.order-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  background: var(--bg-alt);
}

.order-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.order-item-product {
  font-weight: 700;
}

.order-item-date {
  font-size: 0.82rem;
  color: var(--muted);
}

.order-item-details {
  font-size: 0.9rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-new {
  background: #ffe9dd;
  color: var(--accent-dark);
}

.badge-read {
  background: #e8f5e9;
  color: var(--success);
}

/* ===== TWO COL ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  align-items: start;
}

.page-hero {
  padding-top: 2rem;
  padding-bottom: 1.8rem;
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 1.4rem 0 2rem;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.footer-row p {
  margin: 0;
  color: var(--muted);
}

.footer-row a {
  color: var(--muted);
}

/* ===== TOOLBAR ===== */
.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty-state p {
  font-size: 1.1rem;
}

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  z-index: 201;
}

.lightbox-close:hover {
  color: #ccc;
}

/* ===== DRAG-DROP UPLOAD ===== */
.drop-zone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: #fff5ef;
}

.drop-zone input[type="file"] {
  display: none;
}

.drop-zone-preview {
  margin-top: 0.8rem;
}

.drop-zone-preview img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
}

.drop-zone-remove {
  display: inline-block;
  margin-top: 0.4rem;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ===== CAPTCHA ===== */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.captcha-row .captcha-question {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.captcha-row input {
  width: 80px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  text-align: center;
}

.captcha-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(209, 97, 47, 0.15);
}

/* ===== HIDDEN ===== */
.hidden {
  display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  .hero-grid,
  .cards.three,
  .two-col {
    grid-template-columns: 1fr;
  }

  .cards.two {
    grid-template-columns: 1fr;
  }

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

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .header-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 2.2rem;
  }

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

  .photo-card img {
    min-height: 200px;
  }

  .modal {
    padding: 1.2rem;
    margin: 0.5rem;
  }

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