/* coffee-banner */
.coffee-banner {
  width: auto;
  height: clamp(300px, 50vw, 430px);
  background-image: linear-gradient(to bottom,
      rgba(148, 83, 0, 0.5),
      rgba(46, 26, 0, 0.5)), url('../img/coffee/coffee-banner.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: clamp(12px, 2vw, 16px);
}

.coffee-banner-title {
  color: var(--text-color-light);
  text-shadow: 2px 2px 4px rgba(0, 0, 3, 0.5);
  line-height: 1.2;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.coffee-banner-desc {
  color: var(--text-color-light);
  text-shadow: 2px 2px 4px rgba(0, 0, 3, 0.5);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  line-height: 1.4;
}

/* site-stats section */
.site-stats-card {
  height: clamp(180px, 30vw, 210px);
  width: auto;
  border-radius: clamp(12px, 2vw, 16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: none !important;
  padding: clamp(1rem, 2vw, 1.5rem);
}

.stats-count {
  font-weight: bold;
  color: var(--primary-color);
  text-shadow: 2px 2px 4px rgba(0, 0, 3, 0.1);
  line-height: 1;
  font-size: clamp(2rem, 5vw, 3rem);
}

.stats-title {
  font-weight: bold;
  font-family: var(--primaryFont);
  line-height: 1.2;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* category-section */
.title-category {
  font-weight: bold;
  font-family: var(--primaryFont);
  color: var(--text-color-dark);
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.category-scroll {
  display: flex;
  overflow-x: auto;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  padding: clamp(0.5rem, 1.5vw, 1rem);

  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;

  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

.category-scroll::-webkit-scrollbar {
  height: clamp(4px, 1vw, 6px);
}

.category-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.category-scroll::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.category-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--btn-hover1);
}

.category-pill {
  min-width: clamp(90px, 20vw, 120px);
  padding: clamp(8px, 2vw, 12px) clamp(14px, 3vw, 20px);
  border-radius: 50px;
  border: 2px solid var(--btn-hover1);
  color: var(--text-color-dark);
  font-weight: 600;
  font-family: var(--primaryFont);
  font-size: clamp(0.85rem, 2vw, 1rem);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  scroll-snap-align: start;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.category-pill:hover {
  background-color: var(--btn-hover1);
  color: var(--text-color-light);
  transform: translateY(-2px);
}

.category-pill.active {
  background-color: var(--btn-hover1);
  color: #fff;
  border-color: var(--btn-hover1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

@media (max-width: 576px) {
  .category-pill {
    min-width: 80px;
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}

.products-section {
  min-height: 400px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background-color: #ffffff;
  border: none !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-radius: clamp(12px, 2vw, 16px);
  padding: clamp(1rem, 3vw, 2rem);
  padding-bottom: clamp(80px, 15vw, 120px);
}

.products-section::-webkit-scrollbar {
  display: none;
}

/* Menu Item Card - More Responsive */
.menu-item {
  height: clamp(240px, 35vw, 320px) !important;
  border-radius: clamp(12px, 3vw, 20px) !important;
  background-color: var(--bg-color);
  border: 0.5px solid rgba(0, 0, 0, 0.2) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(8px, 1.5vw, 15px) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.menu-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Menu Item Image Container */
.menu-item > div:first-child {
  height: clamp(100px, 20vw, 150px) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Menu Name with 2-line ellipsis */
.menu-name {
  font-size: clamp(0.85rem, 2vw, 1rem) !important;
  font-weight: 500;
  color: #4b2e2e;
  margin-top: clamp(6px, 1.5vw, 10px);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6em;
}

/* Price styling */
.menu-item .d-flex.justify-content-center {
  color: #6e4f3a;
  font-size: clamp(0.8rem, 1.8vw, 0.95rem) !important;
  font-weight: 600;
  margin: clamp(4px, 1vw, 8px) 0;
}

.cart-section {
  height: auto;
  max-height: 935px;
  border-radius: clamp(12px, 2vw, 16px);
  border: none !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: clamp(1rem, 2vw, 1.5rem);
}

.cart-title {
  font-family: var(--primaryFont);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.icon {
  height: clamp(28px, 5vw, 35px);
  width: clamp(28px, 5vw, 35px);
  border-radius: clamp(8px, 1.5vw, 10px);
  background-color: var(--primary-color);
}

.line-divider {
  width: 100%;
  height: clamp(3px, 0.5vw, 5px);
  background-color: rgb(0, 0, 0);
  margin-top: clamp(10px, 2vw, 15px);
  margin-bottom: clamp(12px, 2.5vw, 20px);
}

.buy-btn {
  background-color: var(--primary-color) !important;
  color: var(--text-color-dark) !important;
  font-weight: 600;
  border: none;
  border-radius: clamp(8px, 1.5vw, 12px);
  padding: clamp(6px, 1.5vw, 10px) clamp(12px, 2.5vw, 18px);
  margin-top: clamp(6px, 1vw, 10px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: clamp(90px, 20vw, 110px);
  text-align: center;
  line-height: 1.2;
}

.buy-btn:hover {
  opacity: 0.9;
  background-color: var(--btn-hover1) !important;
  color: var(--text-color-light) !important;
  transform: translateY(-2px);
}

.buy-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-checkout {
  background-color: var(--primary-color);
  color: #fff;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  padding: clamp(8px, 2vw, 12px) clamp(16px, 3vw, 24px);
  border-radius: clamp(8px, 1.5vw, 12px);
}

.btn-checkout:hover {
  background-color: darken(var(--primary-color), 10%);
  transform: scale(1.02);
}

.form-check-input {
  width: clamp(1.2em, 2.5vw, 1.5em);
  height: clamp(1.2em, 2.5vw, 1.5em);
  margin-top: 0.25em;
  border: 3px solid var(--primary-color) !important;
}

.form-check-input:checked {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.form-check-label {
  margin-left: 0.5em;
  font-weight: 500;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.price {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  color: var(--text-color-dark);
}

/* ===== UPDATED RESPONSIVE CUSTOM SELECT DROPDOWN ===== */
.custom-select-wrapper {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 12px);
  padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2.5vw, 18px);
  border-radius: 50px;
  border: 1px solid var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: var(--primaryFont);
  font-weight: 500;
  color: var(--text-color-dark);
  width: fit-content;
  max-width: 100%;
}

.filter-icon {
  color: var(--text-color-dark);
  font-size: clamp(0.9rem, 2vw, 1rem);
  flex-shrink: 0;
}

.sort-label {
  margin: 0;
  font-weight: 600;
  font-size: clamp(0.85rem, 2vw, 1rem);
  white-space: nowrap;
  flex-shrink: 0;
}

.custom-select {
  position: relative;
  display: inline-block;
  min-width: clamp(120px, 25vw, 180px);
  max-width: 100%;
  font-family: var(--primaryFont);
  font-weight: 600;
  color: var(--text-color-dark);
  cursor: pointer;
}

.custom-select .selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(4px, 1vw, 8px);
  padding: clamp(4px, 1vw, 6px) clamp(6px, 1.5vw, 10px);
  border-radius: clamp(4px, 1vw, 6px);
  background: transparent;
  line-height: 1.2;
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
}

.custom-select .selected-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.custom-select .dropdown-icon {
  flex-shrink: 0;
  margin-left: clamp(4px, 1vw, 6px);
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  transition: transform 0.2s ease;
}

.custom-select.open .dropdown-icon {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.custom-select .options {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  min-width: 100%;
  width: max-content;
  max-width: 280px;
  border: 1px solid var(--text-color-dark);
  border-radius: clamp(6px, 1.5vw, 8px);
  background: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 99;
  transform: translateY(-5px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.custom-select .options div {
  transition: all 0.2s ease;
}

.custom-select .options div:hover {
  background: var(--btn-hover1);
  color: var(--text-color-light);
}

.custom-select .options.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.custom-select .options div a {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: clamp(8px, 1.5vw, 10px) clamp(10px, 2vw, 14px);
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  white-space: nowrap;
}

.custom-select .options div a:hover {
  background: var(--btn-hover1);
  color: var(--text-color-light);
}

/* Mobile responsiveness for sort dropdown */
@media (max-width: 576px) {
  .custom-select-wrapper {
    padding: 8px 12px;
    gap: 6px;
  }

  .sort-label {
    font-size: 0.8rem;
  }

  .custom-select {
    min-width: 110px;
  }

  .custom-select .selected {
    padding: 4px 6px;
    font-size: 0.75rem;
  }

  .custom-select .options {
    max-width: 200px;
    font-size: 0.8rem;
  }

  .custom-select .options div a {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
}

@media (max-width: 400px) {
  .custom-select-wrapper {
    padding: 6px 10px;
  }

  .sort-label {
    font-size: 0.75rem;
  }

  .custom-select {
    min-width: 100px;
  }

  .custom-select .selected {
    font-size: 0.7rem;
  }

  .custom-select .options div a {
    font-size: 0.7rem;
    padding: 6px 8px;
  }
}

body {
  scroll-padding-bottom: 100px;
}

/* Product Grid Spacing */
#productGrid .col:last-child .menu-item {
  margin-bottom: clamp(20px, 4vw, 30px);
}

/* Responsive Breakpoint Adjustments */
@media (max-width: 576px) {
  .products-section {
    padding-bottom: 100px;
  }

  #productGrid .col .menu-item {
    margin-bottom: 12px;
  }

  #productGrid .col:nth-last-child(-n+2) .menu-item {
    margin-bottom: 30px;
  }
}

@media (max-width: 767px) {
  .products-section {
    padding-bottom: 110px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .products-section {
    padding-bottom: 100px;
  }

  .menu-item {
    height: clamp(260px, 30vw, 300px) !important;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .products-section {
    padding-bottom: 100px;
  }
}

@media (min-width: 1200px) {
  .products-section {
    padding-bottom: 90px;
  }
}

/* Unavailable Product Styling */
.product-item.unavailable .menu-item {
  opacity: 0.7;
}

.product-item.unavailable .menu-item img {
  filter: grayscale(100%);
  opacity: 0.6;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .menu-item:hover {
    transform: none;
  }
  
  .menu-item:active {
    transform: scale(0.98);
  }
  
  .category-pill:hover {
    transform: none;
  }
  
  .buy-btn:hover {
    transform: none;
  }
}

/* Modal Blur Effect */
body.modal-blur-active {
  overflow: hidden;
}

body.modal-blur-active > *:not(.modal):not(script) {
  filter: blur(8px);
  transition: filter 0.3s ease;
}

body.modal-blur-active .modal {
  filter: none;
}

.blur-background {
  filter: blur(8px);
  transition: filter 0.3s ease;
  pointer-events: none;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop.show {
  backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.6);
}


@media (max-width: 991px) and (orientation: portrait) {
  .menu-item {
    height: auto !important;
    min-height: 280px;
  }

  .menu-item button {
    margin-top: auto !important;
    position: relative;
    bottom: 0;
  }
}
