/***************************************************
 * Synergy Core – Front-end styles
 * Notes:
 * - Keep selectors scoped to Synergy components to avoid Avada/Woo bleed.
 * - Prefer low-specificity + explicit "body" scoping only where the theme fights us.
 ***************************************************/

/* =========================================================
   Supplier card (generic)
   ========================================================= */
.supplier-box{
  border:1px solid #ddd;
  border-radius:8px;
  padding:16px;
  max-width:400px;
  display:flex;
  flex-direction:column;
  align-items:center;
  background:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.05);
}
.supplier-logo img{ max-width:150px; height:auto; margin-bottom:12px; }
.supplier-info{ text-align:center; }
.supplier-title{ font-size:1.25rem; margin:0 0 8px; }
.supplier-description{ font-size:.95rem; color:#555; margin:0 0 10px; }
.supplier-link{ text-decoration:none; color:#0073aa; font-weight:600; }
.supplier-link:hover{ text-decoration:underline; }

/* =========================================================
   Avada content-box tweaks (site already uses these)
   ========================================================= */
.fusion-content-boxes .fusion-button-text{ font-weight:700; color:#E53935 !important; }
.fusion-content-boxes .content-container{ text-align:center; }

/* =========================================================
   Product Grid (virtual categories + any Synergy grids)
   ========================================================= */

body .synergy-products-grid{
  display:grid !important;
  grid-template-columns: repeat(var(--cols, 5), 1fr) !important;
  gap:18px;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
}

/* HARDEN: stop Avada/Woo styles from forcing items full-width/float */
body .synergy-products-grid > *{
  float:none !important;
  width:auto !important;
  max-width:none !important;
  margin:0 !important;
  min-width:0 !important;
  /* Prevent theme rules that accidentally span all columns */
  grid-column:auto !important;
  box-sizing:border-box;
}

/* Card */
body .synergy-products-grid .p-card{
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid #eee;
  border-radius:12px;
  overflow:hidden;
  min-width:0;
}

/* Thumb */
body .synergy-products-grid .p-thumb{ display:block; overflow:hidden; }
body .synergy-products-grid .p-thumb img{
  display:block;
  width:100%;
  height:220px;
  object-fit:contain;
}

/* Body */
body .synergy-products-grid .p-body{ padding:12px; }
body .synergy-products-grid .p-title{ font-weight:600; margin:0 0 6px; line-height:1.3; }


body .synergy-products-grid .p-title{
  font-size: 15px !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

body .synergy-products-grid .p-title a{
  color: inherit !important;
  text-decoration: none !important;
}
body .synergy-products-grid .p-title a:hover{ text-decoration: underline !important; }

body .synergy-products-grid .p-sku,
body .synergy-products-grid .p-price{ font-size:.9rem; opacity:.75; }

/* Actions */
body .synergy-products-grid .p-actions{ padding:12px; margin-top:auto; }

/* CTA button (works with Avada <button>) */
body .synergy-products-grid .btn-cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:40px;
  padding:10px 14px;
  font-size:.95rem;
  font-weight:600;
  border-radius:8px;
  border:1px solid #d1d5db;
  background:#fff;
  text-decoration:none;
}

/* Pager */
body .synergy-grid-pager{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin:18px 0;
  font-size:.95rem;
}
body .synergy-grid-pager a{
  border:1px solid #d1d5db;
  border-radius:8px;
  padding:6px 10px;
  text-decoration:none;
}
body .synergy-grid-pager .disabled{ opacity:.4; pointer-events:none; }


/* Virtual product pages (route: /product/...) */
.syngsc-virtual-product .fusion-page-title-bar,
.syngsc-virtual-product .fusion-breadcrumbs{
  display:none !important;
}

/* Avada: prevent column squeeze on virtual category routes */
.fusion-four-fifths,
.fusion-four-fifths .fusion-column-wrapper{
  min-width:0;
}
.fusion-four-fifths .synergy-products-grid{
  width:100%;
  max-width:100%;
  min-width:0;
}

/* =========================================================
   Sidebar (shared styling)
   ========================================================= */
.synergy-sidebar{ margin:0 0 24px; }
.synergy-sidebar__inner{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:16px 18px;
  background:#fff;
}
.synergy-sidebar__title,
.synergy-sidebar__block-title{
  margin:0 0 12px;
  font-size:1.05rem;
  font-weight:600;
  color:var(--awb-color6);
}

/* Category list */
.synergy-sidebar__block ul{
  list-style:none !important;
  margin:0 !important;
  padding:0 !important;
}
.synergy-sidebar__block li{ margin:6px 0; }
body .synergy-sidebar .synergy-sidebar__block a,
body .synergy-sidebar .synergy-sidebar__block a span{
  text-decoration:none;
  color:var(--awb-color6);
  font-weight:400;
  text-transform:none !important;
}
.synergy-sidebar__block a:hover{
  color:var(--awb-color6);
  text-decoration:underline;
}

/* Search (input + icon submit) */
.synergy-sidebar__search{
  display:flex;
  align-items:center;
  gap:0;           /* flush input + button */
  margin:10px 0 16px;
}
.synergy-sidebar__search input[type="search"],
.synergy-sidebar__search input[type="text"],
.synergy-sidebar__search input{
  flex:1;
  min-width:0;
  padding:6px 10px;
  height:38px;
  font-size:.95rem;
  line-height:1.2;
  border:1px solid #d1d5db;
  border-radius:4px;
  box-sizing:border-box;
  border-top-right-radius:0;
  border-bottom-right-radius:0;
}
.synergy-sidebar__search input[type="submit"],
.synergy-sidebar__search button[type="submit"]{
  position:relative;
  width:42px;
  min-width:42px;
  height:38px;
  padding:0 !important;

  background:var(--awb-color1, #0b2a4a) !important;
  border:1px solid var(--awb-color1, #0b2a4a) !important;
  color:transparent !important;

  border-radius:4px !important;
  border-top-left-radius:0 !important;
  border-bottom-left-radius:0 !important;

  cursor:pointer;
  text-indent:-9999px;
  overflow:hidden;
  white-space:nowrap;
  box-shadow:none !important;
}
.synergy-sidebar__search input[type="submit"]::after,
.synergy-sidebar__search button[type="submit"]::after{
  content:"🔍";
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
  color:#fff;
  text-indent:0;
}
.synergy-sidebar__search input[type="submit"]:hover,
.synergy-sidebar__search button[type="submit"]:hover{ filter:brightness(.92); }
.synergy-sidebar__search input[type="submit"]:focus-visible,
.synergy-sidebar__search button[type="submit"]:focus-visible{
  outline:2px solid rgba(14,165,233,.35);
  outline-offset:2px;
}

/* =========================================================
   Header utility links (Synergy header shortcode)
   ========================================================= */
.syng-header-links{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
  font-size:14px;
  line-height:1.2;
  white-space:nowrap;
}
.syng-header-links a{
  color:var(--awb-color6, inherit);
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.syng-header-links a:hover{ text-decoration:underline; }
.syng-header-links .syng-hl-user::after,
.syng-header-links .syng-hl-cart::after,
.syng-header-links .syng-hl-find::after{
  display:inline-block;
  width:1em;
  text-align:center;
  opacity:.9;
}
.syng-header-links .syng-hl-user::after{ content:"\1F464"; } /* 👤 */
.syng-header-links .syng-hl-cart::after{ content:"\1F6D2"; } /* 🛒 */
.syng-header-links .syng-hl-find::after{ content:"\1F4CD"; } /* 📍 */

.synergy-sidebar__search input[type="submit"]::after,
.synergy-sidebar__search button[type="submit"]::after{
  content:"\1F50D"; /* 🔍 */
}synergy-products-grid > * 
.syng-header-links .syng-enq-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  font-size:12px;
  line-height:1;
  margin-left:6px;
  border:1px solid currentColor;
  background:transparent;
  color:inherit;
}
@media (max-width:640px){
  .syng-header-links{ gap:4px; font-size:13px; }
}

/* =========================================================
   Customer Hub – Orders List + Order Detail
   Scoped to .syngsc-hub to avoid theme bleed
   ========================================================= */
.syngsc-hub{ max-width:1100px; margin:0 auto; }

/* Tables */
.syngsc-hub .syngsc-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
  border:1px solid rgba(0,0,0,.12);
  border-radius:10px;
  overflow:hidden;
}
.syngsc-hub .syngsc-table thead th{
  text-align:left;
  font-weight:600;
  font-size:14px;
  padding:12px 14px;
  background:rgba(0,0,0,.04);
  border-bottom:1px solid rgba(0,0,0,.10);
  white-space:nowrap;
}
.syngsc-hub .syngsc-table tbody td{
  padding:12px 14px;
  border-bottom:1px solid rgba(0,0,0,.06);
  vertical-align:middle;
}
.syngsc-hub .syngsc-table tbody tr:nth-child(even) td{ background:rgba(0,0,0,.015); }
.syngsc-hub .syngsc-table tbody tr:hover td{ background:rgba(0,0,0,.03); }

/* Orders table sizing */
.syngsc-hub--orders .syngsc-orders-table th:first-child,
.syngsc-hub--orders .syngsc-orders-table td:first-child{ width:140px; }
.syngsc-hub--orders .syngsc-orders-table th:nth-child(2),
.syngsc-hub--orders .syngsc-orders-table td:nth-child(2){ width:230px; }
.syngsc-hub--orders .syngsc-orders-table th:nth-child(3),
.syngsc-hub--orders .syngsc-orders-table td:nth-child(3){ width:110px; }
.syngsc-hub--orders .syngsc-orders-table th:nth-child(4),
.syngsc-hub--orders .syngsc-orders-table td:nth-child(4){ width:220px; }

/* Order link button */
.syngsc-hub .syngsc-order-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 10px;
  border:1px solid rgba(0,0,0,.18);
  border-radius:8px;
  text-decoration:none !important;
  font-weight:600;
  line-height:1;
}
.syngsc-hub .syngsc-order-link:hover{
  border-color:rgba(0,0,0,.35);
  transition:transform .12s ease, border-color .12s ease, background-color .12s ease;
}

/* Summary card */
.syngsc-hub .syngsc-card{
  background:#fff;
  border:1px solid rgba(0,0,0,.12);
  border-radius:10px;
  padding:16px;
  box-shadow:0 2px 10px rgba(0,0,0,.04);
}
.syngsc-hub .syngsc-order-title{ font-size:22px; font-weight:700; margin:0 0 10px; }
.syngsc-hub .syngsc-order-meta{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px 18px;
  font-size:14px;
}
.syngsc-hub .syngsc-divider{ border:0; border-top:1px solid rgba(0,0,0,.08); margin:14px 0; }
.syngsc-hub .syngsc-section-title{ margin:18px 0 10px; font-size:16px; font-weight:700; }

/* Items table sizing */
.syngsc-hub--order .syngsc-items-table th:first-child,
.syngsc-hub--order .syngsc-items-table td:first-child{ width:80px; }
.syngsc-hub--order .syngsc-items-table th:nth-child(2),
.syngsc-hub--order .syngsc-items-table td:nth-child(2){ width:260px; }
.syngsc-hub--order .syngsc-items-table th:nth-child(3),
.syngsc-hub--order .syngsc-items-table td:nth-child(3){ width:120px; }

/* Mobile: scroll tables instead of crushing columns */
@media (max-width:780px){
  .syngsc-hub .syngsc-order-meta{ grid-template-columns:1fr; }
  .syngsc-hub .syngsc-table{
    display:block;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  .syngsc-hub .syngsc-table thead th,
  .syngsc-hub .syngsc-table tbody td{ white-space:nowrap; }
}

/* Badges */
.syngsc-badge{
  display:inline-block;
  margin-left:8px;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  border:1px solid #ddd;
}
.syngsc-order-btn,
.syngsc-badge{ vertical-align:middle; }

/* Force Avada row to behave as flex on virtual category */
.syngsc-virtual-category .fusion-builder-row.fusion-row {
  display: flex !important;
  flex-wrap: nowrap !important;
}

/* Prevent grid items from expanding grid */
.synergy-products-grid > * {
  min-width: 0 !important;
  width: auto !important;
}

.synergy-products-grid {
  min-width: 0 !important;
}

/* =========================================================
   FIX: Avada virtual category row (1/5 + 4/5) must have explicit flex-basis
   because Avada sets columns to "flex: 0 0 auto" (content-sized).
   ========================================================= */

.syngsc-virtual-category .fusion-builder-row.fusion-row{
  display:flex !important;
  flex-wrap:nowrap !important;
}

/* left sidebar */
.syngsc-virtual-category .fusion-layout-column.fusion-one-fifth{
  flex: 0 0 20% !important;
  max-width: 20% !important;
  min-width: 0 !important;
}

/* right content */
.syngsc-virtual-category .fusion-layout-column.fusion-four-fifths{
  flex: 1 1 80% !important;      /* allow shrink/grow, start at 80% */
  max-width: 80% !important;
  min-width: 0 !important;
}

/* also ensure wrapper doesn't force a minimum width */
.syngsc-virtual-category .fusion-layout-column.fusion-four-fifths .fusion-column-wrapper{
  min-width: 0 !important;
}

/* =========================================================
   Product Grid – CTA button (restore styling)
   ========================================================= */

/* Style both <a> and <button> CTAs inside the grid */
body .synergy-products-grid .btn-cta,
body .synergy-products-grid .btn-cta.fusion-button,
body .synergy-products-grid button.btn-cta,
body .synergy-products-grid button.syng-enq-add{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  width:100% !important;
  min-height:40px;
  padding:10px 14px !important;
  border-radius:8px !important;

  font-size:14px !important;
  font-weight:600 !important;
  line-height:1.2 !important;
  text-transform:none !important;
  letter-spacing:normal !important;

  border:1px solid #d1d5db !important;
  background:#ffffff !important;
  color:#111827 !important;

  box-shadow:none !important;
}

/* Hover/focus (optional) */
body .synergy-products-grid .btn-cta:hover,
body .synergy-products-grid button.syng-enq-add:hover{
  filter: brightness(0.97);
}

body .synergy-products-grid .btn-cta:focus-visible,
body .synergy-products-grid button.syng-enq-add:focus-visible{
  outline:2px solid rgba(14,165,233,.35);
  outline-offset:2px;
}

/* Avada wraps button text in a span */
body .synergy-products-grid .btn-cta .fusion-button-text,
body .synergy-products-grid button.syng-enq-add .fusion-button-text{
  color:#111827 !important;
  font-weight:600 !important;
  text-transform:none !important;
  letter-spacing:normal !important;
  line-height:1.2 !important;
}