:root {
  --black: #0d0d0d;
  --navy: #1c3a5e;
  --navy-light: #274d78;
  --flame: #e8551f;
  --blue: #3e8fd0;
  --blue-dark: #2f74ac;
  --green: #4caf50;
  --gray-text: #777;
  --border: #ddd;
  --bg: #ffffff;
  --bg-alt: #f4f5f6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg-alt);
  color: #222;
}

a { text-decoration: none; color: inherit; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.topbar {
  background: var(--black);
  color: #ccc;
  font-size: 13px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 10px;
}
.topbar a { margin-right: 20px; color: #ccc; }
.topbar a:hover { color: #fff; }
.topbar .right a { margin-right: 0; margin-left: 20px; }

.lang-toggle {
  display: inline-flex;
  margin-left: 20px;
  border: 1px solid #444;
  border-radius: 3px;
  overflow: hidden;
}
.lang-toggle button {
  background: none;
  border: none;
  color: #999;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}
.lang-toggle button.active { background: var(--blue); color: #fff; }
.lang-toggle button:hover:not(.active) { color: #fff; }

.header-main {
  background: var(--black);
  padding: 18px 0 22px;
}
.header-main .container {
  display: flex;
  align-items: center;
  gap: 30px;
}

.logo { display: flex; align-items: center; }
.logo img { height: 60px; width: auto; display: block; border-radius: 4px; }

.search-bar {
  flex: 1;
  display: flex;
  max-width: 520px;
}
.search-bar input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  border-radius: 3px 0 0 3px;
  font-size: 14px;
}
.search-bar button {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 0 22px;
  border-radius: 0 3px 3px 0;
  cursor: pointer;
  font-size: 14px;
}
.search-bar button:hover { background: var(--blue-dark); }

.cart-link {
  margin-left: auto;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.cart-link:hover { color: #fff; }
.cart-link svg { width: 22px; height: 22px; }
.cart-count {
  background: var(--flame);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- Category nav ---------- */
.catnav {
  background: var(--blue);
}
.catnav .container { display: flex; }
.catnav a {
  color: #fff;
  padding: 16px 22px;
  font-size: 16px;
  font-weight: 600;
}
.catnav a:hover, .catnav a.active { background: var(--blue-dark); }

.breadcrumb {
  padding: 14px 0;
  font-size: 13px;
  color: #999;
}
.breadcrumb a { color: var(--blue); }

/* ---------- Hero ---------- */
.hero {
  background: var(--bg);
  padding: 20px 0;
}
.hero-banner {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: 6px;
  padding: 50px 40px;
  color: #fff;
  text-align: center;
}
.hero-banner h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 34px;
  margin: 0 0 10px;
}
.hero-banner p {
  color: #cfd8e3;
  max-width: 640px;
  margin: 0 auto;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  padding: 30px 0;
}
.tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  text-align: center;
  transition: box-shadow .15s;
}
.tile:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.tile img { width: 100%; height: 190px; object-fit: cover; display: block; }
.tile .tile-label {
  background: var(--navy);
  color: #fff;
  padding: 14px;
  font-weight: 600;
  font-size: 15px;
}

/* ---------- Welcome / intro section ---------- */
.intro {
  background: #262626;
  color: #ddd;
  padding: 40px 0;
  margin-top: 10px;
}
.intro h2 {
  text-align: center;
  color: #bbb;
  font-weight: normal;
  border-bottom: 1px solid #3a3a3a;
  padding-bottom: 18px;
  margin-bottom: 20px;
}
.intro p { line-height: 1.7; max-width: 900px; margin: 0 auto 14px; }

/* ---------- Product grid ---------- */
.page-title {
  font-size: 26px;
  margin: 10px 0 20px;
}

.sortbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.sortbar button {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 18px;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: .5px;
  color: #555;
}
.sortbar button.active, .sortbar button:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-bottom: 50px;
}

.loading-msg {
  grid-column: 1 / -1;
  text-align: center;
  color: #888;
  padding: 60px 0;
}

.chart-status-msg {
  color: #888;
  font-size: 14px;
  padding: 10px 0;
}

.price-chart-block canvas {
  max-height: 320px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  text-align: center;
  position: relative;
}
.card img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  margin-bottom: 14px;
}
.card .name {
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  min-height: 40px;
  margin-bottom: 10px;
}
.card .name:hover { color: var(--blue-dark); text-decoration: underline; }
.card .price {
  color: var(--blue-dark);
  font-weight: bold;
  font-size: 17px;
  margin-bottom: 2px;
}
.card .price .eur { font-size: 12px; font-weight: normal; color: #999; }
.card .stock {
  font-size: 13px;
  margin-bottom: 12px;
}
.card .stock.ok { color: var(--green); }
.card .stock.out { color: var(--gray-text); }
.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.btn.buy { background: var(--blue); color: #fff; }
.btn.buy:hover { background: var(--blue-dark); }
.btn.detail { background: #e4e4e4; color: #444; }
.btn.detail:hover { background: #d3d3d3; }
.btn.danger { background: #fdecea; color: #c0392b; }
.btn.danger:hover { background: #f9d3ce; }
.link-finder {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
}
.link-finder-row { display: flex; gap: 8px; }
.link-finder-row input {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
}
#link-search-status { font-size: 13px; color: #888; margin-top: 8px; }
.link-finder-set { font-weight: 600; font-size: 13px; margin: 10px 0 4px; }
.link-finder-pick { margin: 0 6px 6px 0; }

.pickup-selected {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 14px;
  margin-bottom: 10px;
}
.pickup-selected.chosen { border-color: var(--green); }
.pickup-selected .ps-name { font-weight: 600; }
.pickup-selected .ps-warning { color: #c0392b; margin-top: 6px; }
/* GLS ask for at least 690px; below that the map falls back to full width
   and the picker is still usable, just tighter. */
.parcelshop-map {
  width: 100%;
  min-height: 460px;
  border: 1px solid var(--border);
  border-radius: 3px;
}
.card .btn { margin-top: auto; }

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 420px 1fr;
  align-items: start;
  gap: 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 30px;
  margin-bottom: 50px;
}
.product-detail img { width: 100%; max-height: 460px; object-fit: contain; }
.product-detail h1 { font-size: 24px; margin-top: 0; }
.product-detail .price-big { font-size: 30px; color: var(--blue-dark); font-weight: bold; margin: 16px 0 6px; }
.product-detail .price-eur { color: #999; margin-bottom: 16px; }
.product-detail .qty-row { display: flex; align-items: center; gap: 14px; margin: 20px 0; }
.product-detail .qty-row input { width: 60px; padding: 8px; border: 1px solid var(--border); text-align: center; }
.product-detail .btn.buy { padding: 14px 26px; font-size: 15px; }

.external-links { margin-top: 24px; }
.external-links h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888;
  margin-bottom: 10px;
}
.link-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ext-link {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--blue);
  color: var(--blue-dark);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
}
.ext-link:hover { background: var(--blue); color: #fff; }

.description-block {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 26px;
}
.description-block h2 {
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 16px;
}
.description-block p { line-height: 1.7; margin: 0 0 14px; color: #333; }
.description-block ul { margin: 0 0 14px; padding-left: 22px; line-height: 1.7; color: #333; }
.description-block li { margin-bottom: 4px; }

/* ---------- Cart page ---------- */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  margin-bottom: 30px;
}
.cart-table th, .cart-table td {
  border-bottom: 1px solid var(--border);
  padding: 14px 10px;
  text-align: left;
  font-size: 14px;
}
.cart-table img { width: 60px; height: 60px; object-fit: contain; }
.cart-table input[type=number] { width: 55px; padding: 6px; border: 1px solid var(--border); }
.cart-table .remove { color: #c0392b; cursor: pointer; font-size: 13px; background: none; border: none; }
.cart-total { text-align: right; font-size: 18px; font-weight: bold; margin-bottom: 30px; }
.empty-cart { padding: 60px 0; text-align: center; color: #888; }

/* ---------- Admin ---------- */
.admin-table th, .admin-table td { vertical-align: middle; }
.admin-thumb { width: 50px; height: 50px; object-fit: contain; }
.admin-section-divider { border-top: 2px solid var(--border); margin: 50px 0 30px; }
.admin-group-row td {
  background: #f4f5f6;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #666;
  padding: 8px 10px;
  border-top: 2px solid var(--border);
}
.reorder-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  width: 26px;
  height: 26px;
  font-size: 12px;
  color: #555;
}
.reorder-btn:disabled { opacity: .3; cursor: default; }
.reorder-btn:hover:not(:disabled) { background: #eee; }

.paid-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.paid-badge.paid { background: #e3f5e6; color: #2e7d32; }
.paid-badge.unpaid { background: #fdecea; color: #c0392b; }

.admin-form-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  margin-top: 10px;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.admin-form-grid .span-2 { grid-column: 1 / -1; }
.admin-form-grid label { font-size: 14px; font-weight: 600; color: #444; }
.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-top: 4px;
  font-family: inherit;
  font-size: 14px;
}
.link-edit-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  margin-bottom: 8px;
}
.link-edit-row input {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
}
.link-edit-row .remove-link-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  color: #c0392b;
}

/* ---------- Checkout ---------- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
  margin-bottom: 50px;
}
.checkout-layout h2 {
  font-size: 16px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-group label { font-weight: normal; font-size: 14px; }
.checkout-note { font-size: 13px; color: #888; margin-top: 10px; }
.checkout-summary { position: sticky; top: 20px; }
.checkout-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.checkout-summary-total {
  font-size: 18px;
  font-weight: bold;
  text-align: right;
  margin-top: 16px;
  color: var(--blue-dark);
}

@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
footer {
  background: var(--black);
  color: #999;
  padding: 30px 0;
  font-size: 13px;
  margin-top: 40px;
}
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
footer strong { color: #ccc; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: 1fr; }
  .product-detail { grid-template-columns: 1fr; }
  .header-main .container { flex-wrap: wrap; }
  .search-bar { order: 3; max-width: 100%; }
  .cart-link { margin-left: 0; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .catnav .container { flex-wrap: wrap; }
}
