/* Mobile-optimierte Styles für den Versandkostenrechner */

/* Bessere Touchable-Bereiche für mobile Geräte */
@media (max-width: 767px) {  /* Verbessern der Kartensteuerelemente auf Mobilgeräten */
  .card-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .card-header .card-title {
    margin-bottom: 0;
    font-size: 1.15rem;
  }
  
  .card-header .btn-sm {
    padding: 0.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 10px;
    background-color: rgba(240, 240, 240, 0.5);
    border: none;
  }
  
  .card-header .btn-sm:focus {
    box-shadow: none;
  }
  
  .card-header .btn-sm i {
    font-size: 1.2rem;
  }    /* Verbesserte Checkbox-Anordnung mit mehr Platz */
  .form-switch {
    padding-left: 3.75rem;
    margin-bottom: 0.75rem;
    margin-top: 0.75rem;
    min-height: 38px;
    display: flex;
    align-items: center;
  }
  
  /* Größere und besser anklickbare Checkboxen */
  .form-check-input {
    width: 2.75rem;
    height: 1.5rem;
    margin-left: -3.75rem;
    cursor: pointer;
    border-radius: 2rem;
  }
  
  .form-check-label {
    cursor: pointer;
    padding-top: 0;
    user-select: none;
    font-size: 0.95rem;
    margin-left: 0.5rem;
  }
  
  /* Verbesserter visueller Zustand für aktive Switches */
  .form-check-input:checked {
    background-color: var(--tblr-primary);
    border-color: var(--tblr-primary);
  }
    /* Stärker hervorgehobener aktiver Button-Status */
  .btn-check:checked + .btn-outline-primary {
    color: #fff !important;
    background-color: var(--tblr-primary) !important;
    box-shadow: 0 3px 8px rgba(var(--tblr-primary-rgb), 0.3) !important;
  }
    /* Verbesserte Anordnung von Button-Gruppen auf mobilen Geräten */
  .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    width: 100%;
  }
  
  .btn-group .btn {
    flex: 1 0 calc(50% - 10px);
    white-space: normal;
    height: auto;
    min-height: 50px;
    padding: 12px 15px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px !important;
    font-size: 0.95rem;
    font-weight: 500;
  }
  
  /* Wenn alle Buttons in einer Gruppe angezeigt werden sollen */
  .btn-group.w-100 > .btn {
    border-radius: 8px !important;
    margin: 0 !important;
    border: 1px solid var(--tblr-primary);
  }
  
  /* Verbessere die Sichtbarkeit des aktiven Status */
  .btn-check:checked + .btn {
    background-color: var(--tblr-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }
  
  /* Verbesserte Darstellung für den Button-Check-Stil */
  .btn-check + .btn {
    margin-bottom: 5px;
    position: relative;
  }
  /* Verbesserte Anordnung der Zusatzgebühren auf mobilen Geräten */
  #additional-fees .col-6 {
    padding: 8px 12px;
    min-height: 68px;
  }
  
  /* Anpassen der Karten-Header-Buttons für zusätzliche Gebühren */
  .mobile-toggle-btn {
    height: 44px;
    width: 44px;
    border-radius: 50%;
    margin-left: 5px;
  }
  
  /* Verbesserte Form-Switches in Zusatzgebühren */
  #additional-fees .form-check.form-switch {
    background-color: rgba(240, 240, 240, 0.15);
    border-radius: 12px;
    padding: 12px 12px 12px 4rem;
    margin: 4px 0;
    transition: background-color 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    min-height: 46px;
  }
  
  #additional-fees .form-check.form-switch:active {
    background-color: rgba(240, 240, 240, 0.5);
  }
  
  /* Bessere Trennung zwischen den Switches */
  #additional-fees .row.g-2 {
    row-gap: 10px !important;
  }
  
  /* Verbessere den Abstand zwischen Form-Elementen */
  .mb-3 {
    margin-bottom: 1.25rem !important;
  }
  
  /* Größere Abstände zwischen den Formular-Elementen auf mobilen Geräten */
  @media (max-width: 767px) {
    .row.g-3 > .col, 
    .row.g-3 > [class*="col-"] {
      padding-top: 0.5rem;
      padding-bottom: 0.5rem;
    }
  }
  
  /* Verbesserter Footer auf mobilen Geräten */
  .footer .row {
    text-align: center;
  }
  
  .footer ul.list-inline li {
    display: block;
    margin-bottom: 10px;
  }
  
  /* Hover-Effekte für Touchscreens verbessern */
  .btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
  }
}

/* Optimierungen für neuere iPhone Modelle und moderne Android Geräte */
@media only screen and (device-width: 428px) and (device-height: 926px), /* iPhone 13/14 Pro Max, 12 Pro Max */
       only screen and (device-width: 390px) and (device-height: 844px), /* iPhone 13/14 Pro, 13/14, 12 Pro, 12 */
       only screen and (device-width: 375px) and (device-height: 812px), /* iPhone 11 Pro, XS, X */
       only screen and (min-width: 390px) and (max-width: 767px) {      /* Neuere Android-Modelle */
  
  /* Anpassungen für Safe Area und Notch auf neuen Geräten */
  .page-wrapper {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  /* Bessere Darstellung der Formulare auf modernen Geräten */
  .form-control, .form-select, .btn {
    border-radius: 12px;
    height: 50px;
  }
  
  /* Verbesserte Input-Felder mit korrektem Abstand */
  .input-icon .form-control {
    padding-left: 3.25rem; /* Mehr Platz für das Icon links */
  }
  
  .input-icon .form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(32, 107, 196, 0.15);
  }
  
  .input-icon {
    border-radius: 12px;
    position: relative;
    margin-bottom: 0.5rem;
  }
  
  .input-icon-addon {
    min-width: 2.5rem;
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
  }
  
  /* Icon-Addon links ausrichten */
  .input-icon-addon:first-child {
    left: 0.75rem;
  }
  
  /* Icon-Addon rechts ausrichten */
  .input-icon-addon:last-child:not(:first-child) {
    right: 0.75rem;
  }
  
  /* Wenn es zwei Icons gibt (links und rechts) */
  .input-icon-addon + .form-control + .input-icon-addon {
    padding-right: 1rem;
  }
  
  /* Input mit rechtsseitigem Addon-Text (z.B. "kg") */
  .input-icon-addon:last-child:not(:first-child) + .form-control,
  .input-icon-addon + .form-control + .input-icon-addon {
    padding-right: 3.25rem;
  }
    /* Verbesserte Darstellung von Formularbereichen */
  .card {
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }
  
  .card-header {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background-color: rgba(248, 249, 250, 0.9);
  }
  
  .card-body {
    padding: 1.25rem 1rem;
  }
  
  /* Bessere Form Footer */
  .form-footer {
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
    margin-top: 1rem;
  }
  
  .form-footer .btn {
    margin-bottom: 0.75rem;
    padding: 12px;
  }
}

/* Verbesserte Card Headers */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header .card-actions {
  display: flex;
  align-items: center;
}

.card-header .btn-sm {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-left: 8px;
  padding: 0;
}

/* Verbesserte Button-Darstellung im Footer */
.form-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.5rem;
}

.form-footer .btn {
  flex: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Animation für Karte beim Öffnen des Versandrechners */
@keyframes cardEntrance {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.calculator-form .card {
  animation: cardEntrance 0.5s ease forwards;
}

/* Fix für iOS active states */
.form-check-input.ios-active {
  opacity: 0.8;
  transform: scale(0.95);
}
