:root {
  --gecko-primary-color: #f47b21;
  --gecko-secondary-color: #0d64af;
}

/* ─── Cart Popout Panel ─────────────────────────────────────────────────────── */

.gecko-cart-popout {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100vw);
  height: 100%;
  z-index: 20000;
  background-color: #fff;
  box-shadow: 0 0 15px 2px #0006;
  color: black;
  font-size: 1rem;

  /* Match vanilla: slide in from right instead of display:none toggle */
  transform: translateX(100%);
  transition: transform 0.3s ease;

  /* Remove the padding that was on the outer container — inner elements handle their own spacing */
  padding: 0;
}

.gecko-cart-popout.is-visible {
  transform: translateX(0);
  /* Override the old display:block approach */
  display: block !important;
}

/* ─── Inner Cart Wrapper ────────────────────────────────────────────────────── */

#gecko-cart {
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  padding: 16px;
  text-align: center;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */

.gecko-cart-popout-header {
  align-items: center;
  display: flex;
  flex-direction: row;
  background-color: var(--gecko-secondary-color);
  color: white;
  height: 52px;
  width: 100%;
  /* Critical: pull flush to all edges with no margin */
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
}

/* ─── Close Button (in header) ──────────────────────────────────────────────── */
#gecko-popout-close {
  color: white;
  font-size: 28px;
  line-height: 1;
  font-weight: bold;
  height: 52px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  /* Reset old absolute positioning */
  position: static;
  top: unset;
  right: unset;
}

#gecko-popout-close:hover {
  color: rgba(255, 255, 255, 0.75);
}

/* ─── Tabs (WP-specific, keep functional) ───────────────────────────────────── */
/* Toggle sits below the header on a clean white strip */
.gecko-cart-toggle {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 0.75);
  background: var(--gecko-secondary-color);
  height: 100%;
}

.gecko-toggle-btn {
  flex: 1;
  padding: 8px 12px;
  /* border: 2px solid var(--gecko-secondary-color); */
  border: unset;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.gecko-toggle-btn.active {
  background-color: rgba(255, 255, 255, 0.75);
  color: var(--gecko-secondary-color);
}

.gecko-toggle-btn:hover:not(.active) {
  background: var(--gecko-secondary-color);
  color: #fff;
  opacity: 0.85;
}

/* ─── Cart Content ──────────────────────────────────────────────────────────── */

.gecko-cart-popout-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.gecko-cart-items {
  max-height: 40vh;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.gecko-cart-items::-webkit-scrollbar {
  display: none;
}

/* ─── Cart Items ────────────────────────────────────────────────────────────── */

.cart-item {
  padding-top: 1rem;
  padding-bottom: 1rem;
  display: flex;
  justify-content: start;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.cart-item-image {
  width: 20%;
  overflow: hidden;
  border-radius: 10px;
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  align-items: start;
  width: 80%;
  gap: 0.4rem;
}

.cart-item-details > h4 {
  color: black;
  margin: 0;
}

.gecko-remove-cart-item {
  background-color: white;
  border: none;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  padding: 0;
  width: auto;
}

.gecko-remove-cart-item:disabled {
  cursor: default;
  opacity: 0.6;
}

.gecko-cart-item-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 0.5rem;
  justify-content: space-between;
  width: 100%;
}

.gecko-cart-item-price {
  margin-left: auto;
}

.gecko-cart-quantity,
.gecko-cart-static-quantity {
  align-items: center;
  color: #36414c;
  display: flex;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  gap: 0.5rem;
}

.gecko-cart-quantity-select {
  background: #fff;
  border: 1px solid #d5dbe1;
  border-radius: 6px;
  color: #111827;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  min-height: 30px;
  padding: 3px 24px 3px 8px;
}

.gecko-cart-quantity-select:disabled,
.gecko-edit-cart-dates:disabled {
  cursor: default;
  opacity: 0.6;
}

.cart-item > p {
  margin: unset;
}

/* ─── Surcharges / Dates ────────────────────────────────────────────────────── */

.cart-dates {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.cart-dates-heading {
  align-items: center;
  display: flex;
  font-weight: 700;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cart-dates > p {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  justify-content: space-between;
  margin: unset;
}

.cart-dates > p span:last-child {
  text-align: right;
}

.gecko-edit-cart-dates {
  align-items: center;
  background: transparent;
  border: 1px solid #d5dbe1;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.gecko-edit-cart-dates svg {
  fill: currentColor;
  height: 16px;
  width: 16px;
}

.gecko-edit-cart-dates:hover {
  background: #f4f6f8;
}

.cart-surcharge {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* ─── Pricing ───────────────────────────────────────────────────────────────── */

.cart-pricing {
  padding-top: 1rem;
  padding-bottom: 1rem;
  /* Match vanilla: muted gray for the totals */
  color: #808e9b;
}

/* ─── Checkout Button ───────────────────────────────────────────────────────── */

/* Wrapper link */
.gecko-checkout-button {
  display: flex;
  width: 100%;
  justify-content: center;
  text-decoration: none;
}

.gecko-checkout-button > button {
  background: var(--gecko-primary-color);
  color: #fff;
  padding: 10px 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  border: none;
  cursor: pointer;
  margin-top: 1rem;
  transition: filter 0.3s ease-in-out;
  text-transform: uppercase;
  font-size: 18px;
  border-radius: 10px;
  width: 100%;
}

.gecko-checkout-button:hover > button {
  filter: brightness(85%);
}

.gecko-checkout-button.is-disabled {
  cursor: default;
  pointer-events: none;
}

.gecko-checkout-button.is-disabled > button,
.gecko-checkout-button > button:disabled {
  background: #d1d5db;
  color: #6b7280;
  cursor: default;
}

.gecko-cart-spinner {
  animation: gecko-cart-spin 0.8s linear infinite;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  display: inline-block;
  height: 14px;
  margin-right: 8px;
  width: 14px;
}

@keyframes gecko-cart-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Floating Cart Button ──────────────────────────────────────────────────── */

.cart-btn {
  height: 50px;
  width: 50px;
  text-align: center;
  text-decoration: none;
  align-items: center;
  padding: 10px;
  font-size: 0;
  justify-content: center;
  border: none;
  border-radius: 30px;
  background-color: var(--gecko-primary-color);
  display: flex;
  cursor: pointer;
  position: fixed;
  bottom: 20px;
  right: 10px;
  z-index: 10000;
}

.cart-btn:hover {
  filter: brightness(85%);
}

.gecko-cart-button-with-badge:not(.cart-btn) {
  position: relative;
}

.gecko-cart-count-badge {
  align-items: center;
  background: var(--gecko-primary-color);
  border: 2px solid #fff;
  border-radius: 999px;
  box-sizing: border-box;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  min-width: 20px;
  min-height: 20px;
  padding: 0 5px;
  pointer-events: none;
  position: absolute;
  right: -6px;
  top: -6px;
  z-index: 1;
}

/* ─── Availability Button ───────────────────────────────────────────────────── */

.gecko-availabilty-button {
  background: var(--gecko-primary-color);
  color: #fff;
  padding: 1em;
  text-align: center;
  display: inline-block;
  border: none;
  cursor: pointer;
  margin-top: 1rem;
  width: fit-content;
  place-self: center;
  font-size: 13px !important;
}

.gecko-availabilty-button:hover {
  filter: brightness(85%);
}

/* ─── Modal (WooCommerce purchase tab) ──────────────────────────────────────── */

#gecko-product-modal {
  position: fixed;
  z-index: 100000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
}

#gecko-product-modal-content {
  background-color: #fff;
  margin: auto;
  padding: 20px;
  border: 1px solid #888;
  position: relative;
  width: 80%;
  height: 700px;
  max-height: 100vh;
  border-radius: 30px;
  transform: scale(0.9);
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

#gecko-product-modal.show #gecko-product-modal-content {
  transform: scale(1);
  opacity: 1;
}

@media (max-width: 767px) {
  #gecko-product-modal-content {
    width: 100%;
    margin: auto 0;
  }
}

/* Modal close button */
#gecko-cart-close {
  background: transparent;
  border: 0;
  color: #aaa;
  cursor: pointer;
  font-size: 28px;
  line-height: 14px;
  font-weight: bold;
  padding: 0;
  position: absolute;
  top: 12px;
  right: 12px;
}

#gecko-cart-close:hover,
#gecko-cart-close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* ─── Utility ───────────────────────────────────────────────────────────────── */

.gecko-hidden {
  display: none !important;
}

.wait-for-js {
  opacity: 0.5;
  filter: blur(0.5rem);
  pointer-events: none;
}
