/* Premium Shopping UI */
:root {
  --primary-green: #2ecc71;
  --primary-green-dark: #27ae60;
  --text-dark: #2d3436;
  --text-gray: #636e72;
  --bg-light: #f8f9fa;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.product-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.product-image {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  margin-bottom: 15px;
  background: #fff;
}

.product-category {
  font-size: 0.8rem;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 5px 0;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}

.btn-cart {
  background-color: var(--primary-green);
  color: #fff !important;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  width: 100%;
  transition: background 0.2s;
}

.btn-cart:hover {
  background-color: var(--primary-green-dark);
}

/* Side Cart Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: #fff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  transition: right 0.3s cubic-bezier(0.7, 0, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  right: 0;
}

.cart-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  background: #fafafa;
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  display: none;
}

.cart-overlay.show {
  display: block;
}

/* Footer Enhancements */
.footer {
  background: #fff;
  color: #2d3436;
  font-size: 0.95rem;
}

.footer h5 {
  font-weight: 700;
  margin-bottom: 20px;
  color: #2d3436;
  font-size: 1.1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #636e72;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary-green);
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f1f2f6;
  color: #2d3436;
  border-radius: 50%;
  margin-right: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.2s;
}

.social-icons a:hover {
  background: var(--primary-green);
  color: #fff;
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid #eee;
  padding-top: 25px;
  margin-top: 40px;
}

/* My Custom Styles */
:root {
  --font-heading: 'IBM Plex Sans Thai', sans-serif;
  --font-body: 'Sarabun', sans-serif;
  --font-number: 'IBM Plex Sans Thai', sans-serif;
}

body {
  font-family: var(--font-body);
  letter-spacing: 0.5px;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.product-title,
.fw-bold {
  font-family: var(--font-heading);
}

.product-price,
.badge,
#productPrice,
#stickyFooterPrice {
  font-family: var(--font-number);
}

.product-content-rich,
p,
.product-category {
  font-family: var(--font-body);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  /* Hidden by default on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  /* iOS Safe Area */
}

.mobile-bottom-nav__item {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  color: #6c757d;
  text-decoration: none;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.mobile-bottom-nav__item.active {
  color: #0d6efd;
  /* Bootstrap Primary */
}

.mobile-bottom-nav__item-icon {
  font-size: 1.25rem;
  margin-bottom: 2px;
  display: block;
}

/* Mobile Specific Optimizations */
@media (max-width: 767.98px) {

  /* Show Bottom Nav */
  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
  }

  /* Adjust main content padding to prevent overlap with bottom nav */
  body {
    padding-bottom: 70px;
  }

  /* Hide Footer specific elements if too cluttered */
  footer p {
    margin-bottom: 0;
  }

  /* Modern Card Styling for Lists on Mobile */
  .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 1rem;
  }

  /* Bigger Buttons for Touch */
  .btn {
    padding: 0.5rem 1rem;
    min-height: 44px;
    /* Apple Human Interface Guidelines */
  }

  /* Offcanvas styling - Mobile Only */
  .offcanvas.text-bg-dark {
    background: #1a1d20 !important;
    /* Darker, solid background for better contrast */
    color: #f8f9fa;
  }

  .offcanvas-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
  }

  .offcanvas-body {
    padding: 1.5rem;
  }

  .offcanvas-title {
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff;
  }

  .offcanvas-body .nav-link {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.2rem;
    transition: all 0.2s ease;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9) !important;
    /* Bright text */
    font-weight: 500;
  }

  .offcanvas-body .nav-link i {
    color: #6ea8fe;
    /* Lighter Blue accent for icons */
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    transition: transform 0.2s;
  }

  .offcanvas-body .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    padding-left: 1.2rem;
  }

  .offcanvas-body .nav-link:hover i {
    transform: scale(1.1);
    color: #fff;
  }

  /* Dropdown inside offcanvas */
  .offcanvas-body .dropdown-menu {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 1rem;
    box-shadow: none;
    padding: 0.5rem;
    margin-top: 0.25rem;
  }

  .offcanvas-body .dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.6rem 1rem;
    border-radius: 6px;
  }

  .offcanvas-body .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
  }

  /* Input search styling - Keep standard white for contrast */
  .offcanvas-body .input-group .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
  }

  .offcanvas-body .input-group .btn-outline-light:hover {
    background-color: #fff;
    color: #000;
  }
}

/* Enhancing Tables on Mobile */
@media (max-width: 576px) {
  .table-mobile-card thead {
    display: none;
  }

  .table-mobile-card tr {
    display: block;
    margin-bottom: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 15px;
  }

  .table-mobile-card td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    padding: 5px 0;
    text-align: right;
  }

  .table-mobile-card td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
    text-align: left;
  }
}

/* Product Detail Enhancements */
.fw-black {
  font-weight: 900;
}

.btn-outline-white {
  border: 2px solid #eee;
  color: #333;
  transition: all 0.2s;
}

.product-option-radio:checked+label {
  border-color: var(--primary-green);
  background-color: #f0fff4 !important;
}

.product-option-radio:checked+label::after {
  content: '\F633';
  /* bi-check-circle-fill */
  font-family: "bootstrap-icons";
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--primary-green);
}

#productQty::-webkit-inner-spin-button,
#productQty::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Cart Drawer Item Spacing */
.cart-item {
  transition: background 0.2s;
}

.cart-item:hover {
  background: #fcfcfc;
}

.remove-item-btn {
  opacity: 0.5;
  transition: opacity 0.2s;
}

.remove-item-btn:hover {
  opacity: 1;
}

.quantity-control .btn {
  padding: 2px 8px;
}