﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #4b5563;
  --accent: #111827;
  --accent-soft: #eceff3;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-y: scroll; /* keep scrollbar space to prevent layout shift across pages */
}
a { color: inherit; text-decoration: none; }

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 248, 250, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}
.brand-logo { font-weight: 700; font-size: 18px; color: var(--accent); }
.nav-links { display: flex; gap: 12px; justify-content: center; }
.nav-links a { padding: 8px 12px; border-radius: 10px; color: var(--muted); }
.nav-links a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-cta { display: flex; justify-content: flex-end; gap: 10px; align-items: center; flex-wrap: nowrap; }
.cart-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
  color: var(--muted);
}
.btn {
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 25px rgba(47, 47, 56, 0.25); }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text); }

main { max-width: 1200px; margin: 28px auto; padding: 0 16px 50px; }
.section, .order-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.order-card__header, .section-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { padding: 6px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; border: 1px solid var(--border); }
.helper { color: var(--muted); font-size: 14px; }

.search-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search-row input {
  flex: 1;
  min-width: 240px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(15,23,42,0.16);
}
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: linear-gradient(120deg, #e9f1ff, #f4e9ff); color: var(--accent); border-radius: 10px; font-weight: 700; width: fit-content; }
.card h3 { margin: 0; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }
.card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  gap: 10px;
  flex-wrap: wrap;
}
.product-card {
  background: linear-gradient(135deg, #ffffff, #f7fbff);
  border: 1px solid #e7ecf3;
  padding: 18px;
  min-height: 200px;
}
.product-card:hover {
  background: linear-gradient(135deg, #ffffff, #eef5ff);
}
.research-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .product-card .meta {
    flex-direction: column;
    align-items: flex-start;
  }
  .product-card .meta .btn {
    width: 100%;
    text-align: center;
  }
}

.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.cart-summary .total-row { display: flex; justify-content: space-between; padding: 6px 0; font-weight: 700; }
.cart-table-wrapper { overflow-x: auto; }

/* Totals */
.order-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.summary-label { font-size: 12px; color: var(--muted); letter-spacing: 0.3px; text-transform: uppercase; }
.summary-total { font-weight: 800; font-size: 18px; }

/* Form layout */
.order-form { margin-top: 10px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 14px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-weight: 700; color: var(--text); }
.form-field input {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
}
.form-field input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Qty dropdown styling */
.qty-select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 700;
  color: var(--text);
  min-width: 72px;
  box-shadow: 0 8px 16px rgba(15,23,42,0.08);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.qty-select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.order-popup {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(3px); padding: 16px; z-index: 99;
}
.order-popup.show { display: flex; }
.order-popup-card { background: #fff; color: var(--text); border-radius: 12px; padding: 20px; max-width: 380px; width: 100%; box-shadow: var(--shadow); position: relative; }
.order-popup-close { position: absolute; top: 10px; right: 10px; border: 1px solid var(--border); border-radius: 50%; width: 28px; height: 28px; background: #fff; cursor: pointer; }

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #111827;
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 99;
  font-weight: 600;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.hidden { display: none; }

/* Currency dropdown */
.currency-select { position: relative; }
.currency-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  min-width: 140px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.06);
}
.currency-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.currency-trigger .currency-label { font-weight: 700; color: var(--text); font-size: 14px; }
.currency-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(15,23,42,0.12);
  min-width: 200px;
  padding: 8px;
  display: none;
  z-index: 5;
}
.currency-menu.open { display: block; }
.currency-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  text-align: left;
}
.currency-option:hover { background: var(--accent-soft); }
.currency-option .option-text { font-weight: 600; color: var(--text); font-size: 14px; }
.flag-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 18px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.flag-eu { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'><rect width='60' height='40' fill='%23003f9e'/><g fill='%23ffcc00'><g id='c'><circle cx='30' cy='8' r='2.2'/></g><use href='%23c' transform='rotate(30 30 20)'/><use href='%23c' transform='rotate(60 30 20)'/><use href='%23c' transform='rotate(90 30 20)'/><use href='%23c' transform='rotate(120 30 20)'/><use href='%23c' transform='rotate(150 30 20)'/><use href='%23c' transform='rotate(180 30 20)'/><use href='%23c' transform='rotate(210 30 20)'/><use href='%23c' transform='rotate(240 30 20)'/><use href='%23c' transform='rotate(270 30 20)'/><use href='%23c' transform='rotate(300 30 20)'/><use href='%23c' transform='rotate(330 30 20)'/><use href='%23c' transform='rotate(360 30 20)'/></g></svg>"); }
.flag-us { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'><rect width='60' height='40' fill='%23b22234'/><g fill='%23fff'><rect width='60' height='4' y='4'/><rect width='60' height='4' y='12'/><rect width='60' height='4' y='20'/><rect width='60' height='4' y='28'/><rect width='60' height='4' y='36'/></g><rect width='26' height='18' fill='%23003f87'/><g id='s' fill='%23fff' transform='translate(2 2) scale(0.6)'><polygon points='1,0 1.6,1.9 3.7,1.9 2,3.1 2.6,5 1,3.9 -0.6,5 0,3.1 -1.7,1.9 0.4,1.9'/></g><g transform='translate(2 2) scale(1)'><use href='%23s'/><use href='%23s' x='6'/><use href='%23s' x='12'/><use href='%23s' x='18'/><use href='%23s' x='24'/><use href='%23s' x='30'/><use href='%23s' x='3' y='4'/><use href='%23s' x='9' y='4'/><use href='%23s' x='15' y='4'/><use href='%23s' x='21' y='4'/><use href='%23s' x='27' y='4'/><use href='%23s' x='3' y='8'/><use href='%23s' x='9' y='8'/><use href='%23s' x='15' y='8'/><use href='%23s' x='21' y='8'/><use href='%23s' x='27' y='8'/></g></svg>"); }
.flag-ca { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'><rect width='60' height='40' fill='%23ff0000'/><rect x='12' width='36' height='40' fill='%23fff'/><path fill='%23ff0000' d='M30 6l-2 6h-5l4 4-1 5 4-3 4 3-1-5 4-4h-5z'/></svg>"); }
.flag-gb { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'><rect width='60' height='40' fill='%23012c63'/><path fill='%23fff' d='M0 16h60v8H0zM26 0h8v40h-8z'/><path fill='%23c8102e' d='M0 18h60v4H0zM28 0h4v40h-4z'/><path fill='%23fff' d='M0 0l24 16h-8L0 4zm60 0L36 16h8L60 4zM0 40l24-16h-8L0 36zm60 0L36 24h8l16 12z'/><path fill='%23c8102e' d='M0 0l20 13h-5L0 3zm60 0L40 13h5l15-10zM0 40l20-13h-5L0 37zm60 0L40 27h5l15 10z'/></svg>"); }
@media (max-width: 720px) {
  .nav-shell { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .nav-cta { width: 100%; justify-content: center; flex-wrap: wrap; }
  .search-row { flex-direction: column; align-items: stretch; }
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .btn { width: 100%; text-align: center; }
  .form-grid { grid-template-columns: 1fr; }
  .order-card__header { flex-direction: column; align-items: flex-start; }
}

