/*
 Global Stylesheet for Warung Klontong Rakha
 Provides: variables, reset, layout, header, navigation, buttons, cards,
 forms, tables, footer, dropdown, cart, utilities, and responsive rules.
*/

/* ------------------------------
   Variables & Base Reset
------------------------------ */
:root {
  --primary-color: #4caf50;
  --secondary-color: #43a047;
  --accent-color: #ff9800;
  --success-color: #2ecc71;
  --light-gray: #f5f7fa;
  --text-color: #333333;
  --dark-gray: #666666;
  --border-color: #e0e0e0;
  --muted: #999999;
  --white: #ffffff;
  --bg: #f4f4f4;
}

* {
  box-sizing: border-box;
}

html, body {
  padding: 0;
  margin: 0;
  height: 100%; /* Ensure html and body take full height */
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

body {
  background-color: var(--bg);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial,
    sans-serif;
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  color: var(--secondary-color);
}

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

/* ------------------------------
   Header & Navigation
------------------------------ */
header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.logo h1 {
  margin: 0;
  font-size: 22px;
}

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-color);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 16px;
  padding: 0;
  margin: 0;
}

nav a {
  color: var(--text-color);
  padding: 8px 10px;
  border-radius: 6px;
}

nav a:hover {
  background-color: #f1f1f1;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-btn,
.register-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
}

.login-btn {
  background: var(--primary-color);
  color: var(--white);
}

.login-btn:hover {
  background: var(--secondary-color);
}

.register-btn {
  background: #eeeeee;
  color: var(--text-color);
}

.register-btn:hover {
  background: #e0e0e0;
}

.cart-icon {
  color: var(--text-color);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.cart-icon:hover {
  background: #f1f1f1;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--accent-color);
  color: var(--white);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
}

/* Profile dropdown */
.dropdown {
  position: relative;
}

.dropbtn {
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-color);
}

.dropbtn:hover {
  background: #f1f1f1;
}

.dropdown-content {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  display: none;
  overflow: hidden;
  z-index: 200;
}

.dropdown-content a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--text-color);
}

.dropdown-content a:hover {
  background: #f9f9f9;
}

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

/* ------------------------------
   Hero Section
------------------------------ */
.hero {
  background: linear-gradient(135deg, rgba(73, 164, 76, 0.08), rgba(16, 18, 16, 0.08));
  padding: 40px 0;
  background-color:#8cb069;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(190, 178, 178, 0.12);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-content h2 {
  font-size: 28px;
  margin: 0 0 10px;
}

.hero-content p {
  color: var(--dark-gray);
  margin-bottom: 20px;
}

/* ------------------------------
   About Page
------------------------------ */
.about-page {
  padding: 40px 0;
}

.about-intro-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: start;
}

.about-card,
.about-stats,
.about-cta-card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  padding: 24px;
}

.about-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.about-stats .stat-list {
  display: grid;
  gap: 12px;
}

.about-stats .stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
}

.about-why .about-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.about-cta {
  margin-top: 24px;
  text-align: center;
}

@media (max-width: 992px) {
  .about-intro-grid { grid-template-columns: 1fr; }
}

/* ------------------------------
   Contact Page
------------------------------ */
.contact-page { padding: 40px 0; }

.contact-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.contact-info-section,
.contact-form-section {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  padding: 24px;
}

.contact-details { display: grid; gap: 15px; }

.contact-item { display: flex; gap: 12px; align-items: flex-start; }
.contact-item i {
  color: var(--primary-color);
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f1f1;
  border-radius: 8px;
}

.social-links { margin-top: 20px; }
.social-icons { display: flex; gap: 10px; }
.social-icons a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f1f1;
  border-radius: 8px;
  color: var(--text-color);
}
.social-icons a:hover { background: #e9e9e9; color: var(--primary-color); }

.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.contact-note { margin-top: 20px; color: var(--dark-gray); font-size: 0.9rem; }

@media (max-width: 600px) {
  .contact-form .form-row { grid-template-columns: 1fr; }
}

.map-section { padding: 40px 0; }
.map-container { border-radius: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.map-container iframe { width: 100%; height: 380px; border: 0; }

/* FAQ Section */
.faq-section { background-color: var(--light-gray); padding: 60px 0; }
.faq-section h2 { text-align: center; margin-bottom: 40px; color: var(--primary-color); position: relative; padding-bottom: 15px; }
.faq-section h2::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 3px; background-color: var(--accent-color); }
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { background-color: var(--white); border-radius: 8px; margin-bottom: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden; }
.faq-question { padding: 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-question h3 { margin: 0; font-size: 1.1rem; font-weight: 600; color: var(--text-color); }
.faq-toggle { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background-color: var(--light-gray); color: var(--primary-color); transition: all 0.3s ease; }
.faq-question:hover .faq-toggle { background-color: var(--primary-color); color: var(--white); transform: rotate(180deg); }
.faq-answer { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.faq-item.active .faq-answer { padding: 0 20px 20px; max-height: 1000px; }
.faq-item.active .faq-toggle { transform: rotate(180deg); background-color: var(--primary-color); color: var(--white); }

/* ------------------------------
   Buttons
------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--primary-color);
  color: var(--white);
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.2);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.secondary-btn {
  background: #f0f0f0;
  color: var(--text-color);
}

.secondary-btn:hover {
  background: #e0e0e0;
  box-shadow: none;
}

.danger-btn {
  background: #e74c3c;
}

.danger-btn:hover {
  background: #c0392b;
  box-shadow: 0 6px 16px rgba(231, 76, 60, 0.2);
}

/* ------------------------------
   Grid: Categories & Products
------------------------------ */
.categories,
.products,
.feature-cards,
.testimonial-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.category-card,
.product-card,
.feature-card,
.testimonial {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover,
.product-card:hover,
.feature-card:hover,
.testimonial:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.category-card a {
  display: block; 
  padding: 22px;
  text-align: center;
  color: var(--text-color);
  background-color: #4f85b1;
}

.category-card .category-name {
  font-weight: 600;
}

.product-card {
  display: flex;
  flex-direction: column;
}

.product-img {
  position: relative;
  background: #fafafa;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px; /* Changed from right: 10px; */
  background-color: var(--accent-color);
  color: var(--white);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.product-badge.out-of-stock {
  background-color: #e74c3c; /* Red for out of stock */
  color: #FFFFFF;
}

.product-badge.limited-stock {
  background-color: #f39c12; /* Orange for limited stock */
}

.product-info {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.product-info h3 {
  margin: 0;
  font-size: 16px;
}

.product-info .category {
  color: var(--dark-gray);
  font-size: 13px;
}

.price {
  font-weight: 700;
  color: var(--primary-color);
}

.add-to-cart.btn {
  margin-top: 6px;
}

/* Make user product thumbnails smaller in listings */
.products .product-img {
  padding: 10px;
  overflow: hidden; /* Ensure content is clipped */
}

.products .product-img img {
  width: 100%; /* Ensure image fills width */
  height: 100%; /* Ensure image fills height */
  object-fit: cover; /* Changed from contain to cover */
}

/* Homepage sections */
.product-counter {
  text-align: center;
  margin-bottom: 30px;
  font-style: italic;
  color: var(--dark-gray);
}

.info-cards {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 40px 0;
  gap: 20px;
}

.info-card {
  flex: 1;
  min-width: 200px;
  background-color: var(--white);
  padding: 25px 20px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.info-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  color: var(--white);
  font-size: 26px;
}

.testimonials { padding: 60px 0; }

.testimonial-container { margin-top: 30px; }

.testimonial-content { padding: 30px; position: relative; }

.quote {
  color: var(--primary-color);
  font-size: 24px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.testimonial-content p {
  font-style: italic;
  line-height: 1.6;
}

.testimonial-author {
  display: flex;
  align-items: center;
  padding: 15px 30px;
  background-color: #f9f9f9;
  border-top: 1px solid var(--border-color);
}

.author-avatar {
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: var(--white);
  font-size: 20px;
}

.author-info h4 { margin: 0 0 5px; color: var(--text-color); }
.stars { color: var(--accent-color); font-size: 14px; }

.promo-section { padding: 60px 0; background-color: #f8f8f8; }
.promo-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.promo-content h2 { text-align: center; margin-bottom: 40px; color: #333; font-size: 28px; font-weight: 600; }

/* ------------------------------
   Forms
------------------------------ */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dddddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background: var(--white);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}

/* ------------------------------
   Tables (Admin & Lists)
------------------------------ */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
}

th {
  background: #f8f9fa;
  font-weight: 700;
}

.admin-table {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.action-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--white);
}

.view-btn { background: #3498db; }
.edit-btn { background: #2ecc71; }
.delete-btn { background: #e74c3c; }

.related-products .products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

/* ------------------------------
   Alerts & Messages
------------------------------ */
.error,
.success,
.message {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 10px 0;
}

.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.message { background: #e7f3fe; color: #0c5460; border: 1px solid #bee5eb; }

/* ------------------------------
   Footer
------------------------------ */
footer {
  background: var(--white);
  border-top: 1px solid var(--border-color);
}

footer .container {
  padding: 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 10px;
}

.footer-section h3 {
  margin-top: 0;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.footer-bottom {
  text-align: center;
  color: var(--dark-gray);
  padding: 10px 0;
}

/* ------------------------------
   Checkout & Cart helpers
------------------------------ */
.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e9ecef;
  border-radius: 6px;
}

.quantity-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border: none;
  cursor: pointer;
}

.quantity-input {
  width: 44px;
  height: 32px;
  border: none;
  text-align: center;
  font-weight: 600;
}

/* ------------------------------
   Profile Page
------------------------------ */
.profile-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 20px;
}

.profile-topics a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 20px;
  color: var(--text-color);
  font-size: 14px;
}

.profile-topics a:hover {
  background: #ebebeb;
}

.profile-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

.profile-sidebar .profile-header {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  padding: 20px;
  text-align: center;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  background: #f1f1f1;
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.profile-nav {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.profile-nav li a {
  display: block;
  padding: 10px 12px;
  color: var(--text-color);
  border-radius: 8px;
}

.profile-nav li a:hover,
.profile-nav li.active a {
  background: #f5f5f5;
}

.profile-content .profile-section {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  padding: 20px;
  margin-bottom: 16px;
}

@media (max-width: 992px) {
  .profile-container {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    margin-bottom: 20px;
  }

  .profile-menu {
    flex-direction: row; /* Make menu items horizontal on smaller screens */
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px; /* Add padding for scrollbar */
  }
}

/* ------------------------------
   Auth (Login/Register)
------------------------------ */
.user-login-container,
.admin-login-container {
  background: var(--white);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
  margin: 50px auto;
}

.user-login-logo h1,
.admin-login-logo h1 { color: var(--primary-color); font-size: 24px; }

.back-to-site { color: #666; display: block; text-align: center; margin-top: 15px; }

.password-input-wrapper { position: relative; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #666; z-index: 10; }
.password-toggle:hover { color: var(--primary-color); }

/* Reset Password Page Styles */
.reset-password-container {
  background: white;
  padding: 30px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
  margin: 0 auto; /* Adjust to 0 auto, centering will be handled by body flex */
  box-sizing: border-box; /* Ensure padding is included in the width */
}

body.reset-password-page {
  background-color: #f4f4f4;
  display: flex;
  flex-direction: column; /* Allow content to stack vertically */
  justify-content: center;
  align-items: center;
  min-height: 100vh; /* Use min-height for better flexibility */
  margin: 0;
  font-family: Arial, sans-serif;
}

.reset-password-container h2 {
  text-align: center;
  color: #333;
  margin-top: 0; /* Reset top margin for h2 */
  margin-bottom: 20px;
}

.reset-password-logo {
  text-align: center;
  margin-bottom: 20px;
}

.reset-password-logo h1 {
  color: var(--primary-color);
  font-size: 24px;
  margin-top: 0; /* Reset top margin for h1 */
  margin-bottom: 5px; /* Adjust bottom margin for h1 */
}

.reset-password-logo p {
  margin-top: 0; /* Reset top margin for p */
  margin-bottom: 0; /* Reset bottom margin for p */
}

.reset-password-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}

.reset-password-footer a {
  color: var(--primary-color);
  text-decoration: none;
}

.reset-password-footer a:hover {
  text-decoration: underline;
}

.password-strength {
  margin-top: 5px;
  font-size: 12px;
}

.password-strength-meter {
  height: 5px;
  background-color: #eee;
  margin-top: 5px;
  border-radius: 3px;
  overflow: hidden;
}

.password-strength-meter div {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.strength-weak {
  background-color: #e74c3c;
  width: 25%;
}

.strength-medium {
  background-color: #f39c12;
  width: 50%;
}

.strength-strong {
  background-color: #3498db;
  width: 75%;
}

.strength-very-strong {
  background-color: #2ecc71;
  width: 100%;
}

@media (max-width: 480px) {
  .reset-password-container {
    margin: 20px;
    padding: 20px;
  }
  .reset-password-logo h1 { font-size: 20px; }
  .reset-password-container h2 { font-size: 24px; }
}

/* ------------------------------
   Utilities
------------------------------ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ------------------------------
   Responsive
------------------------------ */
@media (max-width: 992px) {
  header .container {
    gap: 10px;
  }

  .hamburger-menu {
    display: block; /* Show hamburger on smaller screens */
    order: 2; /* Position after logo */
  }

  header .container .logo {
    order: 1;
  }

  header .container .user-actions {
    order: 3;
  }

  nav#mainNav {
    display: none; /* Hide main nav by default on mobile */
    position: absolute;
    top: 60px; /* Adjust based on header height */
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 20px;
    border-top: 1px solid var(--border-color);
  }

  nav#mainNav.show-mobile-nav {
    display: flex; /* Show nav when active */
  }

  nav#mainNav ul {
    flex-direction: column;
    width: 100%;
  }

  nav#mainNav li {
    width: 100%;
  }

  nav#mainNav a {
    padding: 12px 10px;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #eee;
  }

  nav#mainNav li:last-child a {
    border-bottom: none;
  }
}

/* Confirmation Modal Styles */
.confirmation-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.confirmation-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.confirmation-modal-content {
  background-color: var(--white);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 400px;
  width: 90%;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.confirmation-modal-overlay.show .confirmation-modal-content {
  transform: translateY(0);
}

.confirmation-modal-content p {
  font-size: 1.1rem;
  margin-bottom: 25px;
  color: var(--text-color);
}

.confirmation-modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

@media (max-width: 768px) {
  nav ul {
    gap: 8px;
  }

  .hero-content h2 {
    font-size: 22px;
  }

  /* Adjust grid columns for medium screens */
  .categories, .products, .feature-cards, .testimonial-container, .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
  }

  .info-cards { flex-direction: column; }
  .testimonial { width: 100%; }

  /* Product Detail Page Responsiveness */
  .product-container {
    flex-direction: column;
    gap: 20px;
  }

  .product-image,
  .product-info-detail {
    width: 100%;
  }

  .product-features {
    flex-direction: column;
  }

  .product-detail .quantity .quantity-selector {
    width: 100%;
    justify-content: center;
  }

  /* Responsive tables */
  .table-responsive table {
    width: 700px; /* Set a minimum width for scrolling */
  }
}

@media (max-width: 576px) {
  .login-btn, .register-btn { padding: 8px 10px; }
  .btn { padding: 10px 12px; }

  /* Adjust grid columns for small screens */
  .categories, .products, .feature-cards, .testimonial-container, .footer-content {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-info { padding: 12px; }
  .product-info h3 { font-size: 15px; }
  .price { font-size: 1.1em; }

  .product-detail .breadcrumb { font-size: 0.85rem; }
  .product-info-detail h1 { font-size: 24px; }

  .profile-topics {
    flex-wrap: wrap; /* Allow topics to wrap on smaller screens */
    justify-content: center;
  }

  .profile-topics a {
    padding: 6px 10px;
    font-size: 13px;
  }

  .profile-section h2 {
    font-size: 20px;
  }

  .profile-form .form-group label {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }
}

/* ------------------------------
   Product Detail Page (Specific)
------------------------------ */
.product-detail {
  padding: 40px 0;
}

.product-detail .breadcrumb {
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--dark-gray);
}

.product-detail .breadcrumb a {
  color: var(--muted);
}

.product-detail .breadcrumb a:hover {
  color: var(--primary-color);
}

.product-container {
  display: flex;
  gap: 30px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  padding: 30px;
  margin-bottom: 40px;
}

.product-image {
  flex: 1;
  max-width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.image-container {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect Ratio (3/4 = 0.75 = 75%) */
  overflow: hidden;
  border-radius: 8px;
  background-color: #f8f8f8;
}

.image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.image-container:hover img {
  transform: scale(1.05);
}

.product-image .product-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--accent-color);
  color: var(--white);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-image .product-badge[style*="background-color: #f44336;"] {
  background-color: #f44336 !important;
}

.product-info-detail {
  flex: 1;
  max-width: 50%;
}

.product-info-detail h1 {
  font-size: 32px;
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--text-color);
}

.product-info-detail .category {
  font-size: 15px;
  color: var(--dark-gray);
  margin-bottom: 15px;
}

.product-info-detail .category i {
  color: var(--primary-color);
  margin-right: 5px;
}

.product-info-detail .category a {
  color: var(--dark-gray);
  text-decoration: underline;
}

.product-info-detail .category a:hover {
  color: var(--primary-color);
}

.product-info-detail .price {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.stock-info {
  font-size: 15px;
  margin-bottom: 20px;
}

.stock-info .in-stock {
  color: var(--success-color);
  font-weight: 600;
}

.stock-info .out-of-stock {
  color: #e74c3c;
  font-weight: 600;
}

.add-to-cart-form .quantity {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.add-to-cart-form .quantity label {
  font-weight: 600;
  color: var(--text-color);
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.quantity-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f1f1;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 16px;
  color: var(--dark-gray);
}

.quantity-btn:hover {
  background-color: #ddd;
}

.quantity input[type="number"] {
  width: 60px;
  height: 40px;
  border: none;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  appearance: textfield; /* Firefox */
}

.quantity input[type="number"]::-webkit-outer-spin-button,
.quantity input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.add-to-cart-form .btn {
  width: auto;
  padding: 12px 20px;
  font-size: 16px;
}

.product-description {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid var(--border-color);
}

.product-description h3 {
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--text-color);
}

.product-description p {
  line-height: 1.7;
  color: var(--dark-gray);
}

.product-description .no-description {
  font-style: italic;
  color: var(--muted);
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid var(--border-color);
}

.feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-color);
}

.feature i {
  color: var(--primary-color);
  font-size: 22px;
}

.related-products {
  margin-top: 60px;
}

.related-products h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 28px;
  color: var(--text-color);
}

.profile-page .profile-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

.profile-page .profile-sidebar .profile-header {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    padding: 20px;
    text-align: center;
}

.profile-page .profile-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 8px;
    background: #f1f1f1;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.profile-page .profile-content .profile-section {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 16px;
}

.profile-page .profile-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 20px;
}

.profile-page .profile-topics a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 20px;
    color: var(--text-color);
    font-size: 14px;
}

.profile-page .profile-topics a:hover {
    background: #ebebeb;
}

.profile-page .profile-sidebar {
    margin-bottom: 20px;
}

.profile-page .profile-menu {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

.profile-page .profile-menu a {
    display: block;
    padding: 10px 12px;
    color: var(--text-color);
    border-radius: 8px;
}

.profile-page .profile-menu a:hover,
.profile-page .profile-menu .active a {
    background: #f5f5f5;
}

.profile-page .profile-form .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-page .form-actions {
    margin-top: 20px;
}

@media (max-width: 992px) {
    .profile-page .profile-container {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }

    .profile-page .profile-sidebar {
        order: 2; /* Move sidebar below main content on mobile */
    }

    .profile-page .profile-content {
        order: 1;
    }

    .profile-page .profile-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 10px;
        background-color: var(--white);
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    .profile-page .profile-menu li {
        flex-grow: 1;
        text-align: center;
    }

    .profile-page .profile-menu a {
        padding: 8px 12px;
        font-size: 14px;
    }

    .profile-page .profile-topics {
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .profile-page h1 {
        font-size: 24px;
    }

    .profile-page .profile-header .profile-name { font-size: 1.1rem; }
    .profile-page .profile-header .profile-email { font-size: 0.9rem; }

    .profile-page .profile-section h2, .profile-page .profile-section h3 {
        font-size: 1.2rem;
    }

    .profile-page .form-group label {
        font-size: 0.9rem;
    }
}

/* Admin Forms Styling */
.admin-form {
    background-color: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-form .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.admin-form .form-group.half {
    flex: 1;
}

.admin-form .form-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.admin-form .form-actions .btn {
    width: auto; /* Override full width from general .btn */
}

/* Admin Content Box */
.admin-content-box {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto; /* For tables */
}

/* Responsive adjustments for admin forms */
@media (max-width: 768px) {
    .admin-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .admin-form .form-group.half {
        flex: none;
        width: 100%;
    }

    .admin-form .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .admin-form .form-actions .btn {
        width: 100%;
    }
}


