:root {
  --tb-green: #006b55;
  --tb-green-dark: #004f3f;
  --tb-gold: #b7a16a;
  --tb-text: #37404a;
  --tb-muted: #6f7780;
  --tb-border: #e4e7e9;
  --tb-bg-soft: #f7f8f8;
}

.com-tragbuilder, .tragbuilder-page { width: 100%; }
.tb-page-title-wrap { max-width: 1120px; margin: 42px auto 10px; padding: 0 20px; }
.tb-page-title-wrap h1 { color: var(--tb-green); font-weight: 500; margin: 0; }
.tb-section { position: relative; padding: 56px 0; }
.tb-container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.tb-container-wide { width: min(1500px, calc(100% - 40px)); }
.tb-row { display: flex; flex-wrap: wrap; gap: 24px; margin: 0 0 24px; }
.tb-row:last-child { margin-bottom: 0; }
.tb-col { flex: 0 0 calc((var(--tb-col-span, 12) / 12) * 100% - 24px); min-width: 0; }
.tb-col-12 { flex-basis: 100%; }
.tb-addon { margin-bottom: 20px; }
.tb-addon:last-child { margin-bottom: 0; }
.tb-heading { color: var(--tb-green); font-weight: 500; line-height: 1.2; margin: 0 0 14px; }
.tb-text { color: var(--tb-text); line-height: 1.75; }
.tb-text p:first-child { margin-top: 0; }
.tb-text p:last-child { margin-bottom: 0; }
.tb-image { margin: 0; }
.tb-image img { max-width: 100%; height: auto; display: block; border-radius: 2px; }
.tb-image figcaption { color: var(--tb-muted); font-size: 14px; margin-top: 8px; }
.tb-map { position: relative; overflow: hidden; border: 1px solid var(--tb-border); border-radius: 4px; background: var(--tb-bg-soft); }
.tb-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tb-button-wrap { margin-top: 18px; }
.tb-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 24px; background: var(--tb-green); color: #fff !important; text-decoration: none !important; border: 0; border-radius: 0; font-weight: 600; transition: .18s ease; cursor: pointer; }
.tb-button:hover, .tb-button:focus { background: var(--tb-green-dark); color: #fff !important; }
.tb-divider { border: 0; border-top: 1px solid var(--tb-border); margin: 24px 0; }
.tb-contact { background: #fff; border: 1px solid var(--tb-border); padding: 26px; box-shadow: 0 8px 24px rgba(0,0,0,.04); }
.tb-contact h3 { margin: 0 0 18px; color: var(--tb-green); }
.tb-contact label { display: grid; gap: 7px; margin-bottom: 14px; color: var(--tb-text); font-weight: 600; }
.tb-contact input, .tb-contact textarea { width: 100%; border: 1px solid #d9dee3; min-height: 42px; padding: 9px 10px; font: inherit; }
.tb-contact textarea { min-height: 130px; resize: vertical; }
.tb-contact-message { max-width: 1120px; margin: 24px auto 0; padding: 13px 18px; border-left: 4px solid var(--tb-green); background: #eef7f4; color: var(--tb-green-dark); }
.tb-raw iframe, .tb-raw img, .tb-raw video { max-width: 100%; }

html[dir="rtl"] .tb-contact-message { border-left: 0; border-right: 4px solid var(--tb-green); }

@media (max-width: 900px) {
  .tb-row { gap: 18px; }
  .tb-col { flex-basis: 100% !important; }
  .tb-section { padding: 38px 0; }
}
@media (max-width: 560px) {
  .tb-container, .tb-container-wide { width: min(100% - 28px, 1120px); }
  .tb-contact { padding: 18px; }
}

/* Dynamic content addons */
.tb-content-grid,
.tb-gallery-grid,
.tb-documents-grid {
  display: grid;
  grid-template-columns: repeat(var(--tb-grid-columns, 3), minmax(0, 1fr));
  gap: 24px;
}
.tb-content-card,
.tb-document-card {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--tb-border);
  box-shadow: 0 10px 30px rgba(24, 39, 52, .06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.tb-content-card:hover,
.tb-document-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(24, 39, 52, .11);
}
.tb-content-card-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--tb-bg-soft); }
.tb-content-card-media img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s ease; }
.tb-content-card:hover .tb-content-card-media img { transform: scale(1.035); }
.tb-content-card-body { padding: 22px; }
.tb-content-card h3,
.tb-document-card h3 { margin: 0 0 10px; font-size: clamp(1.15rem, 1.7vw, 1.45rem); line-height: 1.25; }
.tb-content-card h3 a { color: var(--tb-text); text-decoration: none; }
.tb-content-card p,
.tb-document-card p { margin: 0 0 18px; color: var(--tb-muted); line-height: 1.65; }
.tb-card-link { display: inline-flex; gap: 6px; align-items: center; color: var(--tb-green); font-weight: 700; text-decoration: none; }
.tb-card-link:hover { color: var(--tb-green-dark); }
.tb-empty-state { padding: 20px; border: 1px dashed var(--tb-border); color: var(--tb-muted); text-align: center; }

.tb-gallery-item { margin: 0; min-width: 0; }
.tb-gallery-item a { display: block; cursor: zoom-in; }
.tb-gallery-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--tb-bg-soft); }
.tb-gallery-item figcaption { padding: 9px 2px 0; color: var(--tb-muted); font-size: 14px; }

.tb-document-card { display: flex; gap: 18px; padding: 22px; }
.tb-document-icon { flex: 0 0 52px; width: 52px; height: 64px; display: grid; place-items: center; background: var(--tb-green); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.tb-document-body { min-width: 0; }

.tb-lightbox-dialog { width: min(1100px, calc(100% - 32px)); max-width: none; border: 0; padding: 0; background: transparent; overflow: visible; }
.tb-lightbox-dialog::backdrop { background: rgba(5, 12, 18, .88); }
.tb-lightbox-frame { position: relative; display: grid; justify-items: center; gap: 12px; }
.tb-lightbox-image { max-width: 100%; max-height: 84vh; display: block; object-fit: contain; box-shadow: 0 25px 80px rgba(0,0,0,.45); }
.tb-lightbox-caption { color: #fff; text-align: center; }
.tb-lightbox-close { position: absolute; top: -14px; right: -14px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #fff; color: #111; font-size: 25px; line-height: 1; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
html[dir="rtl"] .tb-lightbox-close { right: auto; left: -14px; }

@media (max-width: 900px) {
  .tb-content-grid, .tb-gallery-grid, .tb-documents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tb-content-grid, .tb-gallery-grid, .tb-documents-grid { grid-template-columns: 1fr; }
  .tb-document-card { padding: 18px; }
}

/* Projects Gallery + Popup addon */
.tb-project-grid {
  display: grid;
  grid-template-columns: repeat(var(--tb-project-columns, 3), minmax(0, 1fr));
  gap: 22px;
}
.tb-project-card {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: var(--tb-project-ratio, 4 / 3);
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #dfe9f0;
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 15px 42px rgba(0,59,135,.11);
}
.tb-project-card-media,
.tb-project-card-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.tb-project-card-media img {
  object-fit: cover;
  transition: transform .45s ease;
}
.tb-project-card-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #00aef0;
  font-size: 3rem;
}
.tb-project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,28,67,.03) 20%, rgba(0,30,72,.94) 100%);
}
.tb-project-card-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px;
}
.tb-project-card-overlay small {
  color: #00aef0;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.tb-project-card-overlay strong {
  margin-top: 7px;
  color: #fff;
  font-size: clamp(1.25rem,2vw,1.65rem);
  line-height: 1.15;
}
.tb-project-card-overlay > span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 8px;
  color: rgba(255,255,255,.75);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.tb-project-card-overlay em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  color: #fff;
  font-size: .88rem;
  font-style: normal;
  font-weight: 850;
}
.tb-project-card:hover img,
.tb-project-card:focus-visible img { transform: scale(1.06); }
.tb-project-card:focus-visible { outline: 3px solid #00aef0; outline-offset: 3px; }
.tb-project-dialog {
  width: min(1040px, calc(100% - 30px));
  max-width: none;
  max-height: calc(100vh - 30px);
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 110px rgba(0,0,0,.38);
}
.tb-project-dialog-compact { width: min(720px, calc(100% - 30px)); }
.tb-project-dialog-medium { width: min(850px, calc(100% - 30px)); }
.tb-project-dialog-large { width: min(1040px, calc(100% - 30px)); }
.tb-project-dialog-wide { width: min(1220px, calc(100% - 30px)); }
.tb-project-dialog-full { width: min(1480px, calc(100% - 30px)); }
.tb-project-dialog::backdrop { background: rgba(4,12,22,.83); backdrop-filter: blur(4px); }
.tb-project-dialog-frame { position: relative; }
.tb-project-dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: #10243d;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 9px 28px rgba(0,0,0,.20);
}
.tb-project-dialog-hero {
  min-height: 330px;
  max-height: 480px;
  overflow: hidden;
  background: #e9eff4;
}
.tb-project-dialog-hero img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 330px;
  max-height: 480px;
  object-fit: cover;
}
.tb-project-dialog-content { padding: 38px 42px 42px; }
.tb-project-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
}
.tb-project-dialog-heading small {
  color: #00aef0;
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.tb-project-dialog-heading h2 {
  margin: 8px 0 0;
  color: #003b87;
  font-size: clamp(2rem,4vw,3.3rem);
  line-height: 1.04;
  letter-spacing: -.04em;
}
.tb-project-dialog-logo {
  flex: 0 0 auto;
  width: auto;
  max-width: 145px;
  max-height: 82px;
  object-fit: contain;
}
.tb-project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 28px 0 0;
}
.tb-project-meta > div {
  min-width: 200px;
  padding: 16px 18px;
  border: 1px solid #dce7ef;
  border-radius: 12px;
  background: #f6f9fb;
}
.tb-project-meta dt {
  color: #6c7a89;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tb-project-meta dd {
  margin: 5px 0 0;
  color: #172336;
  font-weight: 760;
}
.tb-project-summary {
  margin-top: 28px;
  color: #5e6e7e;
  font-size: 1.05rem;
  line-height: 1.8;
}
.tb-project-detail-section {
  margin-top: 32px;
  padding-top: 29px;
  border-top: 1px solid #dfe8ef;
}
.tb-project-detail-section h3 {
  margin: 0 0 16px;
  color: #003b87;
  font-size: 1.35rem;
}
.tb-project-product-list {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tb-project-product-list li {
  position: relative;
  padding: 14px 16px 14px 43px;
  border: 1px solid #dce7ef;
  border-radius: 12px;
  background: #f7fafc;
  color: #26384a;
  line-height: 1.5;
}
.tb-project-product-list li::before {
  content: "✓";
  position: absolute;
  top: 13px;
  left: 16px;
  color: #00aef0;
  font-weight: 900;
}
.tb-project-technical {
  color: #5f6f7f;
  line-height: 1.78;
}
.tb-project-popup-gallery {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
}
.tb-project-popup-gallery a {
  display: block;
  overflow: hidden;
  aspect-ratio: 4/3;
  border-radius: 10px;
  background: #e7edf2;
}
.tb-project-popup-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.tb-project-popup-gallery a:hover img { transform: scale(1.05); }
.tb-project-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid #dfe8ef;
}
.tb-project-dialog-navigation { display: flex; gap: 9px; }
.tb-project-dialog-navigation button {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #d4e0e8;
  border-radius: 5px;
  background: #fff;
  color: #003b87;
  font-weight: 780;
  cursor: pointer;
}
.tb-project-dialog-navigation button:hover { border-color: #00aef0; background: #00aef0; color: #fff; }
html[dir="rtl"] .tb-project-card,
html[dir="rtl"] .tb-project-card-overlay { text-align: right; }
html[dir="rtl"] .tb-project-dialog-close { right: auto; left: 16px; }
html[dir="rtl"] .tb-project-product-list li { padding-right: 43px; padding-left: 16px; }
html[dir="rtl"] .tb-project-product-list li::before { right: 16px; left: auto; }
@media (max-width: 900px) {
  .tb-project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tb-project-dialog-content { padding: 32px 28px 34px; }
}
@media (max-width: 600px) {
  .tb-project-grid { grid-template-columns: 1fr; }
  .tb-project-dialog { width: calc(100% - 14px); max-height: calc(100vh - 14px); border-radius: 14px; }
  .tb-project-dialog-hero,
  .tb-project-dialog-hero img { min-height: 230px; max-height: 300px; }
  .tb-project-dialog-content { padding: 27px 20px 28px; }
  .tb-project-dialog-header { display: block; }
  .tb-project-dialog-logo { margin-top: 18px; }
  .tb-project-product-list,
  .tb-project-popup-gallery { grid-template-columns: 1fr; }
  .tb-project-dialog-actions { align-items: stretch; flex-direction: column; }
  .tb-project-dialog-actions .tb-button { width: 100%; }
  .tb-project-dialog-navigation { width: 100%; }
  .tb-project-dialog-navigation button { flex: 1; }
}

/* =========================================================
   v1.3.0 Visual Controls frontend support
   ========================================================= */
.tb-container-full { width: 100%; max-width: none; padding-left: 0; padding-right: 0; }
.tb-image { width: 100%; }
.tb-image.is-left { text-align: left; }
.tb-image.is-center { text-align: center; }
.tb-image.is-right { text-align: right; }
.tb-image img { height: auto; }
.tb-image-title, .tb-text-title { margin-top: 0; }
.tb-text.is-drop-cap > p:first-child::first-letter { float: left; margin: .08em .12em 0 0; font-size: 3.2em; font-weight: 800; line-height: .8; color: var(--tb-primary, currentColor); }
.tb-animate { animation-duration: var(--tb-animation-duration, 700ms); animation-delay: var(--tb-animation-delay, 0ms); animation-fill-mode: both; animation-timing-function: ease-out; }
.tb-anim-fadeIn { animation-name: tbFadeIn; }
.tb-anim-fadeInUp { animation-name: tbFadeInUp; }
.tb-anim-fadeInDown { animation-name: tbFadeInDown; }
.tb-anim-fadeInLeft { animation-name: tbFadeInLeft; }
.tb-anim-fadeInRight { animation-name: tbFadeInRight; }
.tb-anim-zoomIn { animation-name: tbZoomIn; }
@keyframes tbFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tbFadeInUp { from { opacity: 0; transform: translate3d(0,28px,0); } to { opacity: 1; transform: none; } }
@keyframes tbFadeInDown { from { opacity: 0; transform: translate3d(0,-28px,0); } to { opacity: 1; transform: none; } }
@keyframes tbFadeInLeft { from { opacity: 0; transform: translate3d(-28px,0,0); } to { opacity: 1; transform: none; } }
@keyframes tbFadeInRight { from { opacity: 0; transform: translate3d(28px,0,0); } to { opacity: 1; transform: none; } }
@keyframes tbZoomIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@media (min-width:1025px) { .tb-hidden-desktop { display: none !important; } }
@media (min-width:768px) and (max-width:1024px) { .tb-hidden-tablet { display: none !important; } }
@media (max-width:767px) { .tb-hidden-mobile { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .tb-animate { animation: none !important; } }
