/* Cart Drawer Styles */

/* Cart Icon Button */
.ico-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  /* border-radius: 50%; */
  /* background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%); */
  /* color: #fff; */
  font-size: 18px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  /* box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3); */
}

  .ico-cart:hover {
    transform: translateY(-2px);
    /* box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4); */
    /* color: #fff; */
  }

  .ico-cart i {
    font-size: 18px;
  }

.cart-qty {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--pc);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* Overlay */
.cart-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

  .cart-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
  }

/* Drawer Container */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  max-width: 100%;
  height: 100%;
  background-color: #fafafa;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

  .cart-drawer.open {
    right: 0;
  }

/* Body Scroll Lock Removed */


/* Header */
.cart-drawer-header {
  color: var(--black);
  padding: 16px 20px;
  /* Reduced padding */
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: none;
}

/* ... existing code ... */

/* Body */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  /* Reduced padding */
}



.merchant-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  /* Reduced padding */
  background: #F0F8FF;
  border-bottom: 1px solid #eef4f9;
}

/* ... */


/* ... */

/* Footer */



.cart-drawer-close {
  background: transparent;
  border: none;
  color: var(--black);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

/* Body */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  /* Increased padding */
}

/* ... existing code ... */

/* Merchant Cart Section */
.merchant-cart-section {
  background: #fff;
  border-radius: 16px;
  /* Distinct radius */
  margin-bottom: 28px;
  /* More space between cards */
  /* Stronger shadow for depth */
  overflow: hidden;
  border: 1px solid var(--grey);
}

.merchant-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  /* Increased padding */
  background: var(--light-blue);
  border-bottom: 1px solid var(--grey);
}

.merchant-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.merchant-logo {
  width: 48px;
  /* Slightly larger */
  height: 48px;
  border-radius: 50%;
  /* Fully Rounded */
  object-fit: cover;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  background: #fff;
  /* Ensure bg if transparent image */
}

.merchant-logo-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  /* Fully Rounded */
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  color: #999;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.merchant-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.merchant-label {
  font-size: 11px;
  color: #666;
  margin-bottom: 2px;
  font-weight: 500;
}

.merchant-details-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

  .merchant-details-link:hover .merchant-name {
    color: var(--pc);
    /* Orange highlight on hover */
    text-decoration: underline;
  }

.merchant-name {
  font-size: 15px;
  color: #1a1a1a;
  font-weight: 700;
  line-height: 1.2;
}

.merchant-delivery-time {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #15171d;
}

.merchant-cart-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #8b909a;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 0 1px #eceef3 inset;
}

.merchant-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 4px;
}

.merchant-cart-delete-btn:hover {
  color: #e53935;
  box-shadow: 0 0 0 1px #f7c8c5 inset;
}
  .merchant-link:hover {
    color: var(--pc);
    transform: translateX(2px);
  }

/* Cart Items */
.merchant-cart-items {
  padding: 0 10px;
  /* Short/Standard padding */
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--grey);
}

  .cart-item:last-child {
    border-bottom: none;
  }

.cart-item-image {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #f0f0f0;
  background: #f9f9f9;
}

  .cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

.cart-item-image-placeholder {
  width: 100%;
  height: 100%;
  background: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ddd;
  font-size: 20px;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

  .cart-item-name:hover {
    color: var(--pc);
  }

.cart-item-attributes {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}

/* Missing Pill Styling Restored */
.cart-item-quantity {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  /* Rounded pill shape */
  padding: 0;
  overflow: hidden;
}

.qty-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s;
}

  .qty-btn svg {
    color: #333;
    transition: all 0.2s;
  }

  .qty-btn:hover {
    background: #f5f5f5;
    color: var(--pc);
  }

    .qty-btn:hover svg {
      color: var(--pc);
    }

  .qty-btn:active {
    transform: scale(0.95);
  }

.qty-value {
  width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.cart-item-price {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.item-saving {
  color: #e53935;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-align: right;
  flex-shrink: 0;
}

.item-price-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-item-price .original-price {
  color: #8f8f98;
  text-decoration: line-through;
  font-size: 14px;
  font-weight: 400;
}


/* Footer */
.merchant-cart-footer {
  padding: 18px;
  /* Increased padding */
  border-top: 1px solid var(--grey);
}

.cart-savings {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #15803d;
  background: #dcfce7;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.subtotal-label {
  font-size: 14px;
  color: var(--black);
  font-weight: 700;
}

.subtotal-value {
  text-align: right;
}

.original-subtotal {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
  margin-right: 8px;
}

.current-subtotal {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
}

.merchant-cart-section .cart-item-price .current-price {
  color: var(--red);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

.merchant-cart-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.merchant-cart-actions .merchant-checkout-form,
.merchant-cart-actions .btn-proceed-checkout,
.merchant-cart-actions .btn-add-more-items {
  flex: 1 1 0;
}

.merchant-cart-actions .merchant-checkout-form {
  margin: 0;
}

.merchant-cart-actions .merchant-checkout-form .btn-proceed-checkout {
  width: 100%;
}

.merchant-cart-actions .btn-proceed-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-add-more-items {
  display: block;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #355bff;
  color: #355bff;
  background: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-add-more-items:hover {
  background: #355bff;
  color: #fff;
}

.btn-proceed-checkout {
  display: block;
  width: 100%;
  padding: 12px;
  background: #fff;
  color: var(--pc);
  border: 1px solid var(--pc);
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  transition: all 0.2s ease;
  box-shadow: none;
}

  .btn-proceed-checkout:hover {
    background: var(--pc);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(229, 57, 53, 0.2);
  }

  .btn-proceed-checkout:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(229, 57, 53, 0.35);
    color: #fff;
  }

  .btn-proceed-checkout:active {
    transform: translateY(0);
  }

.html-shopping-cart-page .merchant-cart-wrapper {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  background: #fff;
}

.html-shopping-cart-page .merchant-cart-header {
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.merchant-cart-section.is-disabled .btn-proceed-checkout,
.btn-proceed-checkout.is-disabled {
  background: #f2f2f2;
  color: #9a9a9a;
  border-color: #e0e0e0;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
  filter: grayscale(1);
}

.merchant-cart-section.is-disabled .merchant-cart-footer {
  background: #f7f7f7;
}

.checkout-disabled-reason {
  margin-top: 8px;
  font-size: 12px;
  color: #c62828;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

  .checkout-disabled-reason i {
    font-size: 12px;
  }

/* 
==============================================
   Full Cart Page Optimization (.html-shopping-cart-page)
==============================================
*/

.html-shopping-cart-page .master-column-wrapper {
  background-color: #f8f9fa;
  /* Light grey background for better contrast */
  padding-top: 20px;
  padding-bottom: 40px;
}

.html-shopping-cart-page .page-title h1 {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
}

.html-shopping-cart-page .merchant-carts-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Card Styling */
.html-shopping-cart-page .merchant-cart-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  overflow: hidden;
  padding: 0;
}

.html-shopping-cart-page .merchant-cart-header {
  background: #fff;
  padding: 20px 25px;
  border-bottom: 1px solid #f0f0f0;
}

.html-shopping-cart-page .merchant-details-link .merchant-name {
  font-size: 1.2rem;
  color: #000;
}

/* Cart Items Layout - Grid on Desktop */
.html-shopping-cart-page .merchant-cart-items {
  padding: 10px 0;
}

.html-shopping-cart-page .cart-item {
  display: flex;
  align-items: center;
  padding: 20px 10px;
  border-bottom: 1px solid #f5f5f5;
}

  .html-shopping-cart-page .cart-item:last-child {
    border-bottom: none;
  }

.html-shopping-cart-page .cart-item-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

  .html-shopping-cart-page .cart-item-image img {
    border-radius: 8px;
  }

.html-shopping-cart-page .cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.html-shopping-cart-page .cart-item-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.html-shopping-cart-page .cart-item-quantity {
  margin-top: 8px;
  justify-content: flex-start;
}

.html-shopping-cart-page .cart-item-price {
  flex-shrink: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  text-align: right;
  min-width: 100px;
}

/* Footer Section */
.html-shopping-cart-page .merchant-cart-footer {
  background: #fafafa;
  padding: 20px 25px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.html-shopping-cart-page .cart-subtotal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.html-shopping-cart-page .subtotal-label {
  font-size: 0.9rem;
  color: #666;
}

.html-shopping-cart-page .subtotal-value .current-subtotal {
  font-size: 1.4rem;
  color: #d4002c;
  font-weight: 800;
}

.html-shopping-cart-page .btn-proceed-checkout {
  padding: 12px 30px;
  font-size: 1rem;
  border-radius: 8px;
  width: auto;
  min-width: 200px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .html-shopping-cart-page .merchant-cart-footer {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .html-shopping-cart-page .cart-subtotal {
    align-items: center;
    margin-bottom: 10px;
  }

  .html-shopping-cart-page .btn-proceed-checkout {
    width: 100%;
  }
}
