/* 
 * Xi Woo Cart Styles
 * 
 * Styles for:
 * - Cart items
 * - Quantity controls
 * - Cart totals
 * - Order summary
 */

/* ==========================================================================
   Cart Items
   ========================================================================== */
/* Empty Cart */
.xi-cart-empty {
  text-align: center;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  max-width: 720px;
  margin: 24px auto;
}

/* Style WooCommerce default empty-cart fallback to match our design */
.cart-empty {
  text-align: center;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  max-width: 720px;
  margin: 24px auto;
  color: #0C2633;
  position: relative;
}

.cart-empty::before {
  content: "";
  width: 72px;
  height: 72px;
  position: relative;
  top: 0;
  left: 0%;
  /* transform: translateX(-50%); */
  right:0;
  margin:0 auto;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2Zm10 0c-1.1 0-1.99.9-1.99 2S15.9 22 17 22s2-.9 2-2-.9-2-2-2ZM7.16 14h9.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49A1 1 0 0 0 21.1 5H6.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7.42c-.14 0-.25-.11-.26-.25l.01-.06.99-1.69Z' fill='%23FE6B01'/%3E%3C/svg%3E");
}

.return-to-shop .button {
  display: flex!important;
  align-items: center!important;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px 10px 18px!important;
  border-radius: 999px;
  border: 1px solid #E8E8E8!important;
  color: #0C2633!important;
  background: #fff;
  margin:0 auto!important;
  width: max-content!important;
}

.return-to-shop .button:hover {
  background: #FE6B01!important;
  color: #fff!important;
  border-color: #FE6B01!important;
}

.xi-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* cart orange svg */
  background-image: url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2Zm10 0c-1.1 0-1.99.9-1.99 2S15.9 22 17 22s2-.9 2-2-.9-2-2-2ZM7.16 14h9.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49A1 1 0 0 0 21.1 5H6.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7.42c-.14 0-.25-.11-.26-.25l.01-.06.99-1.69Z' fill='%23FE6B01'/%3E%3C/svg%3E");
}

.xi-empty-title {
  margin: 8px 0 4px;
  font-weight: 700;
  color: #0C2633;
}

.xi-empty-subtitle {
  margin: 0 0 16px;
  color: #556871;
}

.xi-empty-cart-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px 10px 40px;
  border-radius: 999px;
  border: 1px solid #E8E8E8;
  color: #0C2633;
  text-decoration: none;
  position: relative;
}

.xi-empty-cart-link:hover {
  background: #FE6B01;
  border-color: #FE6B01;
  color: #fff;
}

.xi-empty-cart-link::before {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5v6m0 0v6m0-6h6m-6 0H6' stroke='%230C2633' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

   .xi-cart-items {
    /* background: #fff;
    box-shadow: 0px 0px 1px 1px rgba(153, 153, 153, 0.2); */
    border-radius: 10px;
    margin-bottom: 20px;
  }
  
  .xi-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    margin-bottom: 5px;
    background-color: white;
    border-bottom: 1px solid #eee;
  }
  
  .xi-cart-item:last-child {
    border-bottom: none;
  }
  
  /* Product Column */
  .product-col {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 15px;
  }
  
  .product-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
  }
  
  .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
  }
  
  .product-name {
    font-weight: 400;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 15px;
    padding-left: 10px;
  }
  
  .product-name .woocommerce-Price-amount.amount bdi {
    font-weight: 600 !important;
    font-size: 1.3rem !important;
    color: #999;
  }
  
  .xi-button[name="apply_coupon"] 
  {
    color:#fff!important;
    font-weight:400!important;
  }
  /* Total Column */
  .total-col {
    width: 100px;
    text-align: left;
    font-weight: 600;
  }
  
  .total-col .bdi {
    font-weight: 600;
    font-size: 2rem !important;
  }
  
  /* Delete Column */
  .delete-col {
    width: 40px;
    margin-right: 5px;
    display: flex;
    align-items: center;
    justify-content: end;
  }
  
  /* Base style for all remove links */
  .cart-item-remove {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 50%;
    color: #999;
    font-size: 20px;
  }
  
  /* Style for trash icon (desktop and mobile) */
  .cart-item-remove::before {
    content: "\f182";
    font-family: dashicons;
    display: block;
    font-size: 20px;
    color: #999;
  }
  
  /* Hover styles */
  .cart-item-remove:hover::before {
    color: #dc3545;
  }
  
  .cart-item-remove:hover {
    background: #fff5f5;
  }
  
  /* ==========================================================================
     Cart Items -- Responsive
     ========================================================================== */
  
  /* Optional: Adjust font sizes for mobile */
  @media (max-width: 768px) {
    .xi-cart-items {
      background: none;
    }
  
    .xi-cart-item {
      margin-bottom: 10px;
      padding:10px!important;
      background-color: white;
      box-shadow: 0px 0px 1px 1px rgba(153, 153, 153, 0.2);
      flex-wrap:wrap;
    }
    .product-name {
      font-size: 1rem; /* Adjust font size for mobile */
    }
  }
  
  /* ==========================================================================
       Quantity Controls
       ========================================================================== */
  
  .quantity-col {
    width: 140px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .quantity-wrapper {
    width: 108px;
    display: inline-flex;
    align-items: stretch;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
  }
  
  .quantity-minus,
  .quantity-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: none;
    background: #f7f7f7;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s;
  }
  
  .quantity-minus:hover,
  .quantity-plus:hover {
    background: #e7e7e7;
  }
  
  .qty-input {
    width: 40px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-left: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: normal !important;
    background: #fff !important;
    -moz-appearance: textfield !important;
  }
  
  .qty-input::-webkit-outer-spin-button,
  .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  
  /* ==========================================================================
       Cart Totals & Summary
       ========================================================================== */
  
  .xi-cart-totals {
    width: 100%;
    box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.3);
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    align-self: self-start;
  }
  
  .xi-cart-totals-content,
  .xi-cart-thanks-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* align-items: self-end; */
    /* height: 100%; */
  }
  
  .cart-summary-title {
    margin-right: 10px;
    font-size: 1.8rem;
    margin-bottom: 0px;
    font-weight: 600;
  }
  
  /* Shipping Progress */
  .xi-shipping-progress {
    margin-bottom: 0px;
    padding: 15px;
    background: #f7f7f7;
    border-radius: 4px;
    order: -1;
  }
  
  .progress-text {
    margin-bottom: 10px;
    text-align: center;
    font-weight: 500;
    font-size: 1.3rem;
  }
  
  .missing-amount {
    font-weight: 600;
    font-size: 2rem;
    color: rgb(255, 102, 0);
  }
  
  .cart-shipping,
  .cart-subtotal {
    font-weight: 700 !important;
    font-size: 1.2rem;
  }
  
  .xi-shipping-achieved {
    margin-bottom: 20px;
    padding: 10px;
    /* background-color: #FE6B01;
    border-radius: 10px; */
    text-align: center;
    color: #333;
    font-weight: 500;
  }
  
  /* Totals Table */
  .xi-cart-totals-table {
    width: 100%;
    margin-bottom: auto;
  }
  
  .xi-cart-totals-table th,
  .xi-cart-totals-table td {
    padding: 10px;
    text-align: right;
    vertical-align: middle;
  }
  
  .xi-cart-totals-table td {
    text-align: left;
  }
  
  .xi-cart-totals-table .order-total {
    font-weight: 600;
    font-size: 1.2rem;
    border-top: 2px solid #eee;
  }
  
  .xi-cart-totals-table .order-total th {
    font-weight: 600;
    font-size: 1.2rem;
  }
  .xi-cart-totals-table .cart-shipping th {
    font-weight: 600;
    font-size: 1.2rem;
  }
  
  .woocommerce-Price-amount.amount bdi {
    font-weight: 600 !important;
    font-size: 1.5rem !important;
  }
  
  .xi-cart-item .woocommerce-Price-amount.amount bdi
  {
    font-size: 1.2rem !important;
  }
  .xi-cart-totals .woocommerce-Price-amount.amount bdi 
  {
    font-size: 1.1rem !important;
  }
  /* ==========================================================================
       Order Summary
       ========================================================================== */
  
  .xi-order-summary {
    padding: 10px;
    background: #f8f8f8;
    border-radius: 4px;
  }
  .cart-summary-title
  {
    opacity: 1!important;
  }
  .xi-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10px;
    margin: 5px 0;
    background-color: white;
    gap:10px;
    box-shadow: 0px 0px 1px 1px rgba(153, 153, 153, 0.2);
    border-radius: 10px;
    border-bottom: 1px solid #eee;
  }
  
  .xi-summary-item .item-name {
    font-size: 13px;
    font-weight: 500;
  }
  
  .xi-summary-item .item-total {
    font-weight: 500;
    width: auto;
    height: auto;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.3); */
    padding: 5px 0;
  }
  
  .xi-summary-item:last-child {
    border-bottom: none;
  }
  
  .item-details {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .item-quantity {
    color: #ffffff;
    background: #FE6B01;
    font-size: 0.9em;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 0;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
  }
  
  .xi-summary-totals {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #ddd;
  }
  
  .summary-subtotal,
  .summary-total {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
  }
  
  .summary-total {
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 10px;
  }
  
  /* ==========================================================================
       Responsive Mobile Cart
       ========================================================================== */
  
  @media (max-width: 768px) {
    /* Mobile Cart Item Layout */
    .xi-cart-item {
      position: relative;
      padding: 15px;
      border-bottom: 1px solid #eee;
      min-height: 120px;
  }

/* ==========================================================================
   Cross Sells (Step 1)
   ========================================================================== */

}

.xi-cart-wrapper .xi-cross-sells {
  width: 100%;
  margin: 20px 0;
}

.xi-cart-wrapper .xi-cross-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 10px 0 15px;
  color: #0C2633;
  text-align: right;
}

/* .xi-cart-wrapper .xi-cross-list { gap: 16px; } */

/* Make cards equal height in bootstrap row */
.xi-cart-wrapper .xi-cross-sells .row > [class*="col-"] {
  display: flex;
}

.xi-cart-wrapper .xi-cross-card {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: 12px !important;
  padding: 12px !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  width: 100%;
}

.xi-cart-wrapper .xi-cross-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.xi-cart-wrapper .xi-cross-name {
  margin: 10px 0 6px;
  font-size: 14px;
  color: #0C2633;
  text-decoration: none;
  /* exactly two lines (min and max) */
  line-height: 1.3;
  height: calc(1.3em * 2);
  min-height: calc(1.3em * 2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.xi-cart-wrapper .xi-cross-name:hover {
  color: #fe6b01;
}

.xi-cart-wrapper .xi-cross-price {
  margin-bottom: 8px;
  color: #fe6b01;
  font-weight: 600;
}

.xi-cart-wrapper .xi-cross-action .button,
.xi-cart-wrapper .xi-cross-action .add_to_cart_button,
.xi-cart-wrapper .xi-cross-action .xi-cross-btn {
  border: 1px solid #E8E8E8;
  border-radius: 100px;
  background: transparent;
  color: #0C2633;
  padding:10px 18px 10px 40px !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  position: relative;
  text-decoration: none;
}

.xi-cart-wrapper .xi-cross-action .button:hover,
.xi-cart-wrapper .xi-cross-action .add_to_cart_button:hover,
.xi-cart-wrapper .xi-cross-action .xi-cross-btn:hover {
  background: #fe6b01;
  color: #ffffff;
  border-color: #fe6b01;
}

/* Push button to bottom for consistent card heights */
.xi-cart-wrapper .xi-cross-action { margin-top: auto; }

/* Cart icon inside add to cart button (orange cart, RTL-friendly) */
.xi-cart-wrapper .xi-cross-action .add_to_cart_button::before,
.xi-cart-wrapper .xi-cross-action .button.product_type_simple::before,
.xi-cart-wrapper .xi-cross-action .xi-cross-btn::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  position: absolute;
  left: 14px; /* icon on the left side inside pill */
  top: 50%;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* Orange cart SVG */
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2Zm10 0c-1.1 0-1.99.9-1.99 2S15.9 22 17 22s2-.9 2-2-.9-2-2-2ZM7.16 14h9.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49A1 1 0 0 0 21.1 5H6.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7.42c-.14 0-.25-.11-.26-.25l.01-.06.99-1.69Z' fill='%23FE6B01'/%3E%3C/svg%3E");
}

.xi-cart-wrapper .xi-cross-action .add_to_cart_button:hover::before,
.xi-cart-wrapper .xi-cross-action .button.product_type_simple:hover::before,
.xi-cart-wrapper .xi-cross-action .xi-cross-btn:hover::before {
  filter: brightness(0) invert(1);
}

/* Responsive handled by Bootstrap cols */
  
@media (max-width: 768px) {
    /* Product name now at top */
    .product-col {
      /* position: absolute; */
      width: 100%;
      top: 15px;
      right: 10px;
      left: 10px;
      padding-bottom: 0px;
      flex:auto!important;
    }
  
    /* Controls row now below */
    .quantity-col,
    .total-col,
    .delete-col {
      position: relative;
      top: 0;
    }
  
    .delete-col {
      left: 15px;
      margin-right: 0;
      margin-top: 4px;
    }
  
    .total-col {
      /* left: 80px; */
      width: auto;
    }
  
    .xi-cart-navigation {
      margin-top: 30px !important;
    }
  
    .xi-order-summary,
    .cart-summary-title {
      display: none;
    }
  
    /* Coupon section spacing */
    @media (max-width: 768px) {
      .xi-coupon-section {
        margin-top: 20px;
        border-top: 1px solid #eee;
        background-color: white;
        padding: 10px 0;
        margin-bottom: 0!important;
      }
      .xi-cross-list .woocommerce-Price-amount.amount bdi 
      {
        font-size: 1.2rem!important;
      }
      .xi-cart-wrapper .xi-cross-action .xi-cross-btn
      {
        width: 100%;
        padding:10px 10px 10px 35px !important;
      }
    }
  }
  