/* Trailer Booking Bridge – minimal styles
   Namespace: .tbb-*
   Skånsom styling som ikke kolliderer med temaet. */

/* Layout */
.tbb-wrap{max-width:960px;margin:16px auto;padding:16px;font:14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif}
.tbb-title{font-weight:700;font-size:20px;margin-bottom:2px}
.tbb-depot{color:#6b7280;margin-bottom:12px}
.tbb-grid{display:grid;grid-template-columns:1fr;gap:16px}
@media (min-width:900px){.tbb-grid{grid-template-columns:2fr 1fr}}

.tbb-col{display:flex;flex-direction:column;gap:8px}
.tbb-label{font-weight:600;margin-top:4px}

/* Inputs */
.tbb-input,.tbb-select{
  padding:10px 12px;border:1px solid #e5e7eb;border-radius:10px;background:#fff;outline:none;min-height:40px
}
.tbb-input:focus,.tbb-select:focus{border-color:#94a3b8;box-shadow:0 0 0 3px rgba(148,163,184,.25)}

/* Info box */
.tbb-infobox{
  padding:10px;border:1px dashed #d1d5db;border-radius:10px;background:#f9fafb;color:#6b7280
}

/* Addons */
.tbb-addons{border:1px solid #e5e7eb;border-radius:10px;padding:10px}
.tbb-subtitle{font-weight:600;margin-bottom:6px}
.tbb-addon-row{
  display:flex;align-items:center;gap:8px;justify-content:space-between;
  padding:6px 8px;border-radius:8px;cursor:pointer;user-select:none
}
.tbb-addon-row:hover{background:#f9fafb}
.tbb-addon-name{font-weight:500}
.tbb-addon-price{color:#6b7280}

/* Summary card */
.tbb-card{border:2px solid #e5e7eb;border-radius:14px;padding:12px;position:sticky;top:12px;background:#fff}
.tbb-card-title{font-weight:600;margin-bottom:8px}
.tbb-summary{margin-top:8px}
.tbb-lines{display:grid;grid-template-columns:1fr auto;gap:6px;font-size:14px}
.tbb-break{border-top:1px solid #e5e7eb;margin:10px 0}
.tbb-total{display:flex;align-items:center;justify-content:space-between;font-weight:700}

/* Actions */
.tbb-actions{display:flex;gap:8px;margin-top:8px}
.tbb-btn{
  padding:10px 12px;border-radius:10px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;
  transition:.15s ease-in-out;font-weight:500
}
.tbb-btn:hover{transform:translateY(-1px)}
.tbb-primary{background:#111827;color:#fff;border-color:#111827}
.tbb-primary[disabled]{opacity:.6;cursor:not-allowed;transform:none}
.tbb-secondary{background:#fff}
.tbb-msg{margin-top:8px;color:#dc2626}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .tbb-btn{transition:none}
}



  // Product header (vises kun hvis vi har noe)
  if (CONFIG.productName || CONFIG.productImage || CONFIG.productDesc) {
    var prodCard = el('div', { class: 'tbb-card', style: { marginBottom: '12px' } }, [
      el('div', { class: 'tbb-card-title' }, CONFIG.productName || 'Produkt'),
      el('div', { class: 'tbb-grid', style: { gridTemplateColumns: '1fr 2fr', gap: '12px' } }, [
        CONFIG.productImage
          ? el('div', null, [ el('img', { src: CONFIG.productImage, alt: CONFIG.productName || '', style: { width:'100%', borderRadius:'10px', border:'1px solid #e5e7eb' } }) ])
          : el('div'),
        el('div', null, [
          CONFIG.productDesc ? el('div', { class: 'tbb-depot', style: { marginBottom: '8px' } }, CONFIG.productDesc) : null,
          (CONFIG.productUrl ? el('a', { href: CONFIG.productUrl, target: '_blank', rel:'noopener', class:'tbb-btn tbb-secondary', style:{ display:'inline-block' } }, 'Se produktside') : null)
        ])
      ])
    ]);
    container.appendChild(prodCard);
  }

/* Lys bakgrunn på felter */
.tbb-input,.tbb-select{
  background:#f9fafb;           /* lys grå */
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:10px 12px;
  min-height:40px;
}
.tbb-input:focus,.tbb-select:focus{
  border-color:#94a3b8;
  box-shadow:0 0 0 3px rgba(148,163,184,.25);
  outline:none;
}

/* Badge øverst til høyre på produktkortet */
.tbb-card--product{ position:relative; }
.tbb-badge{
  position:absolute; top:10px; right:10px;
  padding:6px 10px; border-radius:999px; font-weight:600; font-size:12px;
  line-height:1; border:1px solid transparent;
}
.tbb-available{
  background:#ecfdf5;           /* grønnlig */
  color:#065f46;
  border-color:#a7f3d0;
}
.tbb-busy{
  background:#fef2f2;           /* rødlig */
  color:#991b1b;
  border-color:#fecaca;
}

/* Produktgrid og bilde (om du ikke hadde fra før) */
.tbb-grid-product{ display:grid; grid-template-columns:1fr 2fr; gap:12px; }
.tbb-product-img{ width:100%; border-radius:10px; border:1px solid #e5e7eb; }

