/* =========================================================
   ITX – Embedded Tool Theme (Minimal, Flat, Large Spacing)
   Brand: #FF6600 | Font: Outfit (400/500) | No radii/borders
   Colors adjusted only: page bg #FFF6F0, containers white, dark body text, white button hover text
   ========================================================= */

/* Font: Outfit Regular/Medium */
@font-face {
  font-family: 'Outfit';
  src: url('https://itx.innovative-lab.de/wp-content/uploads/2025/09/Outfit-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* CSS Vars for quick tuning */
:root{
  --brand: #FF6600;
  --bg: #FFF6F0;        /* changed from #FF6600 */
  --text: #111111;
  --text-invert: #111111; /* set to dark so body/headings using this are readable */
  --card-bg: #FFFFFF;
  --muted: rgba(17,17,17,0.65);
  --border: #EAEAEA;
  font-size: 18px;
}

/* Layout base */
body{
  background: var(--bg) !important;
  padding: 0 40px;
  margin: auto;
  color: var(--text-invert); /* stays, now dark due to var change */
  font-family: 'Outfit', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
}

/* Page containers */
#order-form{
  margin-bottom: 56px !important;
}

/* Headings – clean, no uppercase, tighter letter spacing off */
h1,h2,h3{
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  line-height: 1.1;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  color: var(--text-invert); /* remains tied to var */
}

h1{
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  padding: 48px 0 12px 0;
}
h2,h3{
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  padding: 8px 0 0 0;
  margin: 0 0 20px 0;
}

/* If the original DOM uses this special h2, keep spacing but follow style */
#order-form h2:nth-of-type(2){
  position: static !important;
  top: 0 !important;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--text-invert);
}

/* Section "cards" on brand background */
.trainSelector,
fieldset,
table{
  background: var(--card-bg);
  color: var(--text);
  border: none !important;
  position: relative;
  padding: 48px 40px; /* large paddings per guide */
  box-shadow: none;
}

/* Remove decorative dashed/double frames & pseudo-elements */
.trainSelector::before,
.zeit::before,
.change::before,
button::before,
#nextButton::before,
#doneButton::before,
.submit::before,
fieldset::before{
  content: none !important;
  border: none !important;
}

/* Generic rows/columns */
.row{ height: auto !important; }
div.row > div:first-child{
  width: max-content !important;
  min-width: 22%;
  padding: 0 20px;
  margin: 24px 0 20px 0;
  border: none !important;
  display: block;
  height: auto !important;
}

/* Labels & copy */
p, li, th, form, label{
  font-family: 'Outfit', sans-serif !important;
  color: var(--text);
}

p, li{
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 400;
  margin: 6px 0 !important;
}

th{
  font-size: 1rem !important;
  font-weight: 500 !important;
}

/* “Day” & time blocks – flat, no borders, full width on small screens */
.day{
  padding: 16px 12px;
  font-size: 1rem;
  font-weight: 500;
  border: none !important;
  position: relative;
  left: 0 !important;
  color: var(--text);
  background: transparent;
}

.train{ border: none !important; margin-right: 20px; left: 0 !important; width: 100%; }
.train button{ padding: 0 !important; }

/* Zeit block as simple neutral element */
.zeit{
  background: #F7F7F7;
  color: var(--text);
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  padding: 18px 24px;
  box-sizing: border-box;
  width: 100%;
}

/* Small layout utilities */
.trainBox{ width: 32%; display: inline-flex; margin-bottom: 8px; flex-grow: 1; }
.trainTable > div > div{
  position: relative !important;
  left: 0 !important;
  width: 24.5% !important;
  height: auto !important;
  min-height: 56px;
  margin-right: 1%;
}

/* Bars & statuses – flat colors with better contrast on white */
.bar{ width: calc(100% - 10px) !important; margin: auto !important; border-radius: 0; }
.green{ background-color: #2BB673 !important; }
.yellow{ background-color: #FFD166 !important; }
.red{ background-color: #EF476F !important; }

/* Forms */
form{
  font-size: 1rem !important;
  color: var(--text);
}

input, select, textarea{
  position: relative !important;
  outline: none !important;
  background: #FFFFFF !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 !important;
  color: var(--text) !important;
  font-size: 1rem !important;
  padding: 12px 14px !important;
  transition: border-color .2s ease, box-shadow .2s ease;
  box-shadow: none !important;
}

input:focus, select:focus, textarea:focus{
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px rgba(255,102,0,0.15) !important;
}

td input{
  width: 350px !important;
  font-size: 1rem;
  background-color: #FFFFFF !important;
  border: 1px solid var(--border) !important;
}
td input:focus-visible{
  caret-color: var(--text) !important;
  outline: none !important;
}

/* Tables */
table{
  font-size: 1rem;
  color: var(--text);
  background-color: var(--card-bg);
  width: 100%;
  padding: 20px;
  text-align: left !important;
  border-collapse: collapse;
}
table .number{ text-align: left !important; }
.karten{ color: var(--text); font-size: 1rem; width: 100%; max-width: 1300px; border: none !important; padding: 0 !important; }
.karten tr{ height: 48px; }
legend{
  float: left;
  width: 100%;
  padding-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}
#orderSum{ border-top: 1px solid var(--border); }

/* Specific widths */
#Customer_country{ width: 48px !important; margin-right: 12px; }
#Customer_postal{ width: 120px !important; margin-right: 12px; }
select#Customer_salutation{ width: 180px !important; }
input#Customer_title{ width: 200px !important; line-height: 1.3em; }
input#Customer_city{ width: 200px !important; }
.number{ width: 110px !important; }

/* Customer data table spacing tweaks */
#kundenDatenTable{ position: relative; z-index: 2; padding: 0 !important; }
#kundenDatenTable select{ font-size: 1rem !important; }
#kundenDatenTable tbody tr:nth-child(8),
#kundenDatenTable tbody tr:nth-child(10){ height: 72px; vertical-align: bottom !important; }
#kundenDatenTable tbody tr:nth-child(9),
#kundenDatenTable tbody tr:nth-child(11){ height: 56px !important; vertical-align: bottom !important; }

/* Links */
a{
  color: var(--brand) !important;
  text-decoration: none;
  transition: color .2s ease, opacity .2s ease !important;
}
label a:hover,
a:hover{ opacity: .8; }

/* Buttons – flat, high contrast; default: white button on orange bg */
button,
#nextButton,
#doneButton{
  background: #FFFFFF;
  color: var(--brand);
  border: 2px solid var(--brand);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  padding: 16px 24px !important;
  box-sizing: border-box;
  width: auto;
  min-width: 200px;
  cursor: pointer;
  border-radius: 0;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .02s ease-in;
}
button:hover,
#nextButton:hover,
#doneButton:hover{
  background: var(--brand);
  color: #FFFFFF; /* force white text on hover to keep contrast */
}
button:active,
#nextButton:active,
#doneButton:active{
  transform: translateY(1px);
}

/* Secondary action chip */
.change{
  background: transparent;
  color: var(--text-invert); /* now dark */
  border: 2px solid rgba(17,17,17,0.2); /* was white-ish; adjust for light bg */
  font-family: 'Outfit', sans-serif;
  font-size: .9rem;
  padding: 10px 18px !important;
  width: max-content !important;
  box-sizing: border-box;
  float: right;
  margin-bottom: 12px;
}

/* Submit wrapper sizing */
.submit{ width: max-content !important; }

/* Misc */
hr{ display: none; }

/* Mobile adjustments */
@media screen and (max-width:640px), screen and (max-device-width:640px){
  .trainBox{ width: 49% !important; margin-bottom: 12px; }
  div.row > div:first-child{ width: max-content !important; }
  .zeit{ font-size: 1.125rem; padding: 20px 20px; }
  .trainSelector{ margin-top: 40px; padding: 32px 24px; }
  .day{ padding: 16px 12px; font-size: 1.05rem; text-align: left !important; }
  h1{ font-size: clamp(2rem, 9vw, 2.6rem); padding-top: 32px; }
}


/* Compact overrides (<= 750px) to reduce horizontal scroll */
html, body{ overflow-x: hidden; }

@media screen and (max-width: 750px){
  :root{ font-size: 16px; }
  body{ padding: 0 16px; }
  h1{ font-size: 30px; padding-top: 32px; }
  h2, h3{ font-size: 22px; }

  .trainSelector, fieldset, table{ padding: 24px 16px; }

  td input{
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  button, #nextButton, #doneButton{
    min-width: 0;
    width: 100%;
    padding: 14px 16px !important;
  }

  div.row > div:first-child{
    min-width: 0;
    width: 100% !important;
    padding: 0;
    margin: 16px 0;
  }

  .trainTable > div > div{
    width: 49% !important;
    margin-right: 2%;
    min-height: 48px;
  }

  .zeit{ padding: 16px 16px; }
  table{ table-layout: fixed; word-break: break-word; overflow-wrap: anywhere; }
}


/* Table row grid layout for mobile (<= 750px)
   Layout per row:
   - 1st TD full width (title)
   - 2nd & 3rd TD side-by-side (price + "Anzahl:")
   - 4th TD = input (right column under label)
   - Remaining TDs full width below
*/
@media screen and (max-width: 750px){
  table.karten thead{ display: none; }
  table.karten tbody{ display: block; }

  table.karten tbody tr{
    display: grid;
    grid-template-columns: 1fr minmax(120px, 42%);
    grid-auto-rows: auto;
    gap: 12px 4px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  table.karten tbody tr:last-child{ border-bottom: 0; }

  table.karten tbody tr > td{
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
	
	.karten tr {
  height: 75px !important;
}
	
 .number {
	 width: 70px !important;
	}


  /* 1st cell full width */
  table.karten tbody tr > td:nth-child(1){
    grid-column: 1 / -1;
  }

  /* 2nd (price) & 3rd (label) side-by-side */
  table.karten tbody tr > td:nth-child(2){ grid-column: 1; }
  table.karten tbody tr > td:nth-child(3){
    grid-column: 2;
    text-align: right;
    white-space: nowrap;
  }

  /* 4th (input) below the label, same column */
  table.karten tbody tr > td:nth-child(4){
    grid-column: 2;
  }

  /* Any additional cells span full width below */
  table.karten tbody tr > td:nth-child(n+5){
    grid-column: 1 / -1;
  }

  /* Inputs full width inside their grid cell */
  table.karten td input{
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}


/* #kundenDatenTable: 1. TD = 35%, 2. TD = 65%, 3. TD in neuer Zeile */
@media screen and (max-width: 750px){
  #kundenDatenTable thead{ display:none; }
  #kundenDatenTable{
    width: 100%;
    table-layout: fixed;
  }
  #kundenDatenTable tbody{ display:block; }

  /* Jede TR als 2-Spalten-Grid mit 35%/65% */
  #kundenDatenTable tbody tr{
    display: grid;
    grid-template-columns: 35% 65%;
    grid-auto-rows: auto;
    gap: 8px 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  #kundenDatenTable tbody tr:last-child{ border-bottom: 0; }

  #kundenDatenTable tbody tr > td{
    display: block;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* 1. und 2. TD nebeneinander (35%/65%) */
  #kundenDatenTable tbody tr > td:nth-child(1){ grid-column: 1; }
  #kundenDatenTable tbody tr > td:nth-child(2){ grid-column: 2; }

  /* 3. TD: volle Breite in neuer Zeile darunter */
  #kundenDatenTable tbody tr > td:nth-child(3){ grid-column: 1 / -1; }

  /* Optional: 4. TD (Input) rechts unter der 3. TD */
  #kundenDatenTable tbody tr > td:nth-child(4){ grid-column: 2; }

  /* Form-Felder füllen ihre Zelle */
  #kundenDatenTable td input,
  #kundenDatenTable td select{
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

@media (max-width: 750px){
  .karten tr,
  #kundenDatenTable tr {
    height: auto !important;
    min-height: 0 !important;
  }
  .karten td,
  #kundenDatenTable td {
    height: auto !important;
    vertical-align: top;
  }

  /* wenn du das Grid-Layout für #kundenDatenTable nutzt: */
  #kundenDatenTable tbody tr{
    grid-auto-rows: auto;
    align-items: start; /* verhindert Stretching */
  }
}

