
/* Base Cart Styles - Reset any conflicts */
.cart-card,
.summary-card,
.address-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.cart-card-header,
.summary-card-header,
.address-card-header {
  background: #fafafa;
  border-bottom: 1px solid #eee;
  padding: 15px 20px;
}

.cart-card-header h5,
.summary-card-header h6,
.address-card-header h6 {
  margin: 0;
  font-weight: 700;
  color: #282828;
}

.cart-card-body {
  padding: 0;
}

.cart-card-footer {
  padding: 15px 20px;
  background: #fafafa;
  border-top: 1px solid #eee;
}

/* Summary & Address Body */
.summary-card-body,
.address-card-body {
  padding: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.summary-total {
  font-size: 16px;
  font-weight: 700;
  color: #282828;
  padding-top: 10px;
  border-top: 1px solid #eee;
  margin-top: 10px;
}

/* Cart Items */
.cart-item {
  display: flex !important;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  gap: 15px;
  transition: background 0.2s;
}

.cart-item:hover {
  background: #fafafa;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-checkbox {
  flex-shrink: 0;
}

.cart-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.cart-item-image {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border: 1px solid #eee;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  overflow: hidden;
}

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

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item-name a {
  color: #282828 !important;
  text-decoration: none !important;
}

.cart-item-name a:hover {
  color: var(--am-primary, #E8663D) !important;
}

.cart-item-meta {
  font-size: 12px;
  color: #888;
  margin-bottom: 5px;
}

.cart-item-price {
  margin-bottom: 0;
}

.cart-unit-price {
  font-size: 15px;
  font-weight: 600;
  color: #282828;
}

.cart-item-quantity {
  flex-shrink: 0;
  text-align: center;
}

.cart-item-total {
  flex-shrink: 0;
  text-align: right;
  min-width: 100px;
}

.qty-selector {
  display: inline-flex;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 16px;
}

.qty-btn:hover {
  background: #e0e0e0;
}

.qty-input {
  width: 45px;
  height: 32px;
  border: none;
  text-align: center;
  font-weight: 600;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
}

.cart-subtotal {
  font-size: 16px;
  font-weight: 600;
  color: #282828;
}

/* Checkout Button */
.btn-checkout {
  background: var(--am-primary, #E8663D) !important;
  border: none !important;
  color: #fff !important;
  width: 100%;
  padding: 12px !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  transition: all 0.3s;
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 102, 61, 0.3);
}

/* Address Toggles */
.address-toggle-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font-weight: 700;
  color: #282828;
  padding: 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.toggle-icon {
  font-size: 12px;
  color: #aaa;
  transition: transform 0.3s;
}

.address-toggle-btn[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

/* Empty Cart */
.empty-cart-container {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
}

.empty-cart-icon {
  font-size: 60px;
  color: #ddd;
  margin-bottom: 20px;
}

.empty-cart-container h4 {
  color: #282828;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 991px) {
  .cart-left-col {
    margin-bottom: 20px;
  }
}

@media (max-width: 767px) {
  .cart-card-header h5 {
    font-size: 18px;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
  }

  .cart-item-checkbox {
    position: absolute;
    left: 16px;
    top: 16px;
  }

  .cart-item-image {
    width: 80px;
    height: 80px;
    margin-left: 30px;
  }

  .cart-item-details {
    width: 100%;
    padding-left: 30px;
  }

  .cart-item-name {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .cart-unit-price {
    font-size: 16px;
    font-weight: 700;
  }

  .cart-item-quantity {
    width: 100%;
    padding-left: 30px;
    margin-top: 12px;
  }

  .cart-item-quantity label {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 0;
    font-weight: 600;
  }

  .qty-selector {
    display: inline-flex;
  }

  .cart-item-total {
    display: none;
    /* Hide subtotal on mobile */
  }

  /* Summary card adjustments */
  .summary-card,
  .address-card {
    margin-bottom: 15px;
  }

  .summary-card-header h6,
  .address-card-header h6 {
    font-size: 15px;
  }

  /* Button adjustments */
  .cart-card-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .cart-card-footer .btn {
    width: 100%;
    margin: 0 !important;
  }
}

@media (max-width: 576px) {
  .cart-item {
    padding: 14px;
  }

  .cart-item-checkbox {
    left: 14px;
    top: 14px;
  }

  .cart-item-image {
    width: 70px;
    height: 70px;
  }

  .cart-item-name {
    font-size: 13px;
  }

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

  .qty-selector {
    width: 100%;
    justify-content: center;
  }

  .qty-input {
    width: 60px;
  }
}

/* ====================================================
   Field-level error highlight (flashes on missing fields)
   ==================================================== */
.cart-field-error {
  border-color: #E8663D !important;
  box-shadow: 0 0 0 3px rgba(232, 102, 61, 0.25) !important;
  animation: fieldErrorPulse 0.5s ease 2;
}

@keyframes fieldErrorPulse {
  0%   { box-shadow: 0 0 0 3px rgba(232, 102, 61, 0.25); }
  50%  { box-shadow: 0 0 0 5px rgba(232, 102, 61, 0.45); }
  100% { box-shadow: 0 0 0 3px rgba(232, 102, 61, 0.25); }
}

