/* ==== MOBILE OVERRIDES (max-width: 900px) ==== */

/* ------ Layout ------ */
#container                      { display: flex; flex-direction: column; padding: 20px 15px; gap: 20px; }
#main                           { width: 100%; }
#right.aside                    { width: 100%; display: none; }
.table                          { overflow-x: scroll; }

/* ------ Header ------ */
#header .inside                 { padding: 12px 15px; gap: 15px; flex-wrap: wrap; justify-content: center; position: relative; }
#header .logo img               { height: 45px; }
#header .nav                    { display: none; }
a#membersarea                   { display: none; }
#header .mobile_btn             { display: block; }
#header .mobile_btn.mobile_menu { width: 30px; height: 24px; cursor: pointer; margin-left: 0; position: absolute; right: 15px; top: 50%; transform: translateY(-50%); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='24' viewBox='0 0 30 24'%3E%3Crect y='0' width='30' height='3' rx='1.5' fill='%233e5c87'/%3E%3Crect y='10.5' width='30' height='3' rx='1.5' fill='%233e5c87'/%3E%3Crect y='21' width='30' height='3' rx='1.5' fill='%233e5c87'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: contain; }
#header .mobile_btn.mobile_login { display: none; }

#header .membersarea                   { font-family: var(--font-serif); font-size: 16px; color: var(--color-white); background: var(--color-primary); border-radius: var(--border-radius-btn); padding: 5px 20px; white-space: nowrap; }

#header .social                 { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
#header .social a               { width: 24px; height: 24px; display: block; opacity: 0.8; background: center / contain no-repeat; }
#header .social a:hover         { opacity: 1; }
#header .social a.facebook      { background-image: url('img/social-facebook-header.svg'); }
#header .social a.tiktok        { background-image: url('img/social-tiktok-header.svg'); }
#header .social a.instagram     { background-image: url('img/social-instagram-header.svg'); }
#header .social a.youtube       { background-image: url('img/social-youtube-header.svg'); }

/* ------ Hero Slider ------ */
.cte_slider .sliderContainer    { height: 280px !important; }
.cte_slider .mask               { height: 280px; }
.cte_slider .mover              { height: 280px !important; }
.cte_slider .slide              { height: 280px !important; padding-top: 30px; }
.cte_slider .slide p            { font-size: 22px; line-height: 30px; }
.cte_slider .slide > p:first-child img { max-width: 181px; height: auto; display: block; margin: 0 auto; }
.cte_slider .slide > p:nth-child(2) { max-width: 270px; margin-left: auto; margin-right: auto; }
.cte_slider .slide > div:nth-child(3) { margin-top: 20px; }
.cte_slider .slide > div:nth-child(3) a { width: auto; padding: 8px 30px; font-size: 16px; }

/* ------ Pagetitle Hero ------ */
#before .pagetitle              { min-height: 170px; background-position: 62% center; }
#before .pagetitle h1           { max-width: none; padding: 0 15px; font-size: 30px; line-height: 36px; }

/* ------ Content Banner ------ */
#main .cte_text.block { padding: 20px 20px 30px; background-size: cover; background-position: center; border-radius: var(--border-radius-card); margin-bottom: 20px; }

/* ------ Agent List ------ */
.agentlist .profile             { display: grid; grid-template-columns: 136px minmax(0, 1fr); grid-template-areas: "photo info" "body body" "actions actions"; column-gap: 15px; row-gap: 12px; flex-direction: unset; }
.agentlist .profile.weekagent   { grid-template-areas: "label label" "photo info" "body body" "actions actions"; padding: 20px 15px; }
.agentlist .profile .week-label { grid-area: label; display: block; }
.agentlist .profile .pic-link   { grid-area: photo; align-self: start; }
.agentlist .profile .img.pic    { width: 136px; height: 150px; max-width: none; object-fit: cover; border-radius: var(--border-radius-card); float: none; margin: 0; }
.agentlist .profile .content-wrap  { display: contents; width: auto; min-width: 0; }
.agentlist .profile .content-top   { border-bottom: none; grid-area: info; min-width: 0; overflow: hidden; flex-direction: column; gap: 4px; align-items: flex-start; }
.agentlist .profile .title-rating  { flex-direction: column; align-items: flex-start; gap: 4px; }
.agentlist .profile .content-top .meta { flex-direction: column; gap: 2px; white-space: normal; align-items: unset; }
.agentlist .profile .content-top .meta .sep { display: none; }
.agentlist .profile .content-body  { grid-area: body; min-width: 0; }
.agentlist .profile .content-actions { grid-area: actions; flex-direction: column; gap: 8px; min-width: 0; }
.agentlist .profile .content-actions .primary-action { width: 100%; flex-direction: column; align-items: center; }
.agentlist .profile .content-actions .button { width: 100%; justify-content: center; box-sizing: border-box; min-width: 0; }

/* ------ Busy List ------ */
.busylist                       { margin: -20px 15px 0; padding: 20px 15px 30px; max-width: none; }
.busylist h2.bh                 { font-size: 20px; line-height: 30px; margin-bottom: 20px; }
.busylist .box                  { width: 83px; margin-right: 15px; margin-bottom: 0; }
.busylist .box img              { width: 83px; height: 90px; }

/* ------ Tariff Table ------ */
#main .cte_tariffs              { grid-template-columns: 1fr; }

/* ------ Mobile Nav Panel ------ */
/* Contao fügt beim Hamburger-Klick die Klasse .open zur .nav hinzu */
#header .nav.open {
  display: flex !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-items: stretch;
  justify-content: stretch;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(333px, calc(100vw - 57px));
  height: 100dvh;
  background: #fff;
  border-radius: 20px 0 0 20px;
  z-index: 2147483646;
  box-sizing: border-box;
  padding: 24px 24px 32px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.4);
  overflow: hidden;
  padding-top: 70px;
  gap: 18px;
}

/* Logo oben links im Panel */
#header .nav.open::after {
  content: '';
  position: absolute;
  top: 10px; left: 24px;
  width: 143px; height: 40px;
  background: url('img/logo.png') no-repeat left center / contain;
}

/* Schließen-Button (X) */
#header .nav.open .mobile_close     { display: block; position: absolute; top: 24px; right: 24px; width: 28px; height: 28px; cursor: pointer; z-index: 2; }
#header .nav.open .mobile_close::before,
#header .nav.open .mobile_close::after { content: ''; position: absolute; top: 50%; left: 0; width: 100%; height: 2px; background: #d8dee7; border-radius: 1px; }
#header .nav.open .mobile_close::before { transform: translateY(-50%) rotate(45deg); }
#header .nav.open .mobile_close::after  { transform: translateY(-50%) rotate(-45deg); }

/* Level 1 Navigation */
#header .nav.open nav               { width: 100%; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; align-items: flex-start; justify-content: center; padding-bottom: 12px; }
#header .nav.open ul.level_1        { display: flex; flex-direction: column; align-items: center; gap: 20px; list-style: none; margin: 0; padding: 0; width: 100%; }
#header .nav.open ul.level_1 > li   { width: 100%; text-align: center; }
#header .nav.open ul.level_1 > li > a { font-family: var(--font-serif); font-size: 18px; line-height: 30px; color: var(--color-primary); text-decoration: none; display: block; }
#header .nav.open ul.level_1 > li.show_regular { display: none; }

/* Level 2 Navigation (eingeloggt als Berater/Kunde) */
#header .nav.open ul.level_2        { position: static !important; overflow: visible !important; height: auto !important; background: transparent !important; box-shadow: none !important; display: flex; flex-direction: column; align-items: center; gap: 6px; list-style: none; margin: 8px 0 0; padding: 0; }
#header .nav.open ul.level_2 > li > a { font-family: var(--font-serif); font-size: 15px; line-height: 24px; color: var(--color-primary) !important; opacity: 0.75; text-decoration: none; display: block; }

/* "Mein Konto" Button */
#header .nav.open .membersarea {
  position: static !important;
  margin: 0 auto;
  width: 203px;
  text-align: center;
  background: var(--color-primary);
  color: #fff !important;
  border-radius: 20px;
  padding: 5px 20px;
  font-family: var(--font-serif);
  font-size: 16px; line-height: 30px;
  text-decoration: none;
  box-sizing: border-box;
  white-space: nowrap;
  display: block !important;
  z-index: 1;
  flex-shrink: 0;
}

/* Social Icons im Burger-Menü */
#header .nav.open .social {
  position: static;
  margin: 0 auto;
  display: flex; gap: 10px; align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#header .nav.open .social a      { display: block; width: 24px; height: 24px; background: no-repeat center / contain; }
#header .nav.open .social a.facebook  { background-image: url('img/social-facebook-header.svg'); }
#header .nav.open .social a.tiktok    { background-image: url('img/social-tiktok-header.svg'); }
#header .nav.open .social a.instagram { background-image: url('img/social-instagram-header.svg'); }
#header .nav.open .social a.youtube   { background-image: url('img/social-youtube-header.svg'); }

/* ------ Login ------ */
.mod_login                      { flex-direction: column; padding: 20px 20px 30px; }
.mod_login .bh                  { font-size: 18px; text-align: center; }
.mod_login .login-col           { padding-right: 0; border-right: none; border-bottom: 1px solid #d8dee7; padding-bottom: 30px; margin-bottom: 30px; }
.mod_login .register-col        { padding-left: 0; }
.mod_login .register-col p      { text-align: center; }
.mod_login .login-actions       { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 8px; }
.mod_login input.submit         { width: 100%; box-sizing: border-box; }
.mod_login a.pwlink             { text-align: center; display: block; }
.mod_login a.button.register    { display: block; width: 100%; box-sizing: border-box; text-align: center; }

/* ------ Phone Number Form ------ */
.mod_phone_create                   { padding: 20px 20px 30px; }
.mod_phone_create h2.bh             { font-size: 18px; }
.mod_phone_create .row              { flex-direction: column; align-items: flex-start; margin-bottom: 15px; }
.mod_phone_create label             { width: auto; margin-bottom: 5px; }
.mod_phone_create div.phone         { width: 100%; }
.mod_phone_create input.submit      { margin-left: 0; width: 100%; box-sizing: border-box; }

/* ------ Forms (Neukunde, Berater werden, Kontakt) ------ */
.mod_register,
.cte_form                       { padding: 20px 20px 30px; }
.mod_register h1.bh,
.mod_register h2.bh,
.cte_form h1.bh,
.cte_form h2.bh                 { font-size: 18px; text-align: center; }
.mod_register .row,
.cte_form .row                  { flex-direction: column; align-items: flex-start; margin-bottom: 15px; }
.mod_register label,
.cte_form label                 { width: auto; margin-bottom: 5px; }
.mod_register input.text,
.mod_register select,
.cte_form input.text,
.cte_form select,
.cte_form .textdiv,
.cte_form textarea              { width: 100%; box-sizing: border-box; }
.mod_register .row.check,
.cte_form .row.check            { flex-direction: row; padding-left: 0; }
.mod_register p,
.mod_register .retraction       { padding-left: 0; }
.mod_register input.submit,
.cte_form .submit_div,
.cte_form .submit               { margin-left: 0; width: 100%; box-sizing: border-box; text-align: center; }

/* ------ Modal Window (#window) ------ */
#window                             { width: 360px !important; left: 50% !important; transform: translate(-50%, -50%) !important; }
#window .inside                     { padding: 40px 15px 20px; }
#window .close                      { right: 10px; }
dialog                              { min-width: auto; width: 90vw; max-width: 90vw; padding: 50px 15px 20px; }

/* ------ Kunden-Nachrichten (mod_pm) ------ */
.mod_pm                             { padding: 20px 20px 28px; }
.mod_pm input.text.search           { width: 100%; box-sizing: border-box; display: block; }
.mod_pm a.button.write_msg          { float: none; display: block; width: 100%; box-sizing: border-box; text-align: center; margin-top: 8px; }
.mod_pm div.table.mobile_table      { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ------ Beraterbereich ------ */
.mod_logout,
.mod_avatar,
.mod_statistic,
.mod_status,
.mod_callback,
.mod_campaign,
.mod_invoice,
.mod_categories,
.mod_consultations,
.cte_account                    { padding: 20px 20px 28px; }
.mod_avatar h1.bh,
.mod_statistic h2.bh,
.cte_account h2.bh              { font-size: 18px; line-height: 26px; margin-bottom: 16px; }
.mod_logout form                { flex-direction: column; gap: 10px; }
.mod_logout a.submit.callmonitor,
.mod_logout input.submit        { width: 100%; box-sizing: border-box; }
.mod_avatar a.button.create     { display: block; width: 100%; box-sizing: border-box; text-align: center; margin-bottom: 16px; }
.mod_avatar .table.mobile_table { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding-bottom: 4px; }
.mod_avatar table               { min-width: 620px; border-collapse: collapse; }
.mod_avatar th,
.mod_avatar td                  { white-space: nowrap; padding-right: 14px; vertical-align: middle; }
.mod_avatar td.mv img           { width: 90px; height: 90px; object-fit: cover; margin-bottom: 0; }
.cte_account form               { display: flex; flex-direction: column; gap: 14px; }
.cte_account .row               { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 0; }
.cte_account label              { width: auto; padding-top: 0; margin-bottom: 0; }
.cte_account .textdiv,
.cte_account .flex_editor,
.cte_account textarea           { width: 100%; box-sizing: border-box; }
.cte_account textarea           { min-height: 132px; }
.cte_account input.submit       { margin-left: 0; width: 100%; box-sizing: border-box; }
.cte_account .help              { font-size: 12px; line-height: 18px; color: var(--color-text); }
.cte_account .help p            { margin: 0; }
.cte_account .flex_editor       { min-width: 0; }
.cte_account .flex_editor .fx_bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border: 1px solid #dbe0e6; border-bottom: none; border-radius: 16px 16px 0 0; background: var(--color-white); }
.cte_account .flex_editor .fx_bar i { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: #f4f6f9; color: var(--color-primary); font-size: 13px; }
.cte_account .flex_editor .fx_cnt { min-height: 180px; padding: 14px 16px; border: 1px solid #dbe0e6; border-radius: 0 0 16px 16px; background: var(--color-white); font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
.cte_account .flex_editor .fx_cnt p { margin: 0; }

/* ------ Berater: Onlinestatus ------ */
.mod_status form                    { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.mod_status h2                      { width: 100%; margin-bottom: 2px; }
.mod_status label[for^="phone"]     { flex: 1 1 calc(50% - 6px); box-sizing: border-box; text-align: center; padding: 10px 12px; }
.mod_status hr,
.mod_status noscript                { width: 100%; }
.cte_account .form_tariff           { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; }
.cte_account .form_tariff label     { grid-column: 1 / -1; }
.cte_account .form_tariff input.text { width: 100%; min-width: 0; }
.cte_account .form_tariff .input_curr { font-size: 12px; }
.cte_account #tariff,
.cte_account #specialTariff         { width: 100%; }
.cte_account .extended              { width: 100%; }

/* ------ Berater: Meine Kunden ------ */
.mod_customers                      { padding: 20px 20px 28px; }
.mod_customers div.right            { float: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.mod_customers div.right a.button   { justify-content: center; text-align: center; line-height: 18px; padding: 12px 14px; min-height: 72px; }
.mod_customers form.left            { width: 100%; }
.mod_customers div.search           { display: block; }
.mod_customers input.text.search    { width: 100%; box-sizing: border-box; }
.mod_customers ul.tabnav            { flex-wrap: wrap; gap: 10px; margin: 16px 0 14px; }
.mod_customers ul.tabnav li         { flex: 1 1 calc(50% - 5px); }
.mod_customers ul.tabnav li a       { width: 100%; min-height: 54px; text-align: center; line-height: 20px; padding: 8px 12px; box-sizing: border-box; }
.mod_customers > p                  { margin: 0; line-height: 22px; }
.mod_customers .tabnav              { height: auto; }

/* ------ Footer ------ */
#footer .inside                 { flex-direction: column; align-items: center; padding: 30px 15px; gap: 20px; }
#footer .cte_text.nav           { width: 100%; }
#footer .cte_text.nav ul        { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 5px 10px; }
#footer .social                 { width: 100%; justify-content: center; }
