/* 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;
  cursor: pointer;
}

.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 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
  min-height: 6rem;
}

/* 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;
}

@media (max-width:767px) {
  .product-item .product__info .product__title a {
    font-size: 1rem;
  }
}

.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(1, 36, 74, 0.65);
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(3px)
}

.modal-overlay.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 1
}

.modal-dialog {
  position: relative;
  margin: 0 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(1, 36, 74, 0.2),
    0 0 1px rgba(1, 36, 74, 0.1);
  width: 90%;
  max-width: 1100px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  transform: scale(0.95) translateY(20px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(41, 131, 253, 0.1);
}

.modal-dialog::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, transparent, #2983fd 30%, #178adc 50%, #2983fd 70%, transparent);
  border-radius: 12px 12px 0 0;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(41, 131, 253, 0.3);
}

.modal-overlay.is-open .modal-dialog {
  transform: scale(1) translateY(0);
  opacity: 1
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  background: rgba(41, 131, 253, 0.08);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #01244a;
  z-index: 10;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-weight: 300;
  border: 1px solid rgba(41, 131, 253, 0.15);
}

.modal-close:hover {
  background: #2983fd;
  color: #ffffff;
  transform: rotate(90deg);
  border-color: #2983fd;
  box-shadow: 0 4px 12px rgba(41, 131, 253, 0.35)
}

.modal-close:active {
  transform: rotate(90deg) scale(0.95);
}

.modal-close:focus {
  outline: 2px solid #2983fd;
  outline-offset: 2px
}

.modal-content-shell {
  flex: 1 1 auto;
  overflow: auto;
  padding: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.modal-loading {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ffffff 0%, rgba(41, 131, 253, 0.02) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
  border-radius: 12px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-loading.hidden {
  opacity: 0;
  pointer-events: none
}

.modal-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(41, 131, 253, 0.15);
  border-top-color: #2983fd;
  border-right-color: #178adc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 15px rgba(41, 131, 253, 0.2);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.product-modal {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.product-modal__hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
  gap: 28px;
  align-items: start;
}

.product-modal__media {
  background: #f4f8fc;
  border: 1px solid rgba(1, 36, 74, 0.08);
  border-radius: 18px;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-modal__eyebrow {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(41, 131, 253, 0.08);
  color: #178adc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-modal__title {
  margin: 0;
  color: #01244a;
  font-size: 34px;
  line-height: 1.1;
}

.product-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #607086;
  font-size: 14px;
}

.product-modal__meta span {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff4f8;
}

.product-modal__price {
  color: #01244a;
  font-size: 28px;
  font-weight: 700;
}

.product-modal__summary {
  margin: 0;
  color: #54657c;
  font-size: 15px;
  line-height: 1.7;
}

.product-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.product-modal__actions .btn {
  min-width: 180px;
  justify-content: center;
}

.product-modal__section {
  border-top: 1px solid rgba(1, 36, 74, 0.08);
  padding-top: 24px;
}

.product-modal__section h4 {
  margin-bottom: 14px;
  color: #01244a;
}

.product-modal__description {
  display: grid;
  gap: 12px;
  color: #48586d;
  line-height: 1.7;
}

.product-modal__description p {
  margin: 0;
}

.product-modal__related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.product-modal__related-card {
  padding: 16px;
  border: 1px solid rgba(1, 36, 74, 0.08);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(1, 36, 74, 0.06);
}

@media (max-width:767px) {
  .product-modal__related-card {
    max-width: stretch;
  }
}

.product-modal__related-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}

.product-modal__related-card h5 {
  margin-bottom: 6px;
  color: #01244a;
  font-size: 16px;
}

.product-modal__related-card p {
  margin-bottom: 12px;
  color: #2983fd;
  font-weight: 700;
}

.product-modal__related-actions {
  display: flex;
  gap: 8px;
}

.product-modal__related-actions .btn {
  flex: 1 1 50%;
  min-width: 0;
  padding: 10px 12px;
  font-size: 13px;
}

.product-modal__empty {
  margin: 0;
  color: #6f8095;
}

.rental-picker {
  border: 1px solid rgba(1, 36, 74, 0.12);
  border-radius: 16px;
  padding: 16px;
  background: #f9fbfd;
}

.rental-picker__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.rental-picker__fields label,
.quantity-picker label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  color: #01244a;
  font-size: 14px;
  font-weight: 600;
}

.rental-picker__fields input[type=date],
.quantity-picker input[type=number] {
  min-height: 48px;
  border: 1px solid rgba(1, 36, 74, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
}

.rental-picker__fields input[type=date]:focus,
.quantity-picker input[type=number]:focus {
  outline: 0;
  border-color: #2983fd;
  box-shadow: 0 0 0 3px rgba(41, 131, 253, 0.14);
}

.rental-picker__fields .calendar-btn {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(1, 36, 74, 0.14);
  border-radius: 12px;
  background: #ffffff;
  color: #01244a;
}

.quantity-picker {
  max-width: 170px;
}

#modalRentalSummary {
  margin-top: 12px;
  color: #54657c;
  font-size: 14px;
}

#modalRentalSummary.error {
  color: #d9534f;
}

/* Custom scrollbar for modal */
.modal-dialog::-webkit-scrollbar {
  width: 8px;
}

.modal-dialog::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.modal-dialog::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 10px;
}

.modal-dialog::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Firefox scrollbar */
.modal-dialog {
  scrollbar-color: #d0d0d0 #f1f1f1;
  scrollbar-width: thin;
}

/* Responsive design */
@media (max-width: 768px) {
  .modal-dialog {
    height: 90vh;
    border-radius: 16px 16px 0 0;
    margin: 0;
  }

  .modal-overlay.is-open {
    align-items: flex-end;
  }

  .modal-overlay.is-open .modal-dialog {
    transform: translateY(0) scale(1);
    border-radius: 20px 20px 0 0;
  }

  .modal-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .modal-content-shell {
    padding: 22px 18px;
  }

  .product-modal__hero {
    grid-template-columns: 1fr;
  }

  .rental-picker__fields {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 480px) {
  .modal-dialog {
    height: 95vh;
    max-width: 100vw;
  }

  .product-modal__title {
    font-size: 28px;
  }

  .product-modal__related-actions {
    flex-direction: column;
  }

  .modal-close {
    top: 10px;
    right: 10px;
  }
}

body.product-details-modal-open .footer,
body.product-details-modal-open #scrollTopBtn {
  display: none !important
}

body.product-details-modal-open {
  background: linear-gradient(135deg, #f8fafb 0%, #f0f4f8 100%)
}

/* --- 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);

  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 30px;
}

/* Unified style for both Select and Input */
.sorting-control-style {
  height: 50px; /* Consistent height */
  width: stretch;
  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);
}

.sort-search-container {
  display: flex;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 1rem;
}

@media (max-width:767px) {
  .sort-search-container {
    flex-wrap: wrap !important;
  }

  .sort-search-container .nice-select {
    width: stretch;
  }

  .sort-search-container form {
    width: stretch;
  }

  .item-container {
    max-width: 50%;
  }
}

.widget__form-search {
  width: stretch;
}

/* --- 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 (Kleanext 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;
  /* Kleanext yellow */
  color: #01244a;
  /* Kleanext dark blue text */
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-transform: none;
}

#modalViewCartBtn i {
  font-size: 14px;
}

#modalViewCartBtn:hover {
  background-color: #4CAF50;
  /* Kleanext 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: stretch;
  }
}