/* ============================================================
   site-vb.css — Shop2021 re-skin (Phase B)
   Mirrors the VariantB design system from the new Astro site.
   Loaded AFTER css/all.css so it overrides legacy rules.
   ------------------------------------------------------------
   Source of truth: servo-web-astro-git/src/layouts/VariantBBase.astro
   Adapted for ASP.NET Web Forms 4.8 (form#form1, asp:Panel,
   asp:Table, asp:TextBox, asp:DropDownList, asp:Button render
   as <form>, <div>, <table>, <input type=text>, <select>,
   <input type=submit>).
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  --bg-base: #0D1117;
  --bg-elevated: #161B22;
  --bg-card: #1A2130;
  --bg-glass: rgba(22, 27, 34, 0.7);
  --border-subtle: rgba(255,255,255,0.07);
  --border-glow: rgba(56,189,248,0.25);

  --cyan: #38BDF8;
  --cyan-glow: rgba(56,189,248,0.15);
  --cyan-deep: #0EA5E9;
  --electric: #00D4FF;

  --text-primary: #F0F6FC;
  --text-secondary: rgba(240,246,252,0.82);
  --text-muted: rgba(240,246,252,0.68);

  --green: #34D399;
  --amber: #FBBF24;
  --red: #F87171;

  --shadow-cyan: 0 0 24px rgba(56,189,248,0.18);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 60px rgba(0,0,0,0.5);

  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* ---------- RESET / BASE OVERRIDES ----------
   Legacy css/all.css fixes body{font-family:Arial}, sets table
   border-collapse !important, defines .wrapper{width:864px},
   .main_content{width:621px;border:1px solid #000}, etc.
   We override all of those with higher specificity (html body
   selectors) or simple rules that apply once the legacy match
   is overridden by document order. */

html, body {
  background: var(--bg-base);
  color: var(--text-primary);
}

html body {
  font-family: 'DM Sans', 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

html body a,
html body a:link,
html body a:visited {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.15s;
}
html body a:hover,
html body a:active {
  color: var(--electric);
  text-decoration: underline;
}

html body h1,
html body h2,
html body h3,
html body h4,
html body h5 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1.25rem 0 0.75rem;
  line-height: 1.25;
}
html body h1 { font-size: 2rem; }
html body h2 { font-size: 1.5rem; }
html body h3 { font-size: 1.25rem; }
html body h4 { font-size: 1.0625rem; }
html body h5 { font-size: 0.9375rem; }

html body p { color: var(--text-secondary); margin: 0.75rem 0; }

/* ---------- LAYOUT WRAPPER OVERRIDES ----------
   Legacy: div.wrapper{width:864px}, div.main_content{width:621px;
   border:1px solid #000;float:left}. Reset to fluid centred layout. */

html body div.wrapper {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

html body div.main_content,
html body div.main_content_index {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  border: none;
  float: none;
  min-height: auto;
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
}

html body div.main_content > h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

html body div.main_content p,
html body div.main_content ul,
html body div.main_content ol {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0.75rem 0;
}

html body div.main_content img {
  display: inline-block;
  float: none;
}

/* Hide the legacy left_column completely — its links are folded into
   the new vb-nav. Each language Panel still wraps a left_column block
   in the legacy markup; we re-style or hide based on header context. */
html body .left_column {
  display: none !important;
}

/* ---------- HEADER ---------- */
.vb-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(13,17,23,0.92);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
}
.vb-header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.vb-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}
.vb-logo:hover { text-decoration: none; }
.vb-logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--cyan-deep), var(--electric));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(56,189,248,0.35);
  flex-shrink: 0;
}
.vb-logo-wordmark {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}
.vb-logo-wordmark span { color: var(--cyan); }

.vb-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
/* Each asp:Panel inside .vb-nav renders as <div> — display:contents lets
   the inner <a> tags participate directly in the parent flex flow. */
.vb-nav .vb-nav-langgroup {
  display: contents;
}
.vb-nav a,
.vb-nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.vb-nav a:hover,
.vb-nav-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}

.vb-header-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.vb-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  color: var(--text-primary);
}

/* ---------- BUTTONS (chrome) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none !important;
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1;
}
.btn-primary {
  background: linear-gradient(135deg, var(--cyan-deep) 0%, var(--electric) 100%);
  color: #0D1117 !important;
  font-weight: 700;
  box-shadow: 0 0 0 0 rgba(56,189,248,0);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(56,189,248,0.4);
}
.btn-outline {
  background: transparent;
  color: var(--cyan) !important;
  border: 1px solid rgba(56,189,248,0.4);
}
.btn-outline:hover {
  background: var(--cyan-glow);
  border-color: var(--cyan);
}
.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary) !important;
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost:hover { background: rgba(255,255,255,0.13); }
.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

/* ---------- WEB FORMS CONTROLS ----------
   asp:Button -> <input type="submit"> (server-side form post).
   asp:TextBox -> <input type="text">.
   asp:DropDownList -> <select>.
   asp:CheckBox -> <input type="checkbox"> wrapped in span.
   asp:Table -> <table> (no class by default; legacy uses .nobord cells).
   We style all form-control elements globally. */

html body input[type="text"],
html body input[type="email"],
html body input[type="password"],
html body input[type="tel"],
html body input[type="number"],
html body input[type="search"],
html body textarea,
html body select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  /* keep legacy width: most asp:TextBox have Width="80%" inline */
}

html body select {
  /* native dropdown caret on dark bg — re-add via background-image */
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  background-color: var(--bg-card);
  padding-right: 2rem;
}

html body input[type="text"]:focus,
html body input[type="email"]:focus,
html body input[type="password"]:focus,
html body input[type="tel"]:focus,
html body input[type="number"]:focus,
html body input[type="search"]:focus,
html body textarea:focus,
html body select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
  background: var(--bg-elevated);
}

html body input[type="text"]::placeholder,
html body input[type="email"]::placeholder,
html body input[type="password"]::placeholder,
html body input[type="tel"]::placeholder,
html body textarea::placeholder {
  color: var(--text-muted);
}

html body input[type="checkbox"],
html body input[type="radio"] {
  accent-color: var(--cyan);
  width: 1rem;
  height: 1rem;
  vertical-align: middle;
  margin-right: 0.4rem;
}

/* Submit/asp:Button — give them the .btn-primary feel even without
   a class, so existing forms inherit the new look without code changes. */
html body input[type="submit"],
html body input[type="button"],
html body button[type="submit"],
html body button[type="button"] {
  background: linear-gradient(135deg, var(--cyan-deep) 0%, var(--electric) 100%);
  color: #0D1117;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
html body input[type="submit"]:hover,
html body input[type="button"]:hover,
html body button[type="submit"]:hover,
html body button[type="button"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(56,189,248,0.4);
}
html body input[type="submit"]:disabled,
html body input[type="button"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* "Back" / secondary buttons — by ID convention btnBack reverts to ghost */
html body input[type="submit"][id$="btnBack"],
html body input[type="submit"][id$="rbEnterNewAddress"] {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.12);
}
html body input[type="submit"][id$="btnBack"]:hover,
html body input[type="submit"][id$="rbEnterNewAddress"]:hover {
  background: rgba(255,255,255,0.13);
  box-shadow: none;
  transform: none;
}

html body label,
html body span.aspNetLabel {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ---------- TABLES (legacy + asp:Table) ---------- */
html body table {
  border-collapse: collapse;
  background: transparent;
  color: var(--text-primary);
}

html body div.main_content table {
  width: 100%;
  max-width: 720px;
  margin: 0.5rem 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

html body div.main_content table td,
html body div.main_content table th,
html body div.main_content tbody td {
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.6rem 0.85rem;
  vertical-align: top;
  color: var(--text-primary);
}
html body div.main_content table tr:last-child td {
  border-bottom: none;
}

/* legacy "nobord" class used everywhere on TableCell for invoice form */
html body td.nobord,
html body .nobord {
  border: none !important;
  background: transparent !important;
  padding: 0.4rem 0.5rem;
}

/* The bottom Back/Next buttons live in a borderless layout table — keep flush */
html body div.main_content table:has(td.nobord) {
  background: transparent;
  border: none;
}

/* ---------- FOOTER ---------- */
html body div.footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: auto;
  width: 100%;
}
html body div.footer .container,
html body div.footer > div {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
html body div.footer p {
  color: var(--text-muted);
  margin: 0.4rem 0;
  font-size: 0.8125rem;
}
html body div.footer ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
html body div.footer li { margin: 0; }
html body div.footer li a,
html body div.footer a {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  text-decoration: none;
}
html body div.footer li a:hover,
html body div.footer a:hover {
  color: var(--cyan);
  text-decoration: underline;
}

/* ---------- VALIDATION SUMMARY ---------- */
html body div[id$="ValidationSummary1"],
html body .validation-summary {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--red);
  margin: 1rem 0;
}

/* ---------- HEADING COLOUR OVERRIDES ----------
   Legacy css/all.css has `div.main_content h2 { color: #000 }` (and h3/h4/h5)
   which beats the looser `html body h2` rule in document order + specificity.
   Force theme colour for headings inside the main content area, including
   when they are wrapped in an <a> (payment options on Products / 2PaymentMode). */
html body div.main_content h2,
html body div.main_content h3,
html body div.main_content h4,
html body div.main_content h5,
html body div.main_content a h2,
html body div.main_content a h3 {
  color: var(--text-primary);
  font-family: inherit;
}
html body div.main_content a:hover h2,
html body div.main_content a:hover h3 {
  color: var(--cyan);
}

/* ---------- ICON REPLACEMENTS (no codebehind change) ----------
   The cart row's edit-pen and remove-X plus the products-table info-icon
   are emitted by codebehind as <img>/<input type="image"> with hardcoded
   PNG paths. Use CSS `content:` (works on replaced elements: <img>, <input
   type=image>) to swap the rendered bitmap for an inline SVG that fits
   the dark theme. The original click handlers / form posts continue to
   work because we only replace the visible image, not the element. */

/* Info icon on Products.aspx — codebehind sets imgInfo.CssClass = "info" */
html body img.info {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16' fill='none' stroke='%2338BDF8' stroke-width='1.5'><circle cx='8' cy='8' r='7'/><line x1='8' y1='7' x2='8' y2='11.5'/><circle cx='8' cy='4.7' r='0.9' fill='%2338BDF8' stroke='none'/></svg>");
  width: 16px;
  height: 16px;
  margin-top: 0;
  vertical-align: middle;
}

/* Edit-pencil ImageButton on 1InvoiceAddress.aspx (and any other page that
   uses /images/editpen.png or editpen2.png). Match by [src] suffix. */
html body input[type="image"][src*="editpen"] {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20' fill='none' stroke='%2338BDF8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 20h9'/><path d='M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z'/></svg>");
  width: 20px;
  height: 20px;
  vertical-align: middle;
  cursor: pointer;
}

/* Remove-X ImageButton on 1InvoiceAddress.aspx — codebehind emits delete.png */
html body input[type="image"][src*="delete.png"] {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20' fill='none' stroke='%23F87171' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='15' y1='9' x2='9' y2='15'/><line x1='9' y1='9' x2='15' y2='15'/></svg>");
  width: 20px;
  height: 20px;
  vertical-align: middle;
  cursor: pointer;
}

/* OK / confirm-quantity-edit icon on the cart — also a codebehind PNG.
   Re-style in cyan to match the rest. */
html body input[type="image"][src*="ok.png"] {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20' fill='none' stroke='%2334D399' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  width: 20px;
  height: 20px;
  vertical-align: middle;
  cursor: pointer;
}

/* Vertical-centre the cells that contain these icons. The codebehind sets
   CssClass = "yesborder firstcolumn class55" on the edit/quantity cell and
   `center` on the remove-X cell. The Products-table info icon lives in a
   cell with CssClass `yesborder` (sometimes plus class25). */
html body div.main_content table td.center,
html body div.main_content table td.firstcolumn,
html body div.main_content table td.class55 {
  vertical-align: middle;
}

/* ---------- PAYMENT-LOGO CARDS ----------
   Brand logos (MasterCard/Visa/Amex composite, PayPal, Bitcoin) are PNGs
   on light backgrounds. Inverting them with `filter: invert()` would
   destroy the brand colours and violate brand-guideline compliance, so
   wrap each in a span.payment-logo that gives it a small white card. */
.payment-logo {
  display: inline-block;
  background: #fff;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  line-height: 0;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.payment-logo img {
  display: block;
  max-height: 32px;
  width: auto;
  border: none;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .vb-header-inner {
    gap: 0.75rem;
    padding: 0 1rem;
  }
  .vb-nav {
    gap: 0.125rem;
    font-size: 0.8125rem;
  }
  html body div.main_content {
    padding: 1.5rem 1rem 3rem;
  }
}

@media (max-width: 700px) {
  .vb-nav {
    display: none;
  }
  .vb-mobile-toggle {
    display: block;
  }
  .vb-nav.open {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    gap: 0.25rem;
    z-index: 199;
  }
  .vb-nav.open a,
  .vb-nav.open .vb-nav-link {
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
  }
}
