/* ==========================================================================
   Modular Custom Styles for Cart View (Fully Independent)
   ========================================================================== */

.gap-1 {
  gap: 4px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 16px;
}

.gap-4 {
  gap: 24px;
}

.cursor-pointer {
  cursor: pointer;
}

/* Typography */
.cart-page-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #111;
}

/* Continue Shopping Button */
.continue-shopping-btn {
  border: 1px solid #111;
  color: #111;
  border-radius: 50px;
  padding: 8px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  background-color: transparent;
  transition: all 0.3s ease;
}

.continue-shopping-btn:hover {
  background-color: #111;
  color: #fff;
}

html[dir="rtl"] .rtl-flip-justify {
  justify-content: flex-end !important;
}

/* Cart Summary Box */
.cart-summary-box {
  background-color: #fafafa;
  border-radius: 24px;
  padding: 40px;
}

.summary-header {
  margin-bottom: 24px !important;
}

.summary-total-label,
.summary-total-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: #111;
}

/* Flexbox Layout */
.cart-flex-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 992px) {
  .cart-flex-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
  }

  .cart-products-panel {
    flex: 1;
    min-width: 0;
  }

  .cart-summary-panel {
    width: 450px;
    flex-shrink: 0;
  }
}

.summary-tax-text {
  font-size: 0.9rem;
  color: #aaa;
}

/* Textarea / Note Box */
.summary-note-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
  display: block;
}

.summary-textarea {
  background-color: #fafafa;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  font-size: 1rem;
  color: #111;
  box-shadow: none;
  transition: border-color 0.3s;
}

.summary-textarea:focus {
  border-color: #111;
  box-shadow: none;
  outline: none;
}

/* Checkout Pill Buttons */
.cart-btn-black {
  border-radius: 50px !important;
  height: 56px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.cart-btn-black:hover {
  opacity: 0.85;
}

/* Trendlet Sliding Hover Effect */
.btn-trendlet-hover {
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: color 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border: none !important;
}

.btn-trendlet-hover::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background-color: var(--primary-color, #1a1a1a);
  z-index: -1;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-trendlet-hover:hover {
  color: var(--text-color-primary-bg, #fff) !important;
  text-decoration: none !important;
}

.btn-trendlet-hover:hover::before {
  transform: translateY(0);
}

/* Apply to specific buttons */
.cart-btn-black {
  background-color: #000 !important;
  color: #fff !important;
  border: 1px solid #000 !important;
}

.btn-trendlet-hover.cart-btn-black::before {
  background-color: #fff;
}

.btn-trendlet-hover.cart-btn-black:hover {
  color: #000 !important;
}

.btn-apply-coupon {
  background-color: #000 !important;
  color: #fff !important;
  border: none !important;
}

/* Coupon Details (Accordion pure CSS) */
.coupon-details {
  border: 1px solid #eaeaea;
  border-radius: 16px;
  overflow: hidden;
  background-color: #fff;
}

.coupon-details summary {
  padding: 24px;
  cursor: pointer;
  list-style: none;
  /* Hide default arrow */
}

/* Hide default arrow for Webkit */
.coupon-details summary::-webkit-details-marker {
  display: none;
}

.coupon-details summary .coupon-icon {
  transition: transform 0.3s ease;
}

.coupon-details[open] summary .coupon-icon {
  transform: rotate(180deg);
}

.coupon-details .coupon-content {
  padding: 0 24px 24px;
}

.continue-shopping-btn {
  padding: 8px 20px !important;
  border-radius: 999px !important;
  background-color: #fafafa !important;
  color: #111 !important;
  border: 1px solid #eee !important;
}

/* Custom Product List Reset & Layout */
.custom-products-list .trendlet-cart-item {
  border-bottom: 1px solid #f0f0f0 !important;
}

.custom-products-list .trendlet-cart-item:last-child {
  border-bottom: none !important;
}

.cart-item-img-wrapper {
  display: block;
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #f5f5f5;
  background-color: #fff;
  padding: 5px;
  border-radius: 12px;
}

.cart-item-title-link {
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 700;
  color: #111;
  text-decoration: none;
  transition: color 0.2s;
}

.cart-item-title-link:hover {
  color: #555;
  text-decoration: none;
}

.cart-qty-outer {
  background-color: #fafafa;
  border: 1px solid #f0f0f0;
  width: 75px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  padding: 0 8px;
}

.cart-qty-input {
  width: 30px;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  font-weight: 700;
  text-align: center;
}

.cart-qty-btn {
  height: 12px;
  line-height: 0;
  padding: 0;
  color: #111;
  border: none;
  background: none;
}

.cart-qty-btn.btn-decrease {
  margin-top: 4px;
}

.cart-item-total-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111;
  min-width: 110px;
}

.cart-remove-link {
  transition: color 0.2s;
}

.cart-remove-link:hover {
  color: #111 !important;
  text-decoration: underline !important;
}

/* Quantity Control */
.quantity-control-trendlet input[type=number]::-webkit-inner-spin-button,
.quantity-control-trendlet input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quantity-control-trendlet input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Coupon Accordion & Form */
.coupon-card {
  border: 1px solid #eaeaea !important;
  border-radius: 16px !important;
  overflow: hidden;
}

.coupon-collapse-btn {
  text-align: start !important;
  text-decoration: none !important;
  box-shadow: none !important;
  padding: 32px 24px !important;
}

.coupon-btn-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: #111;
}

.rtl-form-group {
  display: flex;
  gap: 0 !important;
}

.rtl-form-group .send-coupon {
  height: 50px !important;
  border: 1px solid #eaeaea !important;
  box-shadow: none !important;
  font-size: 0.95rem !important;
  background-color: #fff !important;
}

.rtl-form-group .send-coupon:focus {
  border-color: #111 !important;
}

.rtl-form-group .btn-apply-coupon {
  height: 50px !important;
  font-weight: 600 !important;
  padding: 0 24px !important;
  white-space: nowrap !important;
}

/* For RTL */
html[dir="rtl"] .rtl-form-group .send-coupon {
  border-radius: 0 8px 8px 0 !important;
  border-left: none !important;
}

html[dir="rtl"] .rtl-form-group .btn-apply-coupon {
  border-radius: 8px 0 0 8px !important;
  border-right: none !important;
}

/* For LTR */
html[dir="ltr"] .rtl-form-group .send-coupon {
  border-radius: 8px 0 0 8px !important;
  border-right: none !important;
}

html[dir="ltr"] .rtl-form-group .btn-apply-coupon {
  border-radius: 0 8px 8px 0 !important;
  border-left: none !important;
}

.summary-total-value {
  font-family: inherit;
}

/* Empty Cart State */
.empty-cart-icon {
  font-size: 90px;
  color: #111;
}

.empty-cart-msg {
  color: #111;
  font-weight: 700;
  margin-top: 24px;
}

/* Mobile Responsive Refinement */
@media (max-width: 991.98px) {
  .cart-view .trendlet-cart-item {
    flex-wrap: nowrap !important;
    gap: 6px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .cart-view .trendlet-cart-item .cart-item-image {
    width: 55px;
    min-width: 55px;
    height: 55px;
    flex-shrink: 0;
  }

  .cart-view .trendlet-cart-item .cart-item-img-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
  }

  .cart-view .trendlet-cart-item .cart-item-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .cart-view .trendlet-cart-item .cart-item-details {
    flex-grow: 1;
    min-width: 0;
    padding: 0 4px;
    text-align: right;
  }

  .cart-view .trendlet-cart-item .cart-item-title-link {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    display: block;
    word-break: break-word;
    white-space: normal;
  }

  .cart-view .trendlet-cart-item .x-small-text {
    font-size: 10px;
    line-height: 1.2;
    display: block;
    color: #777;
    white-space: normal;
  }

  .cart-view .trendlet-cart-item .cart-item-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    width: auto;
    min-width: 85px;
    justify-content: center;
  }

  .cart-view .trendlet-cart-item .cart-qty-outer {
    width: 52px;
    height: 28px;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .cart-view .trendlet-cart-item .cart-qty-input {
    font-size: 11px;
    width: 20px;
  }

  .cart-view .trendlet-cart-item .cart-qty-btn svg {
    width: 6px;
    height: 6px;
  }

  .cart-view .trendlet-cart-item .cart-remove-link {
    font-size: 11px;
    white-space: nowrap;
    color: #dc3545;
    text-decoration: none;
  }

  .cart-view .trendlet-cart-item .cart-item-total {
    width: 75px;
    min-width: 75px;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    flex-shrink: 0;
    line-height: 1;
  }

  /* Tablet Adjustments */
  @media (min-width: 500px) {
    .cart-view .trendlet-cart-item {
        gap: 12px;
    }
    .cart-view .trendlet-cart-item .cart-item-image {
        width: 65px;
        min-width: 65px;
        height: 65px;
    }
    .cart-view .trendlet-cart-item .cart-item-title-link {
        font-size: 13px;
    }
    .cart-view .trendlet-cart-item .cart-item-actions {
        min-width: 100px;
        gap: 10px;
    }
    .cart-view .trendlet-cart-item .cart-item-total {
        width: 85px;
        min-width: 85px;
        font-size: 13px;
    }
  }
}