/* Extracted from shop.html */
/* Product cards: stacked layout with sliding footer actions */
.product-item {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.product-item .product__img {
  position: relative;
  overflow: hidden;
}

.product-item .product__img img {
  width: 100%;
  transition: transform 0.35s ease;
}

.product-item:hover .product__img img {
  transform: scale(1.05);
}

.product-item .product__action {
  position: static;
  width: 100%;
}

.product-item .product__footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fee023;
  color: #063464;
}

.product-item .product__footer .bg-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.25;
}

.product-item .product__footer .bg-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(12px);
  transform: scale(1.15);
}

.product-item .product__footer .package__price {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.4px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-item .product__footer .package__currency {
  font-size: 18px;
}

.product-item .product__footer .package__amount {
  font-size: 26px;
}

.product-item .product__footer .package__actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  /* center content; single button will be centered/full width */
  pointer-events: none;
  z-index: 2;
}

.product-item .product__footer .package__actions .btn {
  flex: 1 1 50%;
  width: 50%;
  max-width: 50%;
  min-width: 0;
  border-radius: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  /* Make transform + opacity animate together, same speed */
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    opacity 0.25s ease;
  height: 100%;
  opacity: 0;
  /* Hint to browser to prepare this for animation (reduces tiny delays) */
  will-change: transform, opacity;
}


.product-item .product__footer .package__actions .btn i,
.product-item .product__footer .package__actions .btn span {
  pointer-events: none;
}

.product-item .product__footer .package__actions .btn-add-cart {
  background-color: #fee023 !important;
  color: #063464 !important;
  transform: translateX(-100%);
  border-radius: 8px;
  border: 1px solid #063464 !important;
}

.product-item .product__footer .package__actions .btn-details {
  background-color: #fee023 !important;
  color: #063464 !important;
  transform: translateX(100%);
  border-radius: 8px;
  border: 1px solid #063464 !important;
}

/* When there's only a single action button (like "Check It Now"),
   let it span the full yellow bar */
.product-item .product__footer .package__actions .btn-details:only-child {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
}

.product-item .product__footer .package__actions .btn:hover {
  background-color: #2983fd !important;
  color: #ffffff !important;
}

.product-item:hover .product__footer .package__price {
  opacity: 0;
  transform: scale(0.9);
}

.product-item:hover .product__footer .package__actions {
  pointer-events: auto;
}

.product-item:hover .product__footer .btn-add-cart,
.product-item:hover .product__footer .btn-details {
  transform: translateX(0);
  opacity: 1;
}

.product-item .product__info {
  padding: 22px 18px 28px;
}

/* Ensure product cards are equal height so footers align
   Make the column containers flex so .product-item can stretch
   and push the footer to the bottom using margin-top:auto. */
#productGrid>[class*="col-"] {
  display: flex;
}

.product-item {
  flex: 1 1 auto;
}

.product-item .product__action {
  margin-top: auto;
}

.product-item .product__info .product__title {
  margin-bottom: 0;
}

.product-item .product__info .product__title a {
  color: #063464;
}

.product-item .product__info .product__title a:hover {
  color: #2983fd;
}

.cart-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  min-width: 220px;
  padding: 12px 18px;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.cart-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cart-toast.is-success {
  background-color: #1db954;
}

.cart-toast.is-error {
  background-color: #d9534f;
}

/* Lightweight modal for product details */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .55);
  display: none;
  pointer-events: none
}

.modal-overlay.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto
}

.modal-dialog {
  position: relative;
  margin: 40px auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  width: 90%;
  max-width: 1100px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #333;
  z-index: 10
}

.modal-frame {
  border: 0;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto
}

/* Allow scrolling inside iframe container on wheel/touch */
.modal-dialog:has(.modal-frame) {
  overflow: auto
}

body.product-details-modal-open .footer,
body.product-details-modal-open #scrollTopBtn {
  display: none !important
}

/* --- 1. Search & Sort Bar Styling --- */
.sorting-options {
  background: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

/* Unified style for both Select and Input */
.sorting-control-style {
  height: 50px;
  /* Consistent Height */
  width: 240px;
  /* Consistent Width */
  border: 1px solid #e1e1e1;
  border-radius: 6px;
  padding: 0 15px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.sorting-control-style:focus {
  border-color: #007bff;
  /* Change to your primary color */
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* --- 2. Widget Improvements --- */
.widget {
  background: #fff;
  padding: 20px;
  /* Reduced padding slightly to give content more room */
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  width: 100%;
  box-sizing: border-box;
  /* Ensures padding doesn't expand width */
}

.widget__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  position: relative;
  white-space: normal;
  /* Allows text to wrap if column is narrow */
}

.widget__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 50px;
  height: 2px;
  background-color: #007bff;
}

/* Categories */
.cat-link {
  display: block;
  padding: 12px 0;
  color: #555;
  border-bottom: 1px dashed #eee;
  transition: 0.3s;
  position: relative;
}

.cat-link:hover,
.cat-link.active {
  color: #007bff;
  padding-left: 8px;
  /* Sliding animation */
  font-weight: 600;
}

/* Tags (Pill Design) */
.widget-tags .list-unstyled {
  display: flex;
  flex-wrap: wrap;
  /* Critical: Forces tags to wrap to next line */
  gap: 8px;
}

.tag-link {
  display: inline-block;
  background: #f1f5f9;
  color: #555;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.tag-link:hover,
.tag-link.active {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
  text-decoration: none;
}

/* Pricing Filter Button */
#rangeSlider {
  height: 6px;
  background: #e6e6e6;
  border: none;
  border-radius: 3px;
  margin: 25px 10px 20px 5px;
  /* Add spacing so handles don't get cut off */
  position: relative;
}

/* The colored bar between handles */
#rangeSlider .ui-slider-range {
  background: #007bff;
  border-radius: 3px;
}

/* The drag handles (rounded pill) */
#rangeSlider .ui-slider-handle {
  width: 26px;
  height: 12px;
  background: #ffffff;
  border: 2px solid #007bff;
  border-radius: 8px;
  /* rounded pill */
  top: 50%;
  /* center vertically with translate */
  margin-left: 0;
  /* let translate center horizontally */
  cursor: pointer;
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.12s, background-color 0.12s, box-shadow 0.12s;
  transform: translate(-50%, -50%);
  /* keeps handle centered and prevents jump */
  box-sizing: border-box;
  /* keep border inside size to avoid shifts */
}

#rangeSlider .ui-slider-handle:hover {
  transform: translate(-50%, -50%) scale(1.05);
  background: #007bff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* Make the visible price range more prominent */
#rangeSliderResult {
  border: 0 !important;
  color: #003366 !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  background: transparent !important;
  text-align: left;
}

/* Hide default jQuery UI ugliness */
.ui-widget-content {
  border: none !important;
}

/* === Modal "View Cart" footer button (Saniklear palette) === */
.modal-cart-footer {
  padding: 10px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #f9fafb;
  display: flex;
  justify-content: flex-end;
}

#modalViewCartBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #01244a;
  background-color: #fee023;
  /* Saniklear yellow */
  color: #01244a;
  /* Saniklear dark blue text */
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-transform: none;
}

#modalViewCartBtn i {
  font-size: 14px;
}

#modalViewCartBtn:hover {
  background-color: #4CAF50;
  /* Saniklear green on hover */
  color: #ffffff;
  /* white text on hover */
  border-color: #4CAF50;
}

/* Disabled state when cart is empty */
#modalViewCartBtn.is-disabled,
#modalViewCartBtn:disabled {
  background-color: #d1d5db;
  color: #6b7280;
  border-color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 575.98px) {
  .sorting-options .nice-select{
    min-width: 128px;
  }

  .nice-select .list{
    width: 126% !important;
  }

  .sorting-control-style {
    width: 216px;
  }
}