/* =========================================================
   RENTAL PAGE – CLEAN FULL CSS (no duplicates / no conflicts)
   - Desktop: 2 columns (main + sticky cart)
   - Mobile: 1 column + cart under zone selector (normal block)
   - Mobile: page scroll (no inner scroll traps)
   ========================================================= */

/* -------------------------
   Base Layout
------------------------- */
.rental-main {
  min-height: 100vh;
  background: hsl(210 40% 98%);
  padding-top: 90px;
}

.rental-hero {
  background: linear-gradient(135deg, hsl(195 100% 50%) 0%, hsl(195 100% 40%) 100%);
  padding: 4rem 0;
  text-align: center;
}

.rental-hero-title {
  font-family: var(--font-display), "Outfit", sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.rental-hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto;
}

.rental-content {
  padding: 3rem 0;
}

.rental-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .rental-layout {
    grid-template-columns: 1fr 380px;
    align-items: start;
  }
}

.rental-main-col {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.rental-zone-selector,
.rental-equipment,
.rental-chemicals {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid hsl(214 32% 91%);
}

.section-title {
  font-family: var(--font-display), "Outfit", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(222.2 47.4% 11.2%);
  margin-bottom: 0.25rem;
}

.section-desc {
  color: hsl(215.4 16.3% 46.9%);
  margin-bottom: 1.5rem;
}

/* -------------------------
   Zone selectors + custom selects
------------------------- */
.zone-selectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .zone-selectors {
    grid-template-columns: 1fr;
  }
}

.select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.select-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(222.2 47.4% 11.2%);
}

/* hide native select – you render a custom select */
.rental-select {
  display: none;
}

.custom-select-trigger {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  border: 1px solid hsl(214 32% 91%);
  border-radius: 0.75rem;
  font-size: 1rem;
  color: hsl(222.2 47.4% 11.2%);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
}

.custom-select-trigger:hover {
  border-color: hsl(195 100% 50%);
}

.custom-select-trigger:focus {
  outline: none;
  border-color: hsl(195 100% 50%);
  box-shadow: 0 0 0 3px hsla(195, 100%, 50%, 0.2);
}

.custom-select-trigger[aria-expanded="true"] {
  border-color: hsl(195 100% 50%);
  box-shadow: 0 0 0 3px hsla(195, 100%, 50%, 0.2);
}

.custom-select-trigger .chevron-icon {
  width: 1rem;
  height: 1rem;
  opacity: 0.5;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.custom-select-trigger[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.custom-select-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  z-index: 50;
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(214 32% 91%);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  max-height: 250px;
  overflow-y: auto;
}

.custom-select-menu.open {
  display: block;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 500;
  color: hsl(222.2 47.4% 11.2%);
  cursor: pointer;
  border-radius: 0.5rem;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.custom-select-option:hover,
.custom-select-option:focus {
  background: hsla(195, 100%, 50%, 0.05);
  color: hsl(195 100% 40%);
  outline: none;
}

.custom-select-option .check-icon {
  width: 1rem;
  height: 1rem;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.custom-select-option[aria-selected="true"] .check-icon {
  opacity: 1;
}

/* -------------------------
   Equipment cards
------------------------- */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.equipment-card {
  background: #fff;
  border: 1px solid hsl(214 32% 91%);
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.equipment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.equipment-card.selected {
  border-color: hsl(195 100% 50%);
  box-shadow: 0 0 0 2px hsla(195, 100%, 50%, 0.3);
}

.equipment-image {
  aspect-ratio: 16/10;
  background: hsl(210 40% 96%);
  overflow: hidden;
}

.equipment-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.equipment-info {
  padding: 1.25rem;
}

.equipment-title {
  font-family: var(--font-display), "Outfit", sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(222.2 47.4% 11.2%);
  margin-bottom: 0.5rem;
}

.equipment-desc {
  font-size: 0.875rem;
  color: hsl(215.4 16.3% 46.9%);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.equipment-specs {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  font-size: 0.8rem;
  color: hsl(215.4 16.3% 56.9%);
}

.equipment-specs li {
  padding: 0.25rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.equipment-specs li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: hsl(195 100% 50%);
  font-weight: 600;
}

.equipment-price {
  margin-bottom: 1rem;
}

.price-amount {
  font-family: var(--font-display), "Outfit", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(195 100% 40%);
}

.price-period {
  font-size: 0.875rem;
  color: hsl(215.4 16.3% 46.9%);
}

/* quantity */
.quantity-selector {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid hsl(214 32% 91%);
  border-radius: 0.5rem;
  overflow: hidden;
  width: fit-content;
}

.quantity-selector-sm {
  transform: scale(0.9);
  transform-origin: left center;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: hsl(210 40% 96%);
  color: hsl(222.2 47.4% 11.2%);
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: hsl(195 100% 90%);
}

.qty-btn:active {
  background: hsl(195 100% 80%);
}

.qty-input {
  width: 50px;
  height: 40px;
  border: none;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(222.2 47.4% 11.2%);
  background: #fff;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* -------------------------
   Chemicals
------------------------- */
.chemicals-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chemical-item {
  padding: 1.25rem;
  background: hsl(210 40% 98%);
  border-radius: 0.75rem;
  border: 1px solid hsl(214 32% 91%);
}

.chemical-item.selected {
  border-color: hsl(195 100% 50%);
  background: hsla(195, 100%, 50%, 0.05);
}

.chemical-info {
  margin-bottom: 1rem;
}

.chemical-title {
  font-family: var(--font-display), "Outfit", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(222.2 47.4% 11.2%);
  margin-bottom: 0.25rem;
}

.chemical-desc {
  font-size: 0.875rem;
  color: hsl(215.4 16.3% 46.9%);
  margin-bottom: 0.5rem;
}

.chemical-price {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(195 100% 40%);
}

.chemical-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.chemical-controls > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chemical-controls label {
  font-size: 0.75rem;
  color: hsl(215.4 16.3% 46.9%);
  font-weight: 500;
}

.grams-input {
  width: 100px;
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid hsl(214 32% 91%);
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.grams-input:focus {
  outline: none;
  border-color: hsl(195 100% 50%);
  box-shadow: 0 0 0 3px hsla(195, 100%, 50%, 0.2);
}

.stain-select {
  min-width: 140px;
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid hsl(214 32% 91%);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: #fff;
  cursor: pointer;
}

.stain-select:focus {
  outline: none;
  border-color: hsl(195 100% 50%);
  box-shadow: 0 0 0 3px hsla(195, 100%, 50%, 0.2);
}

/* if you intentionally hide this select in UI */
.stain-select.is-hidden {
  display: none;
}

/* -------------------------
   Cart (Desktop)
------------------------- */
.rental-cart-col {
  position: relative;
}

.rental-cart {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  border: 1px solid hsl(214 32% 91%);
  position: sticky;
  top: 90px; /* adjust if needed */
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 1rem;
}

.cart-close-btn {
  display: none; /* only needed for old modal version */
}

/* overlay + floating button – keep hidden by default */
.cart-overlay {
  display: none;
}
.mobile-cart-toggle {
  display: none;
}

/* cart header */
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem 1rem 1.25rem;
  background: hsl(195 100% 50%);
  color: #fff;
  border-radius: 1rem;
}

.cart-title {
  font-family: var(--font-display), "Outfit", sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.cart-count {
  font-size: 1rem;
  opacity: 0.9;
}

.cart-items {
  padding: 1.25rem;
  max-height: 250px;
  overflow-y: auto;
}

.cart-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: hsl(215.4 16.3% 46.9%);
}

.cart-empty-icon {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.cart-empty p {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.cart-empty span {
  font-size: 0.875rem;
  opacity: 0.8;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  background: hsl(210 40% 98%);
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  color: hsl(222.2 47.4% 11.2%);
  margin-bottom: 0.25rem;
}

.cart-item-details {
  font-size: 0.75rem;
  color: hsl(215.4 16.3% 46.9%);
}

.cart-item-price {
  font-weight: 600;
  color: hsl(195 100% 40%);
  white-space: nowrap;
}

.cart-item-remove {
  margin-left: 0.5rem;
  padding: 0.25rem;
  background: none;
  border: none;
  color: hsl(0 72% 51%);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.cart-item-remove:hover {
  opacity: 1;
}

.cart-summary {
  padding: 1rem 1.25rem;
  background: hsl(210 40% 98%);
  border-top: 1px solid hsl(214 32% 91%);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.875rem;
  color: hsl(215.4 16.3% 46.9%);
}

.summary-total {
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid hsl(214 32% 91%);
  font-weight: 600;
  font-size: 1rem;
  color: hsl(222.2 47.4% 11.2%);
}

.cart-actions {
  padding: 1rem 1.25rem 1.25rem;
}

.btn-reserve {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: hsl(195 100% 50%);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn-reserve:hover:not(:disabled) {
  background: hsl(195 100% 45%);
}

.btn-reserve:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* form */
.cart-form {
  padding: 1.25rem;
}

.form-header {
  margin-bottom: 1.25rem;
}

.form-header h3 {
  font-family: var(--font-display), "Outfit", sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(222.2 47.4% 11.2%);
  margin: 0.75rem 0 0;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  background: none;
  border: none;
  color: hsl(195 100% 50%);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-back:hover {
  text-decoration: underline;
}

.reservation-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(222.2 47.4% 11.2%);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid hsl(214 32% 91%);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: hsl(195 100% 50%);
  box-shadow: 0 0 0 3px hsla(195, 100%, 50%, 0.2);
}

.form-group input[readonly] {
  background: hsl(210 40% 98%);
  cursor: not-allowed;
}

.form-group input.error,
.form-group textarea.error {
  border-color: hsl(0 72% 51%);
}

.form-error {
  font-size: 0.75rem;
  color: hsl(0 72% 51%);
  min-height: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.btn-submit-reservation {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: hsl(142 72% 46%);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 0.5rem;
}

.btn-submit-reservation:hover {
  background: hsl(142 72% 40%);
}

.whatsapp-icon {
  width: 20px;
  height: 20px;
}

/* success */
.cart-success {
  padding: 2rem 1.25rem;
  text-align: center;
}

.success-icon {
  color: hsl(142 72% 46%);
  margin-bottom: 1rem;
}

.cart-success h3 {
  font-family: var(--font-display), "Outfit", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(222.2 47.4% 11.2%);
  margin-bottom: 0.5rem;
}

.cart-success p {
  font-size: 0.875rem;
  color: hsl(215.4 16.3% 46.9%);
  margin-bottom: 1.5rem;
}

.btn-new-reservation {
  padding: 0.75rem 1.5rem;
  background: hsl(210 40% 96%);
  color: hsl(222.2 47.4% 11.2%);
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-new-reservation:hover {
  background: hsl(210 40% 90%);
}

/* -------------------------
   Responsive tweaks
------------------------- */
@media (max-width: 768px) {
  .rental-hero-title {
    font-size: 2rem;
  }

  .rental-hero-subtitle {
    font-size: 1rem;
  }

  .equipment-grid {
    grid-template-columns: 1fr;
  }

  .chemical-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .chemical-controls > div {
    width: 100%;
  }

  .quantity-selector-sm {
    transform: none;
  }
}

/* =========================================================
   MOBILE: CART AS NORMAL PAGE BLOCK (no modal, no traps)
   - Under zone selector
   - Page scroll (cart-form pushes page)
   ========================================================= */
@media (max-width: 1023px) {
  /* Put cart under zone selector */
  .rental-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "zone"
      "cart"
      "equipment"
      "chemicals";
  }

  /* Make children of main-col become grid items */
  .rental-main-col {
    display: contents;
  }

  .rental-zone-selector { grid-area: zone; }
  .rental-cart-col      { grid-area: cart; }
  .rental-equipment     { grid-area: equipment; }
  .rental-chemicals     { grid-area: chemicals; }

  /* Disable any old modal UI */
  .cart-overlay,
  .mobile-cart-toggle,
  .cart-close-btn {
    display: none !important;
  }

  /* Cart should behave like normal document block */
  .rental-cart-col {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    pointer-events: auto !important;
    padding: 0 !important;
    touch-action: auto !important;
    display: block !important;
  }

  .rental-cart {
    position: static !important;
    top: auto !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    touch-action: auto !important;
  }

  /* IMPORTANT: remove inner scroll so form is reachable */
  .cart-body {
    overflow: visible !important;
    max-height: none !important;
    padding-bottom: 1.25rem;
  }

  /* If you don't want cart-items to scroll separately on mobile */
  .cart-items {
    max-height: none !important;
    overflow: visible !important;
  }

  /* Extra bottom space */
  .cart-form {
    padding-bottom: 1.5rem;
  }
}
