/* Base reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .product-list {
    flex-direction: column;
  }
}

/* Floating Dark Mode Toggle */
.theme-toggle-floating {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 6px 10px;
  border-radius: 25px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1000;
}

/* Partner Branding Section (Footer Logos and Tagline) */
.partner-branding {
  text-align: center;
  margin: 40px 0 20px;
  padding-top: 10px;
  border-top: 1px solid #ccc;
}

.footer-logo {
  height: 50px;
  margin: 0 10px;
  vertical-align: middle;
  object-fit: contain;
}

.partner-branding .tagline {
  font-size: 0.95rem;
  color: #444;
  margin-top: 10px;
  font-style: italic;
}

footer {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  padding-bottom: 40px;
}

.bottom-checkout-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #ddd;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  z-index: 9999;
}

.bottom-checkout-bar .checkout-total {
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
}

.bottom-checkout-bar button {
  background-color: #28a745;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bottom-checkout-bar button:hover {
  background-color: #218838;
}

.bottom-checkout-bar.hide-bar {
  transform: translateY(100%);
}

body.dark-mode .bottom-checkout-bar {
  background-color: #1e1e1e;
  border-top: 1px solid #444;
}

.cart-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px;
}

.cart-controls button {
  background-color: #ddd;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.cart-controls button:hover {
  background-color: #bbb;
}

.item-total {
  margin-left: 10px;
  font-weight: bold;
}

body.dark-mode .theme-toggle-floating {
  background-color: rgba(30, 30, 30, 0.95);
  color: #fff;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.toggle-label {
  font-size: 0.9rem;
  color: #555;
}

.checkout-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.checkout-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  border: 4px solid #ccc;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.9s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Remove Button */
.remove-btn {
  margin-left: 10px;
  background: none;
  border: none;
  color: #dc3545;
  font-size: 1rem;
  cursor: pointer;
}

.remove-btn:hover {
  color: #a71d2a;
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode header,
body.dark-mode .product,
body.dark-mode #customer-info,
body.dark-mode footer,
body.dark-mode .cart-drawer {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark-mode .product button,
body.dark-mode button,
body.dark-mode .button {
  background-color: #0a84ff;
}

body.dark-mode .product button:hover,
body.dark-mode button:hover,
body.dark-mode .button:hover {
  background-color: #006edc;
}

/* Body and layout */
body {
  background: radial-gradient(circle at center, #ffffff 0%, #f4f8fb 100%);
}

/* Centering container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header styling */
header {
  text-align: center;
  margin-bottom: 30px;
}

/* Animated Add to Cart Button */
button.added {
  animation: pulse 0.3s;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.logo {
  max-width: 400px;
  margin: 0 auto 15px;
  display: block;
}

h1 {
  font-size: 2.5rem;
  color: #007bff;
}

h2 {
  font-size: 1.5rem;
  color: #555;
  margin-top: 10px;
}

/* Cart preview bubble */
#cart-preview {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #28a745;
  color: white;
  padding: 10px 15px;
  border-radius: 25px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#cart-preview:hover {
  background-color: #218838;
}

#customer-notes {
  display: block;
  margin: 20px auto;
  padding: 12px;
  width: 90%;
  max-width: 500px;
  height: 100px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

/* Products */
#products h3 {
  font-size: 1.8rem;
  color: #007bff;
  text-align: center;
  margin-bottom: 20px;
}

.product-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.product {
  background: linear-gradient(to bottom right, #ffffff, #f2f6fc);
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  width: 300px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.product:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: #007bff;
}

.product h4 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.product p {
  margin-bottom: 10px;
  color: #555;
}

.product input[type="number"] {
  width: 60px;
  margin-bottom: 10px;
  padding: 6px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.product button {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.product button:hover {
  background-color: #218838;
}

/* Slide-in Cart Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  height: 100%;
  background-color: white;
  box-shadow: -2px 0 10px rgba(0,0,0,0.15);
  padding: 20px;
  z-index: 2000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #007bff;
}

.close-drawer {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #333;
}

.cart-drawer ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  flex-grow: 1;
  overflow-y: auto;
}

.cart-drawer li {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.cart-total {
  font-weight: bold;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

/* Customer Info & Cart */
#customer-info,
#cart {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  margin-top: 40px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

#customer-info h3,
#cart h3 {
  text-align: center;
  color: #007bff;
  margin-bottom: 20px;
}

#customer-info input,
#cart input {
  display: block;
  margin: 10px auto;
  padding: 10px;
  width: 90%;
  max-width: 400px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

/* Cart items */
#cart-items {
  list-style: none;
  padding-left: 0;
  margin-bottom: 10px;
}

#cart-items li {
  margin-bottom: 6px;
}

#total-price {
  font-weight: bold;
  font-size: 1.1rem;
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 9999;
}

/* Fix hover state */
button:hover {
  background-color: #0056b3;
}
