/**
 * Ajial Water - Cart Page Styling
 * Custom styling for WooCommerce cart page
 */

/* Cart Header */
.ajial-cart-header {
  background-color: #f8f9fa;
  padding: 20px 0;
  margin-bottom: 30px;
  border-bottom: 1px solid #f0f0f0;
}

.ajial-cart-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ajial-cart-breadcrumbs {
  font-size: 14px;
  color: #666;
}

.ajial-cart-breadcrumbs .breadcrumb-item {
  display: inline-block;
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ajial-cart-breadcrumbs a.breadcrumb-item:hover {
  color: #004A61;
}

.ajial-cart-breadcrumbs .breadcrumb-separator {
  margin: 0 5px;
  color: #ccc;
}

.ajial-cart-breadcrumbs .breadcrumb-item.current {
  color: #004A61;
  font-weight: 600;
}

.ajial-cart-steps {
  display: flex;
  gap: 20px;
}

.ajial-cart-steps .step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.ajial-cart-steps .step.active {
  opacity: 1;
}

.ajial-cart-steps .step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-color: #004A61;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

.ajial-cart-steps .step.active .step-number {
  background-color: #fcb900;
  color: #004A61;
}

.ajial-cart-steps .step-label {
  font-size: 14px;
  font-weight: 500;
  color: #004A61;
}

@media (max-width: 768px) {
  .ajial-cart-header-inner {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
  
  .ajial-cart-steps {
    width: 100%;
    justify-content: space-between;
  }
  
  .ajial-cart-steps .step-label {
    font-size: 12px;
  }
}

/* Main Cart Container */
.woocommerce-cart .woocommerce {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 15px;
}

/* Cart Header */
.woocommerce-cart .woocommerce-cart-form__contents thead {
  background-color: #faf8f8;
  border-radius: 8px 8px 0 0;
}

.woocommerce-cart .woocommerce-cart-form__contents th {
  padding: 15px;
  font-weight: 600;
  color: #004A61;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e0e0e0;
}

/* Cart Items */
.woocommerce-cart .woocommerce-cart-form__cart-item {
  padding: 20px 0;
  transition: background-color 0.3s ease;
}

.woocommerce-cart .woocommerce-cart-form__cart-item:hover {
  background-color: #f8f9fa;
}

.woocommerce-cart .woocommerce-cart-form__contents td {
  padding: 15px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
}

/* Product Image */
.woocommerce-cart .product-thumbnail img {
  width: 80px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.woocommerce-cart .product-thumbnail img:hover {
  transform: scale(1.05);
}

/* Product Name */
.woocommerce-cart .product-name a {
  color: #004A61;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.woocommerce-cart .product-name a:hover {
  color: #fcb900;
}

/* Product Price */
.woocommerce-cart .product-price,
.woocommerce-cart .product-subtotal {
  font-weight: 600;
  color: #004A61;
}

/* Quantity Input */
.woocommerce-cart .quantity,
.woocommerce-cart .ajial-cart-quantity {
  display: flex;
  align-items: center;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  width: fit-content;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
}

.woocommerce-cart .quantity:hover,
.woocommerce-cart .ajial-cart-quantity:hover {
  border-color: #004A61;
  box-shadow: 0 4px 8px rgba(0, 74, 97, 0.1);
}

.woocommerce-cart .quantity input,
.woocommerce-cart .ajial-cart-quantity input {
  border: none;
  width: 50px;
  text-align: center;
  font-weight: 600;
  color: #004A61;
  padding: 8px 0;
  background-color: transparent;
}

.woocommerce-cart .quantity input:focus,
.woocommerce-cart .ajial-cart-quantity input:focus {
  outline: none;
}

/* Zero quantity styling */
.woocommerce-cart .ajial-cart-quantity input.zero-quantity {
  color: #ff6b6b;
  background-color: rgba(255, 107, 107, 0.1);
  font-weight: bold;
}

.woocommerce-cart .ajial-cart-quantity input.zero-quantity + button {
  color: #ff6b6b;
}

/* Row styling for items being removed */
.woocommerce-cart .woocommerce-cart-form__cart-item:has(.zero-quantity),
.woocommerce-cart .woocommerce-cart-form__cart-item.removing-product {
  background-color: rgba(255, 107, 107, 0.05);
  position: relative;
  overflow: hidden;
}

/* Add a subtle animation for items being removed */
.woocommerce-cart .woocommerce-cart-form__cart-item.removing-product::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #ff6b6b;
  animation: removing-product-animation 3s linear forwards;
}

@keyframes removing-product-animation {
  0% { width: 0; }
  100% { width: 100%; }
}

.woocommerce-cart .ajial-cart-quantity button {
  background: none;
  border: none;
  color: #004A61;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.woocommerce-cart .ajial-cart-quantity button:hover {
  background-color: #f0f0f0;
}

.woocommerce-cart .ajial-cart-quantity button:active {
  background-color: #e0e0e0;
}

/* Remove Item Button */
.woocommerce-cart .product-remove a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #f8f9fa;
  color: #ff6b6b;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
}

.woocommerce-cart .product-remove a:hover {
  background-color: #ff6b6b;
  color: #fff;
  box-shadow: 0 2px 5px rgba(255, 107, 107, 0.3);
}

/* Update Cart Button */
.woocommerce-cart .actions .button {
  background-color: transparent !important;
  color: #004A61 !important;
  border: 2px solid #004A61 !important;
  border-radius: 4px !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  transition: all 0.3s ease !important;
}

.woocommerce-cart .actions .button:hover {
  background-color: #004A61 !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.woocommerce-cart .actions .button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Coupon Field */
.woocommerce-cart .coupon {
  display: flex;
  gap: 10px;
}

.woocommerce-cart .coupon .input-text {
  border: 1px solid #e0e0e0 !important;
  border-radius: 4px !important;
  padding: 10px 15px !important;
  min-width: 200px;
}

.woocommerce-cart .coupon .button {
  background-color: #fcb900 !important;
  color: #004A61 !important;
  border: 2px solid #fcb900 !important;
}

.woocommerce-cart .coupon .button:hover {
  background-color: transparent !important;
  color: #fcb900 !important;
}

/* Cart Totals */
.woocommerce-cart .cart_totals {
  background-color: #f8f9fa;
  border-radius: 8px;
  margin-top: 30px;
  margin-bottom: 30px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.cart_totals h2 {
  font-size: 22px;
  margin-bottom: 25px;
  color: #004A61;
  font-weight: 600;
  border-bottom: 2px solid #fcb900;
  padding-bottom: 10px;
}

.cart_totals table {
  width: 100%;
}

.cart_totals th {
  text-align: left;
  padding: 12px 0;
  font-weight: 500;
  color: #333;
}

.cart_totals td {
  text-align: right;
  padding: 12px 0;
  font-weight: 500;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
  font-weight: 700;
  font-size: 18px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.cart_totals .order-total td .amount {
  color: #004A61;
  font-size: 22px;
}

/* Cart Update Notification */
.ajial-cart-auto-update-notice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #004A61;
  color: #fff;
  padding: 12px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  font-weight: 500;
  animation: slide-in 0.3s ease-out;
}

.ajial-cart-auto-update-notice.removal-notice {
  background-color: #ff6b6b;
}

.ajial-cart-auto-update-notice .countdown {
  font-weight: bold;
  margin: 0 2px;
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Empty Cart Styling */
.ajial-empty-cart {
  text-align: center;
  padding: 60px 20px;
  background-color: #f7f7f7;
  border-radius: 8px;
  margin: 40px 0;
}

.empty-cart-icon {
  font-size: 60px;
  color: #004A61;
  margin-bottom: 20px;
  opacity: 0.7;
}

.ajial-empty-cart h2 {
  font-size: 24px;
  color: #004A61;
  margin-bottom: 15px;
  font-weight: 600;
}

.ajial-empty-cart p {
  font-size: 16px;
  color: #666;
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.return-to-shop-btn {
  display: inline-block;
  background-color: #004A61;
  color: #fff;
  padding: 12px 25px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.return-to-shop-btn:hover {
  background-color: #fcb900;
  color: #004A61;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Proceed to Checkout Button */
.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
  background-color: #004A61 !important;
  color: #fff !important;
  border: 2px solid #004A61 !important;
  border-radius: 4px !important;
  padding: 15px 25px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  transition: all 0.6s ease !important;
  display: block;
  text-align: center;
  width: 100%;
  margin-top: 20px;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover {
  background-color: #fcb900 !important;
  border-color: #fcb900 !important;
  color: #004A61 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Empty Cart */
.woocommerce-cart .cart-empty,
.ajial-empty-cart {
  text-align: center;
  padding: 50px 0;
  color: #666;
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto;
}

.ajial-empty-cart .empty-cart-icon {
  margin-bottom: 20px;
}

.ajial-empty-cart .empty-cart-icon i {
  font-size: 60px;
  color: #e0e0e0;
  background-color: #f8f9fa;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 2px dashed #ccc;
}

.ajial-empty-cart h2 {
  color: #004A61;
  font-size: 24px;
  margin-bottom: 15px;
}

.ajial-empty-cart p {
  color: #666;
  margin-bottom: 30px;
}

.woocommerce-cart .return-to-shop {
  text-align: center;
  margin-bottom: 50px;
}

.woocommerce-cart .return-to-shop .button,
.ajial-empty-cart .return-to-shop-btn {
  background-color: #004A61 !important;
  color: #fff !important;
  border: 2px solid #004A61 !important;
  border-radius: 4px !important;
  padding: 12px 25px !important;
  font-weight: 600 !important;
  transition: all 0.6s ease !important;
  display: inline-block;
  text-decoration: none;
}

.woocommerce-cart .return-to-shop .button:hover,
.ajial-empty-cart .return-to-shop-btn:hover {
  background-color: #fcb900 !important;
  border-color: #fcb900 !important;
  color: #004A61 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Cross-sells */
.cross-sells {
  margin-top: 50px;
  border-top: 1px solid rgba(0, 86, 90, 0.1);
  padding-top: 30px;
}

.cross-sells h2 {
  color: #004A61;
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
}

.cross-sells ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.cross-sells li.product {
  margin-bottom: 0 !important;
  width: 100% !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .woocommerce-cart table.shop_table_responsive tr td::before {
    color: #004A61;
    font-weight: 600;
  }
  
  .woocommerce-cart .coupon {
    flex-direction: column;
  }
  
  .woocommerce-cart .coupon .button {
    width: 100% !important;
  }
  
  .woocommerce-cart .actions .button {
    width: 100% !important;
    margin-top: 10px !important;
  }
  
  .cross-sells ul.products {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Auto-update notification */
.ajial-cart-auto-update-notice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #00565a;
  color: white;
  padding: 10px 15px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  font-size: 14px;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cart Totals Styling */
.ajial-tax-line th,
.ajial-tax-line td {
    color: #777;
    font-size: 14px;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    border-top: 1px solid #f1f1f1 !important;
}

.order-total th,
.order-total td {
    font-size: 18px !important;
    font-weight: 700 !important;
    padding-top: 12px !important;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.order-total td strong {
    color: #00565a;
}

/* VAT Information Styling */
.ajial-vat-info {
  display: block;
  font-size: 12px;
  color: #777;
  margin-top: 4px;
  font-weight: normal;
  text-align: right;
}

.ajial-cart-auto-update-notice .countdown {
  display: inline-block;
  background-color: #fcb900;
  color: #004A61;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  margin-left: 8px;
  font-weight: 700;
}

@keyframes slide-in {
  0% {
    transform: translateY(100px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
