:root {
  --primary: #273b35;
  --background: #fcfbf8;
  --accent: #4caf50;
  --border: #e5e5e5;
  --text-light: #666;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--background);
  color: var(--primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.checkout-header {
  background-color: white;
  box-shadow: var(--shadow);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  max-width: 180px;
  height: auto;
}

.phone-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.phone-link:hover {
  background-color: rgba(39, 59, 53, 0.05);
}

/* Main Content */
.page-content {
  padding: 40px 20px;
}

.checkout-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.checkout-main {
  background-color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}

.checkout-main h1 {
  text-align: center;
  margin-bottom: 10px;
  color: var(--primary);
  font-weight: 600;
  font-size: 28px;
}

.checkout-subtitle {
  text-align: center;
  margin-bottom: 40px;
  color: var(--text-light);
  font-size: 16px;
}

/* Step Indicator */
.step-indicator {
  margin-bottom: 40px;
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--border);
  transition: all 0.3s ease;
}

.step-dot.active {
  background-color: var(--primary);
  transform: scale(1.2);
}

/* Form Steps */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.form-step h2 {
  margin-bottom: 30px;
  color: var(--primary);
  font-size: 24px;
  font-weight: 600;
}

.form-step h3 {
  margin-bottom: 20px;
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
}

/* Service Grid */
.service-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 35px;
  margin-bottom: 40px;
  justify-content: center;
}

.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 128px;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.service-item:hover {
  opacity: 1;
  transform: scale(1.05);
}

.service-item.selected {
  opacity: 1;
  transform: scale(1.05);
}

.service-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 50%;
  background-color: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.service-item.selected .service-icon {
  background-color: var(--primary);
}

.service-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: all 0.3s ease;
}

.service-item.selected img {
  filter: brightness(0) invert(1);
}

.service-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-align: center;
  line-height: 1.3;
  width: 100%;
  word-wrap: break-word;
  hyphens: auto;
}

/* Form Elements */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* Full width form rows */
.form-row-full {
  grid-template-columns: 1fr !important;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--primary);
}

.form-group input,
.form-group textarea {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input[readonly] {
  background-color: #f8f8f8;
  color: var(--text-light);
}

/* Tarif Grid */
.tarif-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
  align-items: stretch;
}

.tarif-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--background);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tarif-item:hover {
  border-color: #273b35;
  transform: translateY(-2px);
}

.tarif-item.selected {
  border-color: #273b35;
  background-color: rgba(39, 59, 53, 0.05);
}

/* Smaller text for selected tarif */
.tarif-item.selected .tarif-header h4 {
  font-size: 16px;
}

.tarif-item.selected .tarif-price {
  font-size: 18px;
}

.tarif-item.selected .tarif-subtitle {
  font-size: 11px;
}

.tarif-item.selected .tarif-requirements h5,
.tarif-item.selected .tarif-volume h5 {
  font-size: 13px;
}

.tarif-item.selected .tarif-requirements p,
.tarif-item.selected .tarif-tasks p,
.tarif-item.selected .tarif-volume p {
  font-size: 13px;
}

.tarif-item.selected .mwst-note {
  font-size: 11px !important;
}

.tarif-item.selected::before {
  content: 'Ausgewählt';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #273b35;
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 10px;
}

.tarif-header {
  position: relative;
}

.tarif-header h4 {
  margin: 0 0 8px 0;
  color: var(--primary);
  font-size: 18px;
}

.tarif-price {
  font-size: 20px;
  font-weight: 700;
  color: #273b35;
  margin-bottom: 5px;
}

.tarif-subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.checkmark {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: 2px solid #273b35;
  border-radius: 50%;
  background: #273b35;
}

.checkmark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
}

.tarif-details {
  margin-top: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tarif-requirements h5,
.tarif-volume h5 {
  margin: 0 0 8px 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

.tarif-requirements p,
.tarif-tasks p,
.tarif-volume p {
  margin: 0 0 5px 0;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.4;
}

.tarif-tasks {
  margin: 10px 0;
}

.tarif-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tarif-features-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.tarif-features-list li:before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: bold;
  font-size: 12px;
}

.tarif-features-list li:last-child {
  margin-bottom: 0;
}

.tarif-volume {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.mwst-note {
  font-size: 12px !important;
  color: var(--text-light) !important;
  margin-top: 10px !important;
}

/* Tarif Details Animation */
.tarif-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.tarif-item.expanded .tarif-details {
  max-height: 500px;
  border-top: 1px solid var(--border);
}

/* Tarif Toggle All Text */
.tarif-toggle-all {
  text-align: center;
  margin-top: 20px;
}

.tarif-toggle-all .toggle-text {
  color: #273b35;
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.3s ease;
}

.tarif-toggle-all .toggle-text:hover {
  color: #1a2a26;
}

/* Frequency Grid */
.frequency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 40px;
}

.frequency-item {
  padding: 15px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.frequency-item:hover {
  border-color: #273b35;
}

.frequency-item.selected {
  border-color: #273b35;
  background-color: #273b35;
  color: white;
}

/* Duration Grid */
.duration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin-bottom: 40px;
}

.duration-item {
  padding: 15px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.duration-item:hover {
  border-color: #273b35;
}

.duration-item.selected {
  border-color: #273b35;
  background-color: #273b35;
  color: white;
}

/* Buttons */
.step-buttons {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
}

.btn {
  padding: 15px 30px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: #1a2a26;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #f0f0f0;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background-color: #e0e0e0;
  border-color: var(--primary);
}

/* Contact Info */
.contact-info {
  background-color: rgba(76, 175, 80, 0.05);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 30px;
  border-left: 4px solid var(--accent);
}

.terms-notice {
  background-color: #f8f8f8;
  padding: 20px;
  border-radius: var(--radius);
  margin: 30px 0;
  font-size: 14px;
  color: var(--text-light);
}

.terms-notice a {
  color: var(--accent);
  text-decoration: underline;
}

/* Summary Sidebar */
.summary-sidebar {
  position: sticky;
  top: 100px;
}

.summary-box {
  background-color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

/* Mobile Expandable Summary */
.mobile-expandable-summary {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: white;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  transition: transform 0.3s ease;
  transform: translateY(calc(100% - 80px));
}

.mobile-expandable-summary.visible {
  display: block;
}

.mobile-expandable-summary.expanded {
  transform: translateY(0);
}

/* Prevent background scrolling when mobile summary is expanded */
body.mobile-summary-expanded {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.mobile-summary-handle {
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  position: relative;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.mobile-summary-grip {
  width: 40px;
  height: 5px;
  background-color: #ddd;
  border-radius: 3px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-top: 15px;
}

.mobile-summary-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.mobile-summary-details-btn {
  padding: 8px 16px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  color: var(--primary);
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-summary-details-btn:hover {
  background-color: rgba(39, 59, 53, 0.05);
}

/* Green button style when showing "schliessen" */
.mobile-summary-details-btn[data-action='close'] {
  background-color: #273b35;
  color: white;
  border-color: #273b35;
}

.mobile-summary-details-btn[data-action='close']:hover {
  background-color: #1a2a26;
  border-color: #1a2a26;
}

.mobile-summary-content {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-expandable-summary.expanded .mobile-summary-content {
  opacity: 1;
  pointer-events: auto;
}

.mobile-summary-content h3 {
  margin-bottom: 15px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 600;
}

.mobile-summary-content .summary-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.mobile-summary-content .summary-item:last-child {
  border-bottom: none;
}

.mobile-summary-content .summary-item.total {
  font-weight: 700;
  font-size: 18px;
  border-top: 2px solid var(--primary);
  border-bottom: none;
  padding-top: 15px;
  margin-top: 10px;
}

.mobile-summary-content .summary-note {
  margin-top: 20px;
  padding: 15px;
  background-color: rgba(39, 59, 53, 0.05);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

.summary-box h3 {
  margin-bottom: 20px;
  color: #273b35;
  font-size: 20px;
  font-weight: 600;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-item.total {
  font-weight: 700;
  font-size: 18px;
  border-top: 2px solid var(--accent);
  border-bottom: none;
  padding-top: 15px;
  margin-top: 10px;
}

.summary-label {
  color: var(--text-light);
}

.summary-value {
  font-weight: 600;
  color: var(--primary);
}

.summary-note {
  margin-top: 20px;
  padding: 15px;
  background-color: #f8f8f8;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

/* Summary Placeholder */
.summary-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.summary-placeholder svg {
  margin-bottom: 20px;
  color: #273b35;
  opacity: 0.6;
}

.summary-placeholder p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-light);
}

/* Section Spacing */
.section {
  margin-bottom: 40px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .checkout-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .summary-sidebar {
    display: none;
  }

  .mobile-expandable-summary.visible {
    display: block;
  }

  .checkout-main {
    padding-bottom: 20px;
  }

  .checkout-main.with-mobile-summary {
    padding-bottom: 100px;
  }
}

@media (min-width: 1025px) {
  .mobile-expandable-summary {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .page-content {
    padding: 20px 15px;
  }

  .checkout-main {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .service-grid {
    gap: 20px;
  }

  .service-item {
    width: 128px;
  }

  .service-icon {
    width: 50px;
    height: 50px;
    padding: 8px;
  }

  .service-icon img {
    width: 34px;
    height: 34px;
  }

  .service-title {
    font-size: 13px;
  }

  .tarif-grid {
    grid-template-columns: 1fr;
  }

  .frequency-grid {
    grid-template-columns: 1fr;
  }

  .duration-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .step-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .phone-number {
    display: none;
  }

  .logo img {
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  .checkout-main h1 {
    font-size: 24px;
  }

  .checkout-main h2 {
    font-size: 20px;
  }

  .checkout-main h3 {
    font-size: 18px;
  }

  .service-grid {
    gap: 15px;
  }

  .service-item {
    width: 128px;
  }

  .service-icon {
    width: 45px;
    height: 45px;
    padding: 6px;
  }

  .service-icon img {
    width: 30px;
    height: 30px;
  }

  .service-title {
    font-size: 12px;
  }

  .duration-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
