:root {
  --wd-bg: #f9fafc;
  --wd-panel: #ffffff;
  --wd-soft: #f2f4f7;
  --wd-line: #e0e3e8;

  --wd-text: #3E435D;
  --wd-dim: #9196a6;
  --wd-heading: #0c0d0e;

  --wd-primary: #207AFB;
  --wd-accent: #594f8d;
  --wd-good: #16c172;
  --wd-danger: #ff6b6b;

  --wd-link: #207AFB;
  --wd-link-hover: #0e55b6;

  --wd-button-bg: #207AFB;
  --wd-button-text: #ffffff;

  --wd-border: #e6e8ea;

  --wd-radius: 12px;
  --wd-gap: 18px;
  --wd-shadow: 0 4px 14px rgba(0,0,0,.05);
  --wd-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing:border-box }
html, body { height:100% }
body.wd-portal {
  background: var(--wd-bg);
  color: var(--wd-text);
  font-family: var(--wd-font);
}

/* ===== Shell Layout ===== */
.wd-shell {
  display:grid;
  grid-template-columns:280px 1fr;
  min-height:100vh;
}
@media(max-width:960px){
  .wd-shell { grid-template-columns:1fr; }
}

/* ===== Sidebar ===== */
.wd-shell__sidebar {
  background: var(--wd-panel);
  border-right:1px solid var(--wd-line);
  padding:22px;
  position:sticky;
  top:0;
  height:100vh;
  box-shadow: var(--wd-shadow);
}
@media(max-width:960px){
  .wd-shell__sidebar { position:static; height:auto; }
}

.wd-brand { display:flex; align-items:center; gap:10px; margin-bottom:20px; }
.wd-brand__logo { max-width:160px; height:auto; }
.wd-brand__text { font-weight:700; color:var(--wd-heading); }

/* ===== Navigation ===== */
.wd-nav {
  display:flex;
  flex-direction:column;
  gap:6px;
}
.wd-nav__section {
  margin:14px 0 6px;
  color:var(--wd-dim);
  font-size:.85rem;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.wd-nav__item {
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  color:var(--wd-text);
  text-decoration:none;
  border:1px solid transparent;
}
.wd-nav__item:hover {
  background: var(--wd-soft);
  border-color: var(--wd-line);
}
.wd-nav__item.is-active {
  background: var(--wd-primary);
  color:#fff;
}
.wd-nav__item.is-disabled { opacity:.45; pointer-events:none; }
.wd-nav__dot {
  width:8px; height:8px; border-radius:50%; background:var(--wd-accent);
}

/* ===== Main content ===== */
.wd-shell__main { padding:28px; min-width:0; background: var(--wd-bg); }
@media(max-width:600px){ .wd-shell__main{padding:18px} }

.wd-pagebar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
  gap:12px;
}
.wd-pagebar__title { margin:0; font-size:1.35rem; color:var(--wd-heading); }
.wd-pagebar__mini { display:flex; gap:10px; align-items:center; color:var(--wd-dim); }
.wd-mini-price {
  background: var(--wd-primary);
  color:#fff;
  font-weight:700;
  padding:4px 10px;
  border-radius:999px;
}

/* ===== Layout columns ===== */
.wd-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:var(--wd-gap);
  align-items:start;
}
@media(max-width:960px){
  .wd-layout{
    grid-template-columns:1fr;
  }
  .wd-col--aside{
    order:3; /* summary last */
  }
  .wd-pagebar__mini{
    flex-wrap:wrap;
  }
}

.wd-col { display:flex; flex-direction:column; gap:var(--wd-gap); }

/* ===== Card ===== */
.wd-card {
  background: var(--wd-panel);
  border:1px solid var(--wd-border);
  border-radius:var(--wd-radius);
  box-shadow:var(--wd-shadow);
  padding:18px;
  color:var(--wd-text);
}
.wd-card__title { margin:0 0 12px; font-size:1.05rem; color:var(--wd-heading); }

/* ===== Inputs ===== */
.wd-input,
.woocommerce-input-wrapper input.input-text,
.select2-container--default .select2-selection--single {
  width:100%;
  background: var(--wd-bg);
  border:1px solid var(--wd-border);
  border-radius:12px;
  padding:12px 14px;
  color:var(--wd-text);
}
.wd-label { display:block; margin:0 0 8px; color:var(--wd-dim); font-size:.95rem; }
.wd-form-row{ margin-bottom:14px; }

/* ===== Buttons ===== */
.wd-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 16px;
  border-radius:12px;
  border:1px solid transparent;
  cursor:pointer;
  font-weight:600;
  transition: all .25s ease;
}
.wd-btn--primary {
  background: var(--wd-button-bg);
  color: var(--wd-button-text);
}
.wd-btn--primary:hover {
  background: var(--wd-link-hover);
  color:#fff;
}
.wd-btn--ghost {
  background: transparent;
  border-color: var(--wd-border);
  color: var(--wd-text);
}
.wd-help { margin:.35rem 0 0; color:var(--wd-dim); font-size:.9rem; }

/* ===== Summary (aside) ===== */
.wd-summary {
  position:sticky;
  top:24px;
  background: var(--wd-panel);
  border:1px solid var(--wd-border);
  border-radius:var(--wd-radius);
  box-shadow:var(--wd-shadow);
}
.wd-summary__head,
.wd-summary__line {
  padding:16px;
  border-bottom:1px solid var(--wd-line);
}
.wd-summary__title { font-weight:700; color:var(--wd-heading); }
.wd-summary__price { font-weight:800; color:var(--wd-heading); }

/* ===== Product row ===== */
.wd-product-row {
  display:flex;
  gap:12px;
  align-items:center;
}
.wd-product-row__thumb img {
  width:54px; height:54px;
  object-fit:cover;
  border-radius:10px;
  border:1px solid var(--wd-line);
}
.wd-product-row__name { font-weight:600; color:var(--wd-heading); }
.wd-product-row__sku { color:var(--wd-dim); font-size:.9rem; }

/* ===== Accordion ===== */
.wd-accordion { border-top:1px solid var(--wd-line); }
.wd-accordion__toggle {
  list-style:none;
  cursor:pointer;
  padding:14px 16px;
  font-weight:600;
  color:var(--wd-heading);
}
.wd-accordion__body { padding:0 16px 16px; color:var(--wd-text); }

/* ===== WooCommerce form adjustments ===== */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
  background: var(--wd-bg);
  border:1px solid var(--wd-border);
  color: var(--wd-text);
  border-radius:10px;
}
.woocommerce form .form-row{ margin:0 0 12px; }
.woocommerce-checkout-payment,
.woocommerce-additional-fields {
  background: var(--wd-panel);
  border:1px solid var(--wd-border);
  border-radius:12px;
  padding:16px;
}

/* ===== Mobile sidebar ===== */
.wd-mobilebar {
  display:none;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px;
  border-bottom:1px solid var(--wd-line);
  background: var(--wd-panel);
}
.wd-mobilebar__brand img {
  max-height:32px;
  width:auto;
}
.wd-burger{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  width:42px;
  height:42px;
  background:none;
  border:0;
  cursor:pointer;
}
.wd-burger span{
  display:block;
  width:24px;
  height:3px;
  background:var(--wd-heading);
  margin:3px 0;
  border-radius:2px;
  transition:all .25s ease;
}
body.wd-nav-open .wd-burger span:nth-child(1){transform:rotate(45deg) translate(5px,5px);}
body.wd-nav-open .wd-burger span:nth-child(2){opacity:0;}
body.wd-nav-open .wd-burger span:nth-child(3){transform:rotate(-45deg) translate(5px,-5px);}

@media(max-width:960px){
  .wd-brand--desktop{display:none;}
  .wd-mobilebar{display:flex;}
  .wd-shell{grid-template-columns:1fr;}
  .wd-shell__sidebar{
    position:fixed;
    top:0; left:0; bottom:0;
    width:80%;
    max-width:320px;
    background:var(--wd-panel);
    overflow-y:auto;
    transform:translateX(-100%);
    transition:transform .3s ease;
    z-index:1000;
    box-shadow:0 12px 24px rgba(0,0,0,.4);
  }
  body.wd-nav-open .wd-shell__sidebar{ transform:translateX(0); }
  body.wd-nav-open::after{
    content:"";
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.4);
    z-index:999;
  }
  .wd-summary{ position:static; top:auto; margin-top:20px; }
}


/* ===== Thank you card ===== */
.wd-thankyou {
  background: var(--wd-panel);
  border:1px solid var(--wd-border);
  border-radius:12px;
  box-shadow:var(--wd-shadow);
}
.wd-thankyou-icon {
  color: var(--wd-primary);
}

/* ===== WD Portal: hide WooCommerce duplicate sections ===== */

/* Hide the default "Your order" heading and table on our portal checkout */
body.wd-portal-checkout #order_review_heading,
body.wd-portal-checkout .woocommerce-checkout-review-order-table {
  display: none !important;
}

/* Hide WooCommerce order notes field (we don’t use it on the portal) */
body.wd-portal-checkout .woocommerce-additional-fields {
  display: none !important;
}

/* Collapse checkout columns into single column */
body.wd-portal-checkout #customer_details.col2-set {
  display: block !important;
}
body.wd-portal-checkout #customer_details .col-1,
body.wd-portal-checkout #customer_details .col-2 {
  width: 100% !important;
  float: none !important;
}

/* Remove “Your order” from inside payment box */
body.wd-portal-checkout .woocommerce-checkout-payment #order_review_heading {
  display: none !important;
}

/* ----- Dashboard forms (scoped) ----- */
.wd-portal-dashboard .wd-form-card { padding: 1.25rem; }
.wd-portal-dashboard .wd-form .wd-grid {
  display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:14px;
}
.wd-portal-dashboard .wd-form .wd-span-2 { grid-column: span 2 / span 2; }
.wd-portal-dashboard .wd-field label { display:block; font-weight:600; margin-bottom:6px; }
.wd-portal-dashboard .wd-field input,
.wd-portal-dashboard .wd-field select,
.wd-portal-dashboard .wd-field textarea {
  width:100%; border:1px solid var(--wd-border,#e5e7eb); border-radius:8px; padding:.625rem .75rem; background:#fff;
}
.wd-portal-dashboard .wd-actions { margin-top:14px; display:flex; align-items:center; gap:12px; }
.wd-portal-dashboard .wd-form__status { font-size:.95rem; opacity:.9; }

.wd-portal-dashboard .wd-accordion { border:1px solid var(--wd-border,#e5e7eb); border-radius:10px; padding:.25rem .75rem; background:#fff; }
.wd-portal-dashboard .wd-accordion + .wd-accordion { margin-top:10px; }
.wd-portal-dashboard .wd-accordion summary { cursor:pointer; font-weight:700; padding:.5rem 0; }
.wd-portal-dashboard .wd-accordion__body { padding:.5rem 0 .75rem; }
.wd-portal-dashboard .wd-check { display:inline-flex; align-items:center; gap:.5rem; margin:.25rem .75rem .25rem 0; }
.wd-portal-dashboard .button.is-loading { opacity:.7; pointer-events:none; }

/* --- Responsive dashboard forms --- */
@media(max-width:700px){
  .wd-portal-dashboard .wd-form .wd-grid{
    grid-template-columns:1fr;
  }
  .wd-portal-dashboard .wd-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .wd-portal-dashboard .wd-form-card{
    padding:16px;
  }
  .wd-portal-dashboard input,
  .wd-portal-dashboard select,
  .wd-portal-dashboard textarea{
    font-size:1rem;
  }
}

@media(max-width:600px){
  .wd-shell__main{padding:14px;}
  .wd-pagebar__title{font-size:1.1rem;}
  .wd-card{padding:14px;}
}
