.product-container {
  display: flex;
  justify-content: center; /* horizontally center */
  padding: 20px;
}

.product-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px; /* optional max width */
  justify-content: center; /* horizontally center */	
  width: 100%;
  box-sizing: border-box;
  flex-direction: row; /* horizontal layout by default */
}

/* Responsive: stack product cards vertically on smaller screens */
@media (max-width: 768px) {
  .product-grid {
    flex-direction: column; /* stack vertically */
    align-items: center;    /* center cards */
  }
  
  .product-card {
    width: 90%; /* almost full width on small screens */
    max-width: 400px; /* optional max width */
  }
}

.product-card h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.product-card {
  position: relative;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  box-sizing: border-box;
  margin-bottom: 20px;
  width: 400px;	
}

.product-image {
  max-width: 100%;
  height: auto;
}

.price-display {
  font-weight: bold;
  margin-top: 10px;
}

.lieferzeit-text {
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: #333;
  font-size: 0.95rem;
}

/* Larger triangle shape with text inside rotated */
.shipping-banner-triangle {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-top: 100px solid goldenrod; /* increased height */
  border-right: 90px solid transparent; /* increased width */
  z-index: 10;
  pointer-events: none; /* so it doesn't interfere with clicks */
  overflow: visible; /* allow text overflow */
}

/* Text inside the triangle - rotated and placed nicely */
.shipping-banner-triangle span {
  position: absolute;
  top: -80px;
  left: -25px;
  width: 120px;
  transform: rotate(-49deg);
  font-weight: bold;
  color: black;
  font-size: 0.85rem;
  font-family: Arial, sans-serif;
  user-select: none;
  text-align: center;
  white-space: nowrap;
}

input[type=number] {
  width: 80px;
}

.error-messages {
  color: red;
}

.success-message {
  color: green;
}

label { 
  display: block; 
  margin-bottom: 10px; 
}

input[type=text], input[type=email] { 
  width: 300px; 
  padding: 6px; 
}

.section {
  background: #fff;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  box-shadow: 0 0 8px #ccc;
}
.section h3 {
  margin-top: 0;
}

.cart-table {
  width: 95%;
  border-collapse: collapse;
}

.cart-table th, .cart-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
  white-space: nowrap;       /* prevent header and data from breaking */
  word-break: normal;
  overflow-wrap: normal;	
}

.cart-table img {
  max-width: 80px;
}

button.checkout-button {
  margin-top: 15px;
  background-color: #28a745;
  border: none;
  color: white;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 16px;
}

button.checkout-button:hover {
  background-color: #218838;
}

.section {
  background: #fff;
  padding: 15px;
  margin-bottom: 20px;
  /*border-radius: 5px;
  box-shadow: 0 0 8px #ccc; */
}

.section h3 {
  margin-top: 0;
}

/* Center the order summary table */
.order-summary-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.order-summary-container table {
  border-collapse: collapse;
  width: auto;
  min-width: 600px;
}
.order-summary-container th,
.order-summary-container td {
  border: 1px solid #ccc;
  padding: 8px 12px;
  text-align: left;
}
#delivery-fields {
  margin-top: 10px;
}
.login-guest-message {
  background-color: #eef6ff;
  padding: 10px 15px;
  margin-bottom: 20px;
  border: 1px solid #99c2ff;
  border-radius: 4px;
  font-size: 1rem;
}
.login-guest-message a {
  color: #0066cc;
  text-decoration: none;
}
.login-guest-message a:hover {
  text-decoration: underline;
}

.payment-method label {
  margin-right: 20px;
}

/* Modern divider style */
.divider {
  height: 2px;
  background: linear-gradient(to right, transparent, #ccc, transparent);
  margin: 30px 0;
  border: none;
}

#image-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 110%; height: 110%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: zoom-out;
  transition: opacity 0.3s ease;
}

#image-modal.show {
  display: flex;
  opacity: 1;
}

.tooltip-container {
  display: inline-block;
  position: relative;
  cursor: pointer;
  color: grey;
  text-decoration: underline;
}

.tooltip-text {
  visibility: hidden;
  width: 250px;
  background-color: #333;
  color: #fff;
  text-align: left;
  border-radius: 5px;
  padding: 8px;
  position: absolute;
  z-index: 10;
  bottom: 125%; /* position above */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
}

/* Arrow below the tooltip */
.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%; /* at the bottom of tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text,
.tooltip-container:focus-within .tooltip-text {
  visibility: visible;
  opacity: 1;
}


/* Responsive vertical layout for cart-table on small screens */
@media (max-width: 768px) {
  
  .cart-table-wrapper {
    overflow-x: visible; /* allow full width on mobile */
  }

  .cart-table {
    width: 100%;
    border: 0;
    table-layout: fixed; /* help with content wrapping */
  }

  /* Hide headers */
  .cart-table thead {
    display: none;
  }

  /* Each row as a card block */
  .cart-table tbody tr {
    display: block;
    margin-bottom: 1.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    background-color: #fff;
    box-sizing: border-box;
  }

  /* Each cell as flex container with label */
  .cart-table tbody td {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    position: relative;
    word-break: break-word;
  }

  /* Remove border on last cell */
  .cart-table tbody td:last-child {
    border-bottom: 0;
  }

  /* Label before each cell (from data-label attr) */
  .cart-table tbody td::before {
    content: attr(data-label);
    flex-basis: 40%;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    text-align: left;
  }

  /* Adjust product image inside cell */
  .cart-table tbody td img {
    max-width: 80px;
    height: auto;
    margin: 0 auto 8px;
    display: block;
  }

  /* Smaller input width for quantity */
  .cart-table tbody td input[type="number"] {
    width: 50px;
  }
}

/* Fix for preventing letter-by-letter word breaks on larger screens */
.box, .box-mobile {
  hyphens: auto;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Prevent header text from breaking or stacking vertically */
.cart-table th {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}