/* ===== YachtSale — global styles (mobile-first, responsive) ===== */

:root {
  --navy-900: #0a1628;
  --navy-800: #10203a;
  --navy-700: #1a2f4d;
  --navy-100: #e8eef6;
  --gold: #c9a45c;
  --gold-light: #e3c88f;
  --ink: #1c2433;
  --ink-soft: #55607a;
  --paper: #faf8f4;
  --white: #ffffff;
  --line: #e3ddd1;
  --danger: #b4483e;
  --ok: #2e7d5b;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(10, 22, 40, 0.12);
  --font-serif: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
main { flex: 1; }

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

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 22, 40, 0.96);
  backdrop-filter: blur(8px);
  color: var(--white);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 0; gap: 1rem;
}
.brand {
  font-family: var(--font-serif);
  font-size: 1.15rem; letter-spacing: 0.08em;
  color: var(--white); white-space: nowrap;
  display: flex; align-items: center; gap: 0.65rem;
}
.brand img { height: 36px; width: auto; }
.brand em { color: var(--gold); font-style: normal; }
.main-nav { display: flex; align-items: center; gap: 1.4rem; }
.main-nav a {
  font-size: 0.95rem; color: var(--navy-100);
  padding: 0.3rem 0; border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active { color: var(--gold-light); border-bottom-color: var(--gold); }
.lang-toggle {
  background: transparent; border: 1px solid var(--gold);
  color: var(--gold-light); border-radius: 999px;
  padding: 0.2rem 0.75rem; font-size: 0.82rem; letter-spacing: 0.05em;
}
.lang-toggle:hover { background: var(--gold); color: var(--navy-900); }
.nav-burger { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; }

@media (max-width: 720px) {
  .nav-burger { display: block; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--navy-800); padding: 0.8rem 4%;
    gap: 0.4rem; display: none;
    border-top: 1px solid var(--navy-700);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 0.6rem 0; }
  .lang-toggle { align-self: flex-start; margin-top: 0.4rem; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy-900) 30%, var(--navy-700));
  color: var(--white);
  padding: 5.5rem 0 4.5rem;
  overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(201, 164, 92, 0.18), transparent 55%),
    repeating-linear-gradient(-8deg, transparent 0 46px, rgba(255,255,255,0.025) 46px 48px);
  pointer-events: none;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 400; letter-spacing: 0.04em;
  max-width: 18em;
}
.hero h1 em { color: var(--gold-light); font-style: italic; }
.hero p { margin-top: 1rem; color: var(--navy-100); max-width: 34em; font-size: 1.02rem; }
.hero .cta-row { margin-top: 1.8rem; display: flex; gap: 0.8rem; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 0.7rem 1.6rem;
  border-radius: 6px; font-size: 0.95rem; letter-spacing: 0.05em;
  border: 1px solid transparent; transition: 0.15s;
}
.btn-gold { background: var(--gold); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { border-color: var(--gold); color: var(--gold-light); background: transparent; }
.btn-outline:hover { background: rgba(201,164,92,0.12); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }

/* ===== Sections ===== */
.section { padding: 3.2rem 0; }
.section-title {
  font-family: var(--font-serif); font-size: 1.7rem; font-weight: 400;
  letter-spacing: 0.05em; color: var(--navy-800);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.section-title small { font-family: var(--font-sans); font-size: 0.9rem; color: var(--ink-soft); }
.section-title::after {
  content: ''; flex: 1 1 40px; height: 1px; background: var(--line); align-self: center;
}

/* ===== Yacht cards grid ===== */
.yacht-grid {
  display: grid; gap: 1.4rem; margin-top: 1.6rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.yacht-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
}
.yacht-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(10,22,40,0.18); }
.yacht-card .thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--navy-100); position: relative; }
.yacht-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.yacht-card:hover .thumb img { transform: scale(1.04); }
.badge-type {
  position: absolute; top: 0.7rem; left: 0.7rem;
  background: rgba(10,22,40,0.82); color: var(--gold-light);
  font-size: 0.72rem; letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem; border-radius: 999px; text-transform: uppercase;
}
.yacht-card .body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.yacht-card h3 { font-family: var(--font-serif); font-size: 1.18rem; font-weight: 400; color: var(--navy-800); }
.yacht-card .spec-line { font-size: 0.85rem; color: var(--ink-soft); }
.yacht-card .price { margin-top: auto; padding-top: 0.5rem; font-size: 1.1rem; color: var(--gold); font-weight: 600; }
.yacht-card .loc { font-size: 0.8rem; color: var(--ink-soft); }

/* ===== Filter bar ===== */
.filter-bar {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.2rem;
  display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end;
}
.filter-bar .field { display: flex; flex-direction: column; gap: 0.25rem; }
.filter-bar label { font-size: 0.75rem; letter-spacing: 0.06em; color: var(--ink-soft); text-transform: uppercase; }
.filter-bar input, .filter-bar select, .form-grid input, .form-grid select, .form-grid textarea {
  padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 6px;
  font-size: 0.92rem; font-family: inherit; background: var(--white); color: var(--ink);
  min-width: 0;
}
.filter-bar input, .filter-bar select { height: 40px; }
.filter-bar input:focus, .filter-bar select:focus,
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: 2px solid var(--gold); outline-offset: -1px; border-color: var(--gold);
}
.filter-bar input[type="search"] { width: 100%; }
.filter-bar .range-pair { display: flex; gap: 0.4rem; }
.filter-bar .range-pair input { width: 6.5em; }

@media (max-width: 720px) {
  .filter-bar { padding: 0.9rem; }
  .filter-bar .field { flex: 1 1 45%; }
  .filter-bar .range-pair input { width: 100%; }
}

/* ===== Pagination ===== */
.pagination { display: flex; gap: 0.4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pagination button {
  min-width: 2.4rem; padding: 0.45rem 0.7rem;
  border: 1px solid var(--line); background: var(--white); border-radius: 6px; font-size: 0.9rem;
}
.pagination button.current { background: var(--navy-800); color: var(--white); border-color: var(--navy-800); }
.pagination button:disabled { opacity: 0.4; cursor: default; }

/* ===== Detail page ===== */
.detail-head { padding: 2.2rem 0 0.6rem; }
.detail-head h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--navy-800); }
.detail-head .sub { color: var(--ink-soft); margin-top: 0.2rem; }
.detail-head .price { font-size: 1.5rem; color: var(--gold); font-weight: 600; margin-top: 0.5rem; }

.gallery { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--navy-900); }
.gallery .main-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.gallery .gal-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(10,22,40,0.6); color: #fff; border: none;
  width: 2.6rem; height: 2.6rem; border-radius: 50%; font-size: 1.2rem;
}
.gallery .gal-btn:hover { background: rgba(10,22,40,0.85); }
.gallery .gal-prev { left: 0.8rem; }
.gallery .gal-next { right: 0.8rem; }
.gallery .counter {
  position: absolute; right: 0.8rem; bottom: 0.8rem;
  background: rgba(10,22,40,0.7); color: #fff; font-size: 0.8rem;
  padding: 0.15rem 0.6rem; border-radius: 999px;
}
.thumbs { display: flex; gap: 0.5rem; margin-top: 0.6rem; overflow-x: auto; padding-bottom: 0.3rem; }
.thumbs img {
  width: 88px; height: 60px; object-fit: cover; border-radius: 6px; cursor: pointer;
  opacity: 0.6; border: 2px solid transparent; flex: none;
}
.thumbs img.active { opacity: 1; border-color: var(--gold); }

.detail-cols { display: grid; gap: 2rem; margin-top: 1.8rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .detail-cols { grid-template-columns: 1.6fr 1fr; } }

.spec-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.spec-table th, .spec-table td { padding: 0.65rem 1rem; text-align: left; font-size: 0.92rem; border-bottom: 1px solid var(--line); }
.spec-table th { width: 42%; color: var(--ink-soft); font-weight: 500; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }

.feature-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem; }
.feature-chips span {
  background: var(--navy-100); color: var(--navy-800);
  border-radius: 999px; padding: 0.25rem 0.8rem; font-size: 0.82rem;
}

.inquiry-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem; position: sticky; top: 84px;
}
.inquiry-card h3 { font-family: var(--font-serif); font-weight: 400; font-size: 1.25rem; color: var(--navy-800); margin-bottom: 0.8rem; }
.form-grid { display: grid; gap: 0.7rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-hint { font-size: 0.82rem; color: var(--ink-soft); }
.form-msg { font-size: 0.9rem; padding: 0.6rem 0.8rem; border-radius: 6px; display: none; }
.form-msg.ok { display: block; background: #e6f4ec; color: var(--ok); }
.form-msg.err { display: block; background: #fbeae8; color: var(--danger); }

.description-block { margin-top: 1.6rem; max-width: 70ch; color: var(--ink); }
.description-block h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.4rem; color: var(--navy-800); margin-bottom: 0.6rem; }
.source-note { font-size: 0.78rem; color: var(--ink-soft); margin-top: 1rem; }

/* ===== Admin ===== */
.admin-wrap { max-width: 1100px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.6rem 0; flex-wrap: wrap; }
.admin-topbar h1 { font-family: var(--font-serif); font-weight: 400; color: var(--navy-800); }
.login-card { max-width: 380px; margin: 12vh auto 0; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.login-card h1 { font-family: var(--font-serif); font-weight: 400; font-size: 1.4rem; margin-bottom: 1rem; color: var(--navy-800); }

.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 0.9rem; }
.admin-table th, .admin-table td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { background: var(--navy-800); color: var(--white); font-weight: 500; }
.admin-table img { width: 72px; height: 48px; object-fit: cover; border-radius: 4px; }
.admin-table .row-actions { display: flex; gap: 0.4rem; }
.admin-table .row-actions button { padding: 0.3rem 0.7rem; font-size: 0.8rem; border-radius: 5px; border: 1px solid var(--line); background: var(--white); }
.admin-table .row-actions .del { color: var(--danger); border-color: var(--danger); }
.admin-table-wrap { overflow-x: auto; }

.editor-panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem; margin-top: 1.4rem; }
.editor-panel h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.3rem; color: var(--navy-800); margin-bottom: 1rem; }
.editor-grid { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.editor-grid .field { display: flex; flex-direction: column; gap: 0.25rem; }
.editor-grid label { font-size: 0.78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.editor-grid .span2 { grid-column: span 2; }
@media (max-width: 560px) { .editor-grid .span2 { grid-column: auto; } }

.image-list { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.8rem; }
.image-list .img-item { position: relative; width: 110px; }
.image-list img { width: 110px; height: 74px; object-fit: cover; border-radius: 6px; }
.image-list .img-item button {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: var(--danger); color: #fff; font-size: 0.75rem; line-height: 1;
}
.image-list .img-item .cover-tag {
  position: absolute; left: 4px; bottom: 4px; background: var(--gold); color: var(--navy-900);
  font-size: 0.65rem; padding: 0 0.4rem; border-radius: 999px;
}

.tabs { display: flex; gap: 0.5rem; margin: 1rem 0; }
.tabs button { padding: 0.5rem 1.1rem; border-radius: 6px; border: 1px solid var(--line); background: var(--white); }
.tabs button.active { background: var(--navy-800); color: var(--white); border-color: var(--navy-800); }

.demo-banner {
  background: #fff7e0; border: 1px solid var(--gold); color: #7a5c1e;
  border-radius: 8px; padding: 0.7rem 1rem; font-size: 0.85rem; margin-top: 1rem;
}

/* ===== Footer ===== */
.site-footer { background: var(--navy-900); color: var(--navy-100); margin-top: 4rem; }
.site-footer .container { padding: 2.4rem 0 1.6rem; display: grid; gap: 1.6rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .site-footer .container { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { font-family: var(--font-serif); font-weight: 400; color: var(--gold-light); margin-bottom: 0.6rem; letter-spacing: 0.06em; }
.site-footer a { display: block; padding: 0.15rem 0; font-size: 0.9rem; }
.site-footer a:hover { color: var(--gold-light); }
.footer-bottom { border-top: 1px solid var(--navy-700); padding: 1rem 0; font-size: 0.8rem; color: var(--ink-soft); }
.footer-bottom .container { padding: 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

/* ===== Utility ===== */
.loading, .empty-state { text-align: center; color: var(--ink-soft); padding: 3rem 0; font-size: 0.95rem; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 0.8rem;
  border: 3px solid var(--line); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
