/* Reset Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9f9f9;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Page Wrapper for sticky footer */
.page-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
}

main {
  flex: 1; /* Ensures main takes available space */
}

/* Loader Spinner */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 5px solid #ddd;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Hide Main Content Initially */
.hidden {
  display: none;
}

/* Header Styling */
.site-header {
  background-color: #fff;
  padding: 20px 40px;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.site-header .site-logo {
  height: 50px;
}

.site-header .site-title {
  font-size: 26px;
  font-weight: bold;
  color: #222;
}

.site-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: 12px; /* ✅ spacing from logo only */
}

.site-subtitle {
  font-size: 14px;
  color: #555;
  margin-top: 4px; /* ✅ add vertical spacing if needed */
}

.site-subtitle span:first-child {
  text-transform: uppercase;
}

/* Footer Styling */
.site-footer {
  background-color: #fff;
  padding: 20px 40px;
  border-top: 1px solid #ddd;
  text-align: center;
  font-size: 14px;
  color: #666;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

/* Product Card with Elevation */
.product-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  padding: 30px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.product-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Product Layout */
.product-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* Image Slider */
.product-slider {
  flex: 1;
  max-width: 500px;
}

.swiper {
  width: 100%;
  aspect-ratio: 4 / 5; /* Portrait aspect ratio */
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
}

.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.swiper-slide img:hover {
  transform: scale(1.05);
}

/* Pagination Dots */
.swiper-pagination {
  bottom: 10px !important;
}

/* Product Details Section */
.product-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-details h1 {
  font-size: 30px;
  color: #222;
}

.product-details p {
  font-size: 16px;
  line-height: 1.6;
  color: #555;
}

.product-details .price {
  font-size: 24px;
  color: #e53935;
  font-weight: bold;
  margin-top: 5px;
}

/* Responsive Design */

/* Tablets */
@media (max-width: 992px) {
  .product-layout {
    gap: 30px;
  }

  .product-card {
    padding: 20px;
  }
}

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

  .product-slider {
    max-width: 100%;
  }

  .product-details h1 {
    font-size: 24px;
  }

  .product-details .price {
    font-size: 20px;
  }

  /* Header stays left-aligned */
  .site-header {
    padding: 15px 20px;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
  }

  .site-header .site-logo {
    height: 40px;
  }

  .site-header .site-title {
    margin-left: 10px;
    font-size: 22px;
  }

  /* Footer stays centered */
  .site-footer {
    padding: 15px 20px;
    text-align: center;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .product-details h1 {
    font-size: 20px;
  }

  .product-details .price {
    font-size: 18px;
  }

  .site-header .site-title {
    font-size: 20px;
  }
}

#product-list {
  display: flex;
  flex-direction: column;
  gap: 20px; /* ✅ Uniform gap between cards */
}

.qty-input,
.rate-input {
  width: 120px;
  padding: 10px 14px;
  
  border: 1.5px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: #fff;
  color: #333;
}

.qty-input:focus,
.rate-input:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.form-field {
  display: flex;
  flex-direction: column;
  width: 220px; /* 🔼 Increased width */
  max-width: 100%;
  margin-top: 14px;
}

.form-field label {
  font-size: 14px;
  margin-bottom: 6px;
  color: #444;
  font-weight: 500;
}

.modern-input:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.modern-input-note:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.note-input {
  width: 100%;
  resize: vertical;
  padding: 12px 16px;
  font-size: 15px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  color: #333;
  box-sizing: border-box;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.place-order-btn {
  padding: 12px 24px;
  font-size: 14px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.place-order-btn:hover {
  background-color: #43a047;
  transform: translateY(-1px);
}

.place-order-btn:active {
  background-color: #388e3c;
  transform: scale(0.98);
}

.modern-input {
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  max-width: 80px;
  box-sizing: border-box;
  background-color: #fff;
  color: #333;
  margin-bottom: 4px; /* 🔽 Reduced from 6px to 4px */
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.modern-input-note {
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  background-color: #fff;
  color: #333;
  margin-bottom: 4px; /* 🔽 Reduced from 6px to 4px */
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Error Message Styling (reused for all fields) */
.error-message {
  color: red;
  font-size: 13px;
  margin-bottom: 8px; /* Optional: adds spacing before next field */
  display: none;
}

.add-item-catelog-btn {
  margin-left: auto;
  padding: 12px 24px;
  font-size: 14px;
  background-color: #9C27B0;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.add-item-catelog-btn:hover {
  background-color: #512DA8;
}

.add-item-btn {
  margin-left: auto;
  padding: 12px 24px;
  font-size: 14px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.add-item-btn:hover {
  background-color: #0056b3;
}

#qr-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
}

.qr-modal {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  width: 90vw;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* QR Scanner Container */
#qr-reader {
  width: 100% !important;
  height: auto !important;
  max-height: 320px;
  margin-bottom: 10px;
  border-radius: 8px;
  overflow: hidden;
}

#qr-reader video {
  width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
  aspect-ratio: 1 / 1 !important;  /* ✅ Make video square */
  border-radius: 12px;
}

/* Hide QR internal controls */
#qr-reader__camera_selection,
#qr-reader__dashboard_section_swaplink {
  display: none !important;
}

#qr-close-btn {
  padding: 10px;
  background-color: #f44336;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

.custom-dialog-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-dialog {
  background: white;
  padding: 24px 28px;
  border-radius: 10px;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.custom-dialog h2 {
  margin-bottom: 10px;
  font-size: 20px;
  color: #333;
}

.custom-dialog p {
  font-size: 15px;
  margin-bottom: 18px;
  color: #555;
}

.custom-dialog button {
  padding: 10px 20px;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
}

#order-summary {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #ddd;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 16px;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
  flex-direction: row;
}

/* Left Section */
.summary-left {
  display: flex;
  gap: 20px;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
}

/* Right Section */
.summary-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Responsive tweaks for summary */
@media (max-width: 768px) {
  #order-summary {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .summary-left,
  .summary-right {
    justify-content: center;
    width: 100%;
    margin-bottom: 10px;
  }

  .summary-right > button {
    flex: 1;                /* Make each button grow equally */
    min-width: 0;           /* Allow shrink */
    padding: 12px;     /* Optional: better touch target */
  }

  /* .add-item-catelog-btn,.place-order-btn,
  .add-item-btn, .show-item-btn {
    width: 20%;
    max-width: 300px;
  } */
}


.show-item-btn {
  margin-left: auto;
  padding: 12px 24px;
  font-size: 14px;
  background-color: #d32f2f;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.show-item-btn:hover {
  background-color: #d32f2f;
}

.product-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.product-title-row h1 {
  font-size: 20px;
  color: #222;
  margin: 0;
  flex: 1;
}

.delete-button {
  padding: 8px 16px;
  background-color: #e53935;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.delete-button:hover {
  background-color: #c62828;
  transform: translateY(-1px);
}

.delete-button:active {
  background-color: #b71c1c;
  transform: scale(0.97);
}

.custom-file-button.full-width {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  background-color: #f9f9f9;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  box-sizing: border-box;
  color: #333;
  text-align: left;
}

.custom-file-button.full-width:hover {
  background-color: #f1f1f1;
  border-color: #aaa;
}

.file-name-display {
  margin-top: 6px;
  font-size: 14px;
  color: #555;
  overflow-wrap: anywhere;
}

