/* Page background (the grey surrounding area) */
body {
  font-family: Arial, sans-serif;
  background-color: #37383b; /* Your outer grey background */
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Prevents horizontal scrollbars when sidebar moves */
}


html, body {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.page-wrapper {
  position: relative;
  display: flex;
  max-width: 1000px;
  margin: 20px auto; /* Added vertical margin to separate it from top/bottom screen edges */
  overflow: hidden; /* Clips content and sidebar to the rounded corners */
  border-radius: 12px; /* Controls corner roundness */
}


/* Sidebar styling */
#sidebar {
  position: absolute;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  background-color: #ffffff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
  
  /* Hidden state: shifted left, layer sits beneath main interactive elements */
  z-index: 10;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

/* Active/Open state for sidebar */
#sidebar.open {
  transform: translateX(0);
  z-index: 1000; /* Moves above main content when open */
}

/* Main Content Area */
.main-content {
  position: relative;
  width: 100%;
  background: #faefe1; /* Cream background */
  padding: 15px 20px 20px 20px;
  box-sizing: border-box;
  z-index: 20; /* Sits above the closed sidebar layer */
}

/* Sidebar Overlay (darkened backdrop when sidebar opens) */
#sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 995;
  display: none;
}

#sidebar-overlay.active {
  display: block;
}

.sidebar-title {
  font-size: 1.2em;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #777777;
  margin: 100px 0 15px 10px;
  font-weight: bold;
}

.sidebar-nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  color: #333333;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover {
  background-color: #f4ece1;
  color: #000000;
}

/* Page Layout */
/* Ensure page-wrapper acts as the relative positioning boundary */
.page-wrapper {
  position: relative;
  display: flex;
  max-width: 1000px; /* Or whatever maximum width container you use */
  margin: 0 auto;
}

/* Position sidebar absolutely relative to the page-wrapper */
#sidebar {
  position: absolute;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  z-index: 1000;
  background-color: #ffffff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);

  /* Start off-screen (hidden to the left of the main block) */
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

/* Class added via JS when sidebar is open */
#sidebar.open {
  transform: translateX(0);
}

/* Main Content Area */
.main-content {
  position: relative;
  width: 100%;
  background: #faefe1;
  padding: 15px 20px 20px 20px;
  box-sizing: border-box;
}

/* 1. Move toggle button to top-left */
#sidebar-toggle {
  position: absolute;
  top: 15px;
  left: 15px; /* Shifted from right: 15px to left: 15px */
  z-index: 990;
  background: #ffffff;
  border: 1px solid #e2d2c0;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#sidebar-toggle:hover {
  background-color: #f7f0e6;
}

/* Adjust header spacing so the title/logo isn't covered by the new top-left toggle */
#header {
  margin-top: 5px; /* Give room above header for the left-aligned toggle */
}



/* Responsiveness tweaks for smaller displays */
@media (max-width: 900px) {
  .page-wrapper {
    margin: 10px;
    border-radius: 6px;
  }
}


h1 {
  text-align: center;
  margin-bottom: 30px;
}

/* Header & Language Selection */
#header {
  position: relative;
  margin-bottom: 40px;
  height: 140px;
  background: transparent; /* Inherits body container background naturally */
  padding: 0 15px;
}

.logo-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 20px;
  background: white;
  padding: 0px 0px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
}

.logo-container img {
  max-height: 140px;
  width: auto;
}

#language-selection {
  position: absolute;
  right: 0;
  top: 0;
  font-weight: bold;
  font-size: 1em;
  line-height: 140px;
  padding-right: 10px;
}

#language-selection a {
  color: black;
  text-decoration: none;
  padding: 2px 6px;
}

#language-selection a.active {
  font-weight: bold;
  text-decoration: underline;
}

/* Buttons & Controls */
#filter-buttons,
#language-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

button {
  padding: 8px 14px;
  border: 2px solid #444;
  background: white;
  cursor: pointer;
  font-weight: bold;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s;
}

button.active {
  background-color: #444;
  color: white;
}

/* Product Cards */
.product {
  display: flex;
  align-items: center;
  padding: 20px;
  margin-bottom: 16px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2d2c0;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product img {
  max-width: 200px;
  max-height: 140px;
  margin-right: 25px;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 4px;
  background: #ffffff;
  pointer-events: none;
  object-fit: contain;
}

.product-details {
  max-width: 520px;
  pointer-events: none;
}

.product-details strong {
  font-size: 1.1em;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
}

.quantity-controls button {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 20px;
  line-height: 20px;
  text-align: center;
  user-select: none;
}

.quantity-controls span {
  min-width: 22px;
  text-align: center;
  display: inline-block;
  font-weight: bold;
  font-size: 16px;
}

/* Links & General Formatting */
p.contact {
  text-align: center;
  margin-top: 40px;
  font-style: italic;
}

a {
  color: #0000ee;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* How To Order */
#how-to-order {
  margin: 20px auto;
  max-width: 700px;
  text-align: left;
  color: black;
}

/* Order Summary */
#order-summary {
  margin-top: 30px;
  padding: 20px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #fff;
  white-space: pre-line;
  font-family: monospace;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

#order-summary-text {
  font-family: monospace;
  font-size: 1.1em;
  line-height: 1.6em;
  white-space: pre;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#order-summary-title {
  font-size: 1.2rem; /* Change this value to adjust size */
}

#send-email-button {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 18px;
  border-radius: 5px;
  background-color: #444;
  color: white;
  text-decoration: none;
  font-weight: bold;
}

#send-email-button:hover {
  background-color: #222;
}

/* Popups & Modals */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: white;
  padding: 40px;
  max-width: 700px;
  width: 90%;
  border-radius: 6px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  position: relative;
  text-align: center;
}

.popup-close {
  position: absolute;
  top: 5px;
  right: 15px;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
}

.popup-content img {
  max-width: 100%;
  height: auto;
  margin-bottom: 15px;
}

#agb-popup .popup-content,
#impressum-popup .popup-content {
  text-align: left;
}

/* Footer */
footer {
  margin-top: 50px;
  padding: 20px;
  border-top: 1px solid #ccc;
  text-align: center;
  font-size: 0.9em;
  color: #444;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 100px;
  margin-bottom: 25px;
  font-size: 1.1em;
}

.footer-links a {
  text-decoration: none;
  color: #5f162b;
  font-weight: bold;
}

.footer-links a:hover {
  text-decoration: underline;
}


/* Out of stock card styles */
.product.out-of-stock {
  /* Retain normal card styling */
  opacity: 1;
  cursor: pointer;
  background-color: #ffffff;
}

/* Grey out and disable only the quantity buttons */
.product.out-of-stock .quantity-controls button {
  cursor: not-allowed;
  background-color: #ddd;
  color: #888;
  border-color: #ccc;
  opacity: 0.6;
}


#pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 25px 0;
}

#pagination-controls button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
}

#pagination-controls button.active {
  background-color: #444;
  color: white;
  border-color: #444;
}




/* Knowledge Base PDF Cards */
.pdf-card {
  justify-content: space-between;
  gap: 20px;
}

.pdf-icon {
  font-size: 2.2rem;
  margin-right: 15px;
  user-select: none;
}

.pdf-card .product-details {
  flex-grow: 1;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #444;
  color: #ffffff !important;
  border-radius: 4px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.download-btn:hover {
  background-color: #222;
  text-decoration: none;
}


/* PDF Preview Thumbnail */
.pdf-thumbnail {
  width: 143px;
  height: 95px;
  object-fit: cover;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  margin-right: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}
