/* Driftmark — 2010 shop, Velaryon sea palette, responsive */
:root {
  --navy: #0c2340;
  --navy-mid: #143352;
  --teal: #1a6b66;
  --teal-deep: #145652;
  --seafoam: #8fb8b4;
  --silver: #c5d0d8;
  --paper: #e8eef2;
  --ink: #1a2430;
  --muted: #4a5d6a;
  --line: #b8c5ce;
  --white: #fff;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body {
  margin: 0;
  padding: 0;
}
body {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-width: 0;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; border: 0; display: block; }
a { color: var(--navy); text-decoration: underline; }
a:hover { color: var(--teal); }
a.logo, nav a, .btn, .card h3 a { text-decoration: none; }

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  background: var(--navy);
  background: linear-gradient(to bottom, #143352 0%, #0c2340 100%);
  border-bottom: 3px solid var(--teal);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset;
  flex-shrink: 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.logo {
  font-size: 18px;
  font-weight: bold;
  color: #f3f6f8;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 #061018;
  white-space: nowrap;
}
.logo:hover { color: #fff; }
.logo span {
  font-weight: normal;
  color: var(--seafoam);
  font-size: 11px;
  margin-left: 8px;
  letter-spacing: 0;
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
}
nav a {
  margin-left: 18px;
  color: var(--silver);
  font-size: 13px;
  padding: 6px 0;
}
nav a:first-child { margin-left: 0; }
nav a:hover { color: #fff; text-decoration: underline; }

main.wrap {
  padding-top: 24px;
  padding-bottom: 48px;
  flex: 1 0 auto;
  width: 100%;
}

h1 {
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 8px;
  color: var(--navy);
}
h2 {
  font-size: 14px;
  font-weight: bold;
  margin: 28px 0 10px;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
}
.lead {
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 560px;
}
.muted { color: var(--muted); font-size: 12px; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(12,35,64,0.06);
  min-width: 0;
}
.card-body {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card h3 {
  margin: 0 0 4px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.card h3 a { color: var(--navy); }
.card h3 a:hover { color: var(--teal); text-decoration: underline; }
.tag {
  display: inline-block;
  align-self: flex-start;
  width: auto;
  font-size: 10px;
  color: var(--teal-deep);
  border: 1px solid var(--seafoam);
  background: #eef6f5;
  padding: 1px 6px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card .price {
  font-weight: bold;
  color: var(--navy);
  margin-top: auto;
  padding-top: 10px;
}
.card .actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.card .muted, .card p {
  overflow-wrap: anywhere;
}

.thumb, .thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  background: var(--navy);
  border-bottom: 1px solid var(--line);
}
.product-image {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--navy);
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 8px;
}

.btn {
  display: inline-block;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.2;
  border: 1px solid var(--teal-deep);
  border-radius: 3px;
  background: var(--teal);
  background: linear-gradient(to bottom, #2a8a82 0%, #1a6b66 100%);
  color: #fff;
  cursor: pointer;
  text-align: center;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset;
  min-height: 32px;
}
.btn:hover {
  background: #21807a;
  background: linear-gradient(to bottom, #33968e 0%, #1a6b66 100%);
  color: #fff;
  text-decoration: none;
}
.btn:active {
  background: var(--teal-deep);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25) inset;
}
.btn-ghost {
  background: var(--white);
  background: linear-gradient(to bottom, #fff 0%, #e8eef2 100%);
  color: var(--navy);
  border-color: var(--navy);
  text-shadow: none;
  box-shadow: 0 1px 0 #fff inset;
}
.btn-ghost:hover {
  background: #eef6f5;
  color: var(--navy);
}
.btn-danger {
  background: var(--white);
  background: linear-gradient(to bottom, #fff 0%, #e8eef2 100%);
  color: var(--navy);
  border-color: var(--navy);
  text-shadow: none;
}
.btn-danger:hover { background: #e8eef2; color: var(--navy); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.product-meta {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px;
  min-width: 0;
}
.product-meta .price-lg,
.price-lg {
  font-size: 20px;
  font-weight: bold;
  color: var(--navy);
  margin: 8px 0;
}
.desc { white-space: pre-wrap; color: var(--ink); overflow-wrap: anywhere; }
.includes {
  list-style: disc;
  margin: 8px 0 0 18px;
  padding: 0;
  color: var(--muted);
}

label { display: block; margin: 12px 0 4px; font-size: 12px; color: var(--muted); }
select,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 8px;
  border: 1px solid #9aabb8;
  background: var(--white);
  width: 100%;
  max-width: 320px;
  color: var(--ink);
  border-radius: 2px;
}
textarea { min-height: 90px; max-width: 100%; resize: vertical; }

.box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px;
  margin-top: 12px;
  min-width: 0;
}
.notice {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
  border-radius: 2px;
}
.notice.warn { background: #eef3f5; border-color: var(--silver); }
.notice.ok { background: #eef6f5; border-color: var(--seafoam); }
.mono {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.plain {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.plain th, table.plain td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.plain th { color: var(--muted); font-weight: normal; width: 140px; }

table.admin {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--white);
  border: 1px solid var(--line);
}
table.admin th, table.admin td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #d5dee5;
  vertical-align: middle;
}
table.admin th {
  background: var(--navy);
  color: var(--paper);
  font-weight: normal;
}
table.admin .thumb-sm {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--navy);
}

.site-footer {
  border-top: 3px solid var(--teal);
  background: var(--navy);
  background: linear-gradient(to bottom, #143352 0%, #0a1b30 100%);
  padding: 16px 0;
  font-size: 12px;
  color: var(--seafoam);
  flex-shrink: 0;
  margin-top: auto;
}
.site-footer a { color: var(--silver); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hero {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 3px;
  padding: 22px 20px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(12,35,64,0.05);
}
.hero h1 { font-size: 26px; margin-bottom: 6px; }
.hero p { margin: 8px 0 0; color: var(--muted); max-width: 540px; }
.hero .actions { margin-top: 16px; }

.admin-gate, .admin-panel { max-width: 760px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.form-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .product-layout { grid-template-columns: 1fr; }
  .product-image { max-height: 220px; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  nav {
    width: 100%;
    border-top: 1px solid #1a4a58;
    padding-top: 6px;
    gap: 0 16px;
  }
  nav a { margin-left: 0; }
  h1 { font-size: 20px; }
  .hero { padding: 16px 14px; }
  .hero h1 { font-size: 22px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card .actions .btn { flex: 1 1 auto; }
  select, input[type="text"], input[type="password"],
  input[type="number"], input[type="file"], textarea {
    max-width: 100%;
  }
  table.plain, table.plain tbody, table.plain tr, table.plain th, table.plain td {
    display: block;
    width: 100%;
  }
  table.plain th {
    width: auto;
    border-bottom: 0;
    padding-bottom: 0;
    font-size: 11px;
  }
  table.plain td { padding-top: 2px; word-break: break-all; }
  .footer-inner { flex-direction: column; gap: 6px; }
  .form-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .wrap { padding: 0 12px; }
  .logo { font-size: 16px; }
}
