.back-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 2px 5px;
  font-size: 0.9rem;
  margin-right: 10px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.back-btn:hover {
  color: white;
}

:root {
  --primary-color: #131921;
  --secondary-color: #232f3e;
  --accent-color: #febd69;
  --text-color: #333;
  --light-gray: #f5f5f5;
  --border-color: #ddd;
  --nav-height: 80px;
}

@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  body {
    margin: var(--nav-height) 0 0 0;
    font-size: 13px;
  }

  .top-nav {
    padding: 10px;
    height: var(--nav-height);
  }

  .logo-img {
    height: 40px;
  }

  .search-bar {
    max-width: none;
  }

  .department-bar {
    position: static;
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 10px;
    gap: 10px;
    top: calc(var(--nav-height) + 56px);
  }

  .container {
    margin-left: 0;
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .product-card img {
    height: 150px;
  }

  .banner-slider {
    height: 200px;
  }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 15px;
  }

  .nav-right {
    display: none;
  }

  dialog {
    width: 90%;
    max-width: none;
  }

  .cart-item {
    flex-wrap: wrap;
    gap: 5px;
  }

  .cart-item input[type="number"] {
    width: 40px;
  }
}

body {
  margin: var(--nav-height) 0 0 0;
  padding-top: 10px;
  font-family: Arial, sans-serif;
  background-color: var(--light-gray);
  font-size: 14px;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

.product-info p, .cart-item span {
  font-size: 0.8rem;
}

.top-nav {
  background-color: var(--primary-color);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  color: white;
  height: var(--nav-height);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.menu-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0 15px;
  display: flex;
  align-items: center;
  position: relative;
  margin-right: auto;
}

.side-nav {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--primary-color);
  transition: transform 0.3s ease;
  z-index: 1001;
  padding: 20px;
  color: white;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(0);
}

.side-nav.open {
  transform: translateX(-280px);
}

.side-nav.open {
  right: 0;
  box-shadow: -5px 0 15px rgba(0,0,0,0.3);
}

.menu-categories {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.menu-categories a {
  color: white;
  text-decoration: none;
  padding: 10px;
  border-radius: 4px;
  transition: background 0.2s;
}

.menu-categories a:hover {
  background: var(--secondary-color);
}

.menu-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9em;
}

.side-nav.open {
  right: 0;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 1000;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

.logo {
  margin-left: 30px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  height: 100%;
}

.logo-img {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.search-container {
  position: fixed;
  left: 20px;
  top: calc(var(--nav-height) + 50px);
  z-index: 1000;
}

.search-bar {
  display: none;
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  padding: 2px;
}

.search-bar.show {
  display: flex;
}

.find-btn {
  background: var(--accent-color);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: opacity 0.3s ease;
  opacity: 1;
  z-index: 1001;
}

.search-bar input {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 4px 0 0 4px;
}

.search-button {
  padding: 8px 15px;
  background-color: var(--accent-color);
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-right: 20px;
}

.account {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  position: relative;
}

.account-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 200px;
  display: none;
  z-index: 1000;
}

.account-dropdown.show {
  display: block;
}

.account-dropdown a {
  display: block;
  padding: 12px 15px;
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
}

.account-dropdown a:hover {
  background: var(--light-gray);
}

.account-icon {
  margin-right: 8px;
  opacity: 0.7;
}

.cart {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.cart-count {
  background-color: var(--accent-color);
  padding: 2px 6px;
  border-radius: 50%;
  color: var(--primary-color);
}

.banner-slider {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  background: #eaeaea;
  margin: 60px 0 20px;
  border: 1px solid #ddd;
}

.slides {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
  width: 100%;
}

.slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 16px;
  cursor: pointer;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prev { left: 10px; }
.next { right: 10px; }

.main-content {
  display: flex;
  margin-top: 20px;
}

.department-bar {
  background-color: var(--secondary-color);
  padding: 10px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  position: fixed;
  left: 0;
  right: 0;
  top: var(--nav-height);
  z-index: 999;
  overflow-x: auto;
  white-space: nowrap;
}

.department-bar a, .department-bar button {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px;
  text-align: left;
  transition: background-color 0.2s;
  border-radius: 3px;
  font-size: 0.85rem;
  letter-spacing: -0.2px;
}

.department-bar button:hover,
.department-bar button.active {
  background-color: rgba(255, 255, 255, 0.15);
}

.container {
  margin: 20px auto 280px;
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

.product-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  position: relative;
}

.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #cc0c39;
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

.product-info {
  padding: 10px 0;
}

.price {
  margin: 10px 0;
}

.current-price {
  font-size: 1rem;
  font-weight: bold;
}

.original-price {
  text-decoration: line-through;
  color: #666;
  margin-left: 10px;
}

.rating {
  color: #ff9900;
  margin-bottom: 10px;
}

button {
  width: 100%;
  padding: 8px;
  background-color: var(--accent-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.product-card button:hover {
  opacity: 0.9;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

footer {
  background-color: var(--primary-color);
  color: white;
  padding: 6px 0;
  position: fixed;
  width: 100%;
  bottom: 0;
  left: 0;
  z-index: 999;
  font-size: 0.75rem;
  line-height: 1.2;
  height: calc(1.2em * 4 + 12px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.footer-content {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 0 auto;
  max-width: 1200px;
  height: calc(1.2em * 3);
  overflow: hidden;
}

.footer-section h4 {
  margin-bottom: 2px;
  font-size: 0.75rem;
  font-weight: normal;
  color: #fff;
}

.footer-section a {
  display: block;
  color: #aaa;
  text-decoration: none;
  margin-bottom: 1px;
}

.footer-bottom {
  text-align: center;
  padding-top: 2px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.65rem;
  color: #999;
  height: 1.2em;
}

.cart-dropdown {
  position: fixed;
  top: var(--nav-height);
  right: 20px;
  width: 320px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
  z-index: 1001;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.cart-dropdown.show {
  display: block;
}

.cart-header {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  padding: 10px;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 3px;
  margin-right: 12px;
}

.item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.item-name {
  font-weight: 500;
}

.item-price {
  color: #666;
  font-size: 0.9em;
  text-align: right;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="number"] {
  width: 90px;
  height: 30px;
  text-align: center;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
}

.quantity-btn:hover {
  opacity: 0.9;
}

.cart-footer {
  padding: 15px;
  border-top: 1px solid var(--border-color);
  background: white;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 500;
}

dialog article {
  padding: 15px;
  max-height: calc(80vh - 30px);
  overflow-y: auto;
}

#cartItems {
  margin: 10px 0;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(221, 221, 221, 0.3);
  font-size: 0.9rem;
}

.cart-item input[type="number"] {
  width: 50px;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

button.primary {
  background-color: var(--accent-color);
  color: var(--primary-color);
  font-weight: bold;
}

.notifications-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  z-index: 1000;
}

.notification {
  background-color: var(--accent-color);
  color: var(--primary-color);
  padding: 15px 25px;
  border-radius: 4px;
  animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
  from { 
    transform: translateY(100%);
    opacity: 0;
  }
  to { 
    transform: translateY(0);
    opacity: 1;
  }
}

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px;
  background: white;
  border-radius: 8px;
  margin: 20px 0;
}

.product-images {
  position: relative;
  overflow: visible; /* Added to allow zoom container to overflow */
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.zoom-container {
  position: absolute;
  top: 0;
  left: 100%;
  width: 400px;
  height: 400px;
  margin-left: 20px;
  border: 1px solid #ddd;
  overflow: hidden;
  display: none;
  background-color: white;
  z-index: 1000;
}

.main-product-image {
  width: 100%;
  border-radius: 8px;
  height: 400px;
  object-fit: cover;
  cursor: crosshair;
  transition: transform 0.1s ease-out;
}

.thumbnail-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 5px;
}

.thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.thumbnail.active {
  border-color: var(--accent-color);
}

.product-info-detail {
  padding: 20px;
}

.product-link {
  text-decoration: none;
  color: inherit;
}


.remove-btn {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  background: rgba(255, 68, 68, 0.9);
  color: white;
  cursor: pointer;
}

.remove-btn:hover {
  background: #cc0000;
}

.payment-page {
  max-width: 600px;
  margin: 40px auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.email-collection {
  margin-bottom: 20px;
}

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

.form-group input[type="email"] {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  color: #666;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.payment-methods button {
  padding: 15px;
  font-size: 1rem;
}

.card-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

#cardForm {
  margin-top: 20px;
}

#cardForm input {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.order-summary {
  margin-bottom: 20px;
  padding: 15px;
  background: var(--light-gray);
  border-radius: 4px;
}
.success-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.success-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.success-header {
    text-align: center;
    margin-bottom: 30px;
}

.success-header h1 {
    color: #2ecc71;
    margin-bottom: 10px;
}

.order-id {
    color: #666;
    font-size: 1.1em;
}

.order-details {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.next-steps {
    margin: 30px 0;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 8px;
}

.next-steps ul {
    list-style-type: none;
    padding: 0;
}

.order-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: var(--light-gray);
    font-weight: 500;
}

.order-items {
    padding: 15px;
}

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

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--light-gray);
}

.order-status {
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--accent-color);
    color: var(--primary-color);
    font-size: 0.9em;
}

.next-steps li {
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
}

.next-steps li:before {
    content: "✓";
    color: #2ecc71;
    position: absolute;
    left: 0;
}

.success-actions {
    text-align: center;
    margin-top: 30px;
}

.continue-shopping {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.continue-shopping:hover {
    opacity: 0.9;
}

.error-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.error-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.error-header {
    text-align: center;
    margin-bottom: 30px;
}

.error-header h1 {
    color: #e74c3c;
    margin-bottom: 10px;
}

.error-message {
    color: #666;
    font-size: 1.1em;
}

.error-details {
    margin: 30px 0;
    padding: 20px;
    background: #fff5f5;
    border-radius: 8px;
}

.error-details ul {
    list-style-type: none;
    padding: 0;
}

.error-details li {
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
}

.error-details li:before {
    content: "!";
    color: #e74c3c;
    position: absolute;
    left: 0;
}

.error-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.retry-payment {
    display: inline-block;
    padding: 12px 24px;
    background: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.retry-payment:hover {
    opacity: 0.9;
}

/* Added auth styles */
.auth-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
}

.password-strength {
  margin-top: 5px;
  padding: 5px;
  font-size: 0.9em;
}

.strength-1 { color: #ff0000; }
.strength-2 { color: #ff6600; }
.strength-3 { color: #ffcc00; }
.strength-4 { color: #99cc00; }
.strength-5 { color: #00cc00; }

.auth-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.auth-form button {
    width: 100%;
    padding: 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.social-login {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    background: white;
    color: #333;
    transition: all 0.2s;
    font-size: 14px;
}

.social-btn:hover {
    background: #f5f5f5;
}

.social-btn.google {
    border-color: #4285f4;
}

.social-btn.facebook {
    border-color: #3b5998;
}

.auth-form p {
    text-align: center;
    margin-top: 15px;
}

<script>
  const mainImage = document.querySelector('.main-product-image');
  const zoomContainer = document.querySelector('.zoom-container');
  let zoomImage = null;

  mainImage.addEventListener('mousemove', (e) => {
    const rect = mainImage.getBoundingClientRect();
    const x = e.clientX - rect.left;
    const y = e.clientY - rect.top;

    const zoomX = x / rect.width * 100;
    const zoomY = y / rect.height * 100;

    zoomContainer.style.display = 'block';
    if(!zoomImage){
        zoomImage = document.createElement('img');
        zoomImage.src = mainImage.src;
        zoomImage.style.width = '100%';
        zoomImage.style.height = '100%';
        zoomImage.style.objectFit = 'contain';
        zoomContainer.appendChild(zoomImage);
    }

    zoomImage.style.transform = `translate(-${zoomX}%, -${zoomY}%) scale(2)`;


  });

  mainImage.addEventListener('mouseout', () => {
    zoomContainer.style.display = 'none';
  });

</script>