/* Cart Page CSS - Adapted from Figma */

/* Overall Container */
.cart-container {
  padding-top: 150px;
  padding-bottom: 90px;
  /* position: relative; */
  min-height: 650px;
}

/* Page Title */
.cart-page-title {
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #303030;
  margin-bottom: 25px;
}

/* Pincode Bar */
.cart-pincode-bar {
  background: #e6f8ff;
  border-radius: 10px;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.pincode-label {
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: #000;
}

.pincode-value {
  color: #00a5f1;
  font-weight: 700;
}

.btn-change-pincode {
  background: #fff;
  color: #00a5f1;

  border: 1px solid #00a5f1;
  border-radius: 25px;
  padding: 5px 10px;
  font-size: 12px;
  font-family: "DM Sans", sans-serif;
  cursor: pointer;
}

/* --- Left Side: Cycle Item --- */
.cart-item-card {
  background: #ffffff;
  border-radius: 25px;
  padding: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  position: relative;
}

/* Image Box */
.cart-item-img-box {
  width: 180px;
  height: 130px;
  background: #ffffff;
  border: 1px solid #e7eef1;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Details */
.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #000000;
  margin-bottom: 8px;
}

.cart-item-specs {
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: #303030;
}

.cart-item-price {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 18px;
  color: #303030;
}

.cart-item-price small {
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #303030;
}

/* Accessories List inside Item */
.cart-item-accessories-label {
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #303030;
  margin-top: 15px;
}

.cart-item-accessories-text {
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: #303030;
}

.cart-item-accessories {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.cart-item-accessories-left {
  display: flex;
  flex-direction: column;
}

/* Tenure Pill */
.cart-tenure-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #00a5f1;
  border-radius: 40px;
  padding: 6px 15px;
  background: #ffffff;
  color: #00a5f1;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 20px;
}

.cart-tenure-pill i {
  margin-left: 8px;
  font-size: 12px;
}

/* Add Buttons Below Item */
.cart-separator-dashed {
  width: 100%;
  height: 0;
  border-top: 1px dashed #e7eef1;
  margin: 15px 0;
}

.add-cycle-separator {
  width: 100%;
  height: 0;
  border-top: 1px solid #e7eef1;
  margin: 18px 0;
}

.cart-add-row {
  display: flex;
  gap: 15px;
}

.btn-cart-action {
  height: 40px;
  background: #ffffff;
  border: 1px solid #303030;
  border-radius: 30px;
  padding: 0 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: #303030;
  min-width: 140px;
  justify-content: center;
}

.btn-cart-action.add-cycle {
  width: 100%;
}

/* --- Right Side: Summary Box --- */
.cart-summary-box {
  background: #ffffff;
}

/* Header */
.cart-summary-header {
  background: #e6f8ff;
  border-radius: 12px;
  padding: 18px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.cart-summary-title {
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #303030;
}

/* Line Items */
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  padding: 0 10px;
}

.cart-summary-label {
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #303030;
}

.cart-summary-value {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 18px;
  color: #303030;
  text-align: right;
}

/* Total Section */
.cart-summary-divider {
  border-top: 1px dashed #e7eef1;
  margin: 18px 0;
}

.cart-summary-total-label {
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #303030;
}

.cart-summary-total-value {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 18px;
  color: #303030;
  text-align: right;
}

.cart-note {
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: #303030;
  text-align: right;
  margin-top: 6px;
  display: block;
}

/* Payment Plan Buttons (New Design) */
.btn-payment-plan {
  background: linear-gradient(180deg, #21b9ff 0%, #00a5f1 100%);
  border-radius: 50px; /* Pill shape */
  border: none;
  width: 100%;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    background 0.2s;
  height: auto;
  min-height: 60px;
  color: #ffffff;
  position: relative;
}

.btn-payment-plan:hover {
  background: linear-gradient(180deg, #21b9ff 0%, #00a5f1 100%);
  transform: translateY(-1px);
}

.btn-payment-plan:active {
  transform: translateY(1px);
}

.plan-amount-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.2;
}

.plan-amount {
  font-family: "DM Sans", sans-serif;
  font-weight: 500; /* Medium/Regular look */
  font-size: 15px;
}

.plan-strikethrough {
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  font-size: 16px;
  text-decoration: line-through;
  opacity: 0.8;
}

.plan-subtitle {
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  font-size: 14px;
  margin-top: 2px;
  opacity: 0.9;
}

/* Checkout Button */
.btn-checkout {
  background: linear-gradient(180deg, #21b9ff 0%, #00a5f1 100%);
  border-radius: 200px;
  border: none;
  width: 100%;
  height: 50px;
  font-family: "DM Sans", sans-serif;
  /* font-weight: 500; */
  font-size: 16px;
  color: #ffffff;
  margin-top: 25px;
  cursor: pointer;
}

.acc-slider-container {
  z-index: 999999 !important;
}

/* Delete Button */
.btn-cart-delete {
  background: transparent;
  border: none;
  color: #000;
  font-size: 18px;
  padding: 8px;
  cursor: pointer;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-cart-delete:hover {
  color: #303030;
}

/* Responsive */
@media (max-width: 768px) {
  .btn-cart-action.add-cycle {
    width: 100%;
  }

  .btn-cart-d-none {
    display: none !important;
  }

  /* .btn-checkout {
    display: none !important;
  }

  .mobile-sticky-footer {
    display: block !important;
} */

  .btn-go-back-cart {
    display: none !important;
  }

  /* Refined Mobile Cart Item Styling */
  .cart-item-card {
    padding: 0px;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap !important; /* Allow prebooking/accessories to wrap below */
  }

  .cart-item-img-box {
    width: 160px;
    height: 100px;
    border-radius: 20px;
    flex-shrink: 0;
  }

  .cart-item-details {
    width: calc(100% - 125px); /* Ensure details stay beside image */
    flex: 1;
    min-width: 0;
  }

  .cart-item-name {
    font-size: 14px;
    margin-bottom: 2px;
    padding-right: 5px;
  }

  .cart-item-specs {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .cart-item-price {
    font-size: 15px;
  }

  .cart-item-controls {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    overflow: visible !important;
  }

  /* Compact Qty Selector on Mobile */
  .qty-selector {
    padding: 2px 4px !important;
    gap: 2px !important;
  }

  .btn-qty {
    padding: 0 4px !important;
    font-size: 14px !important;
  }

  .qty-val {
    margin: 0 4px !important;
    font-size: 13px !important;
  }

  .cart-tenure-pill {
    padding: 4px 8px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .btn-cart-remove {
    padding: 8px !important;
    margin-left: 0 !important;
  }

  /* Hide the default accessories section inside details on mobile */
  .cart-item-details .cart-item-accessories {
    display: none !important;
  }

  /* Accessories Mobile Layout (Duplicated Block) */
  .mobile-cart-acc-block {
    width: 100% !important;
    margin-top: 8px !important;
    border-top: 1px dashed #e7eef1 !important;
    padding-top: 12px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
  }

  .cart-item-accessories-left {
    flex: 1 !important;
    min-width: 0 !important; /* Critical for text-overflow to work in flex */
  }

  .cart-item-accessories-label {
    margin-top: 0;
    margin-bottom: 2px;
    font-size: 13px;
    white-space: nowrap;
  }

  .cart-item-accessories-text {
    font-size: 12px;
    line-height: 1.3;
    color: #303030;
    font-weight: 500;
    /* Allow wrapping but keep it clean, or keep it one line if user insists */
    /* Based on "none of them should wrap up", let's try to keep it one line with truncation or just very flexible */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  /* Target the + Add button inside accessories */
  .cart-item-accessories .btn-cart-action {
    flex-shrink: 0 !important;
    min-width: 70px !important;
    height: 30px !important;
    font-size: 12px !important;
    padding: 0 12px !important;
    border-radius: 20px !important;
  }

  /* Sticky Footer for Checkout */
  .mobile-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    padding: 15px 25px;
    z-index: 10005;
    display: flex;
    flex-direction: column;
  }

  .mobile-sticky-footer .btn-checkout {
    margin-top: 5px;
    margin-bottom: 5px;
  }

  .cart-container {
    padding-bottom: 120px;
    padding-top: 85px;
  }

  /* Delivery Overlay Styles */
  #delivery-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    overflow-y: auto;
    padding-bottom: 20px;
    display: none;
  }

  .delivery-header-container {
    background: #fff;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 1060;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
  }

  .delivery-overlay-back-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #303030;
    font-weight: 500;
  }

  .delivery-container {
    padding: 0;
  }

  .delivery-toggle-wrapper,
  #delivery-pickup-mode,
  #delivery-address-mode,
  #delivery-add-mode {
    background: #fff;
    padding: 5px;
    margin-bottom: 10px;
  }

  .cart-pincode-bar {
    margin-left: -14px !important;
    margin-right: -14px !important;
    border-radius: 0px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .pincode-label {
    display: none;
  }

  .deliveryto-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: space-between;
    width: 100%;
  }

  .mobile-sticky-footer {
    display: none;
  }

  .cart-summary-value {
    font-size: 16px;
  }

  .cart-summary-label {
    font-size: 14px;
  }

  .cart-summary-total-label {
    font-size: 16px;
  }

  .cart-summary-total-value {
    font-size: 18px;
  }

  .cart-summary-header {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    background-color: transparent;
  }
}

/* Default hidden for desktop */
.delivery-overlay-back-btn {
  display: none;
}

/* New Summary Styles */
.cart-summary-item-name {
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #303030;
  margin-bottom: 18px;
  padding: 0 10px;
}

.cart-summary-divider-thick {
  border-top: 1px solid #e7eef1;
  margin: 25px 0;
}

.cart-vertical-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 1px solid #e7eef1;
}

.cart-summary-grand-label {
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #000;
}

.cart-summary-grand-value {
  font-family: "Courier New", monospace;
  font-weight: 800;
  font-size: 22px;
  color: #000;
  text-align: right;
}

.embed-map-responsive {
  position: relative;
  text-align: right;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  /* Square aspect ratio for the container */
}

.embed-map-container {
  overflow: hidden;
  background: none !important;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.embed-map-frame {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
}

@media (min-width: 992px) {
  .col-lg-1 {
    flex: 0 0 auto;
    width: 3.333333%;
  }
}

/* --- New Sticky Footer & Visibility Logic --- */

/* Desktop Actions Wrapper */
.desktop-cart-actions {
  display: block;
}

/* Mobile Sticky Footer */
.mobile-sticky-footer {
  display: none; /* Hidden by default on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  padding: 15px 25px;
  z-index: 10005;
  flex-direction: column;
}

.mobile-sticky-footer .btn-checkout {
  margin-top: 5px;
  margin-bottom: 5px;
}

/* Mobile Overrides */
@media (max-width: 768px) {
  .desktop-cart-actions {
    display: none !important;
  }

  .mobile-sticky-footer {
    display: flex !important;
  }

  body.map-fullscreen-active .mobile-sticky-footer {
    display: none !important;
  }

  /* Ensure existing cart styles don't conflict */
  .cart-summary-box {
    padding-bottom: 20px; /* Space for footer if needed, though sticky sits on top */
  }
}

body.cart-is-empty .mobile-sticky-footer {
  display: none !important;
}

/* Hide sticky footer while main preloader is active */
#js-preloader:not(.loaded) ~ #mobile-sticky-footer {
  display: none !important;
}
