/**
 * Custom Cart List Styles
 */

/* Cart Badge */
.has-cart-badge {
  position: relative;
}

.has-cart-badge::after {
  content: attr(data-cart-count);
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #ff0000;
  color: white;
  font-size: 12px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  padding: 0 2px;
  box-sizing: border-box;
}

.has-cart-badge[data-cart-count="0"]::after {
  display: none;
}

/* Container */
.custom-cart-list-container {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  height: 100%;
  flex: 1;
}

.product-details {
  flex: 1;
  margin-left: 24px;
}
/* Messages */
.ccl-messages {
  /* margin-bottom: 20px;
  min-height: 30px; */
}

.ccl-message {
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
}

.ccl-message-success {
  background-color: #f0f9eb;
  color: #67c23a;
  border: 1px solid #c2e7b0;
}

.ccl-message-error {
  background-color: #fef0f0;
  color: #f56c6c;
  border: 1px solid #fbc4c4;
}

/* Cart Header */
.ccl-cart-header {
  display: flex;
  background-color: #f7f7f7;
  padding: 12px 15px;
  /* border-radius: 4px 4px 0 0; */
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #e5e5e5;
  border-bottom: none;
}

/* Cart Items */
.ccl-cart-items {
  color: white;
  margin-bottom: 20px;
  /* border-radius: 4px; */
  /* overflow: hidden; */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ccl-cart-item {
  flex-wrap: wrap;
  display: flex;
  /* padding: 15px; */
  /* border: 1px solid #e5e5e5; */
  border-top: none;
  transition: background-color 0.3s;
  position: relative;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #ffc88c;
}

/* .ccl-cart-item:hover {
  background-color: #f9f9f9;
} */

/* Loading state */
.ccl-loading {
  opacity: 0.6;
  pointer-events: none;
}

.ccl-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #007cba;
  border-radius: 50%;
  animation: ccl-spin 1s linear infinite;
}

@keyframes ccl-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Product columns */
.ccl-product-image a {
  display: block;
  height: 100%;
}
.ccl-product-image,
.ccl-cart-header .ccl-product-image {
  width: 80px;
  flex-shrink: 0;
  max-width: 85px;
}

.ccl-product-details,
.ccl-cart-header .ccl-product-details {
  flex: 2;
  padding: 0 15px;
}

.ccl-product-price,
.ccl-cart-header .ccl-product-price {
  /* width: 100px; */
  text-align: center;
  flex-shrink: 0;
}
.ccl-product-price {
  float: right;
  margin-top: 4px;
}

.ccl-product-quantity,
.ccl-cart-header .ccl-product-quantity {
  width: 120px;
  text-align: center;
  flex-shrink: 0;
}
.ccl-product-quantity {
  margin-top: 24px;
}

.ccl-product-subtotal,
.ccl-cart-header .ccl-product-subtotal {
  width: 120px;
  text-align: center;
  flex-shrink: 0;
}
.ccl-product-subtotal {
  margin-top: 6px;
  margin-left: 15px;
  text-align: start;
}

.ccl-product-remove,
.ccl-cart-header .ccl-product-remove {
  /* width: 60px; */
  text-align: center;
  flex-shrink: 0;
}
button.ccl-remove-item {
  padding: 0 18px !important;
}
.ccl-product-remove {
  /* float: right; */
  position: absolute;
  bottom: 8px;
  right: 0;
}

/* Product image */
.ccl-product-image img {
  /* max-width: 60px; */
  height: 100% !important;
  display: block;
  /* border-radius: 3px; */
  object-fit: cover;
}

/* Product details */
.ccl-product-category {
  display: block;
  font-weight: 300;
  font-size: 14px;
  /* color: #777; */
  margin-bottom: 5px;
}

.ccl-product-name {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 500;
}

.ccl-product-details .ccl-product-name a {
  text-decoration: none;
  color: white;
  font-weight: 700;
}

.ccl-product-name a:hover {
  color: #007cba;
}

/* Quantity controls */
.ccl-quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  /* border-radius: 4px; */
  overflow: hidden;
  width: 100px;
  margin: 0 auto;
  margin-left: 15px;
}
.ccl-quantity-controls input {
  color: white !important;
}

button.ccl-qty-decrease,
button.ccl-qty-increase {
  background: transparent;
  border: none;
  width: 30px;
  height: 30px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  color: #555;
  transition: background-color 0.3s;
  color: white !important;
  padding: 0 8px !important;
  /* background: red; */
  font-size: 24px !important;
  line-height: 0;
  font-weight: 400 !important;
}

.ccl-qty-decrease:hover,
.ccl-qty-increase:hover {
  background: #e5e5e5;
}

.ccl-qty-input {
  width: 40px;
  height: 30px;
  border: none !important;
  text-align: center;
  font-size: 14px;
  padding: 0 5px;
  -moz-appearance: textfield;
  background: transparent;
  color: white;
  border: none;
  padding: 0px !important;
  font-weight: 400 !important;
}

.ccl-qty-input::-webkit-outer-spin-button,
.ccl-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove button */
.ccl-remove-item {
  background: transparent;
  border: none;
  color: #cc0000;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s;
}

.ccl-remove-item:hover {
  color: #990000;
}
.ccl-product-info .variation {
  color: white;
}

/* Selecciona la lista principal */
.ccl-product-info dl.variation {
  display: grid;
  grid-template-columns: auto 1fr; /* Columna 1: ancho automático. Columna 2: el resto del espacio */
  gap: 8px 1em; /* 8px de espacio vertical, 1em de espacio horizontal */
  align-items: baseline; /* Alinea el texto en la base para que se vea parejo */
}

/* Elimina márgenes por defecto que puedan interferir */
.ccl-product-info dl.variation dt,
.ccl-product-info dl.variation dd,
.ccl-product-info dl.variation dd p {
  margin: 0;
  padding: 0;
}

.ccl-product-info {
  flex: 1;
  color: white;
}
.ccl-cart-total {
  display: none !important;
}
/* Cart totals */
.ccl-cart-totals {
  /* background: #f7f7f7; */
  padding: 0 20px;
  /* border-radius: 4px; */
  margin-top: 20px;
  color: white;
  /* border: 1px solid #e5e5e5; */
}
.ccl-cart-totals p {
  margin-bottom: 24px !important;
  text-align: end;
  max-width: 300px;
  margin-left: auto;
  color: #7f7f7f;
}
.ccl-cart-totals .woocommerce-Price-amount.amount {
  font-size: 24px;
  font-weight: 400;
}

.ccl-cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 16px;
}

.ccl-cart-totals .ccl-label {
  color: #ffc88c;
  font-size: 18px;
}

.ccl-value {
  font-weight: 500;
}

.ccl-checkout-button {
  display: inline-block;
  /* background-color: #007cba; */
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 400 !important;
  transition: background-color 0.3s;
  width: 100%;
  text-align: center;
  background: transparent;
  border: 1px solid white;
  color: white !important;
}

.ccl-checkout-button:hover {
  background-color: #97784c;
  color: #fff;
}

/* Empty cart */
.ccl-empty-cart {
  text-align: center;
  padding: 30px;
  background: #f7f7f7;
  border-radius: 4px;
  border: 1px solid #e5e5e5;
}

.ccl-empty-cart p {
  margin-bottom: 15px;
  font-size: 16px;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
  .ccl-cart-header {
    display: none;
  }

  .ccl-cart-item {
    flex-wrap: wrap;
    /* padding: 15px 10px; */
  }

  .ccl-product-image {
    width: 60px;
  }

  .ccl-product-details {
    /* width: calc(100% - 60px - 40px); */
    padding: 0 10px;
  }

  .ccl-product-remove {
    /* width: 40px; */
    order: 1;
  }

  .ccl-product-price,
  .ccl-product-quantity,
  .ccl-product-subtotal {
    /* width: 33.333%; */
    /* text-align: center; */
    /* padding: 10px 5px 0; */
    order: 2;
  }

  .ccl-product-price::before,
  .ccl-product-quantity::before,
  .ccl-product-subtotal::before {
    content: attr(data-title);
    display: block;
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
  }

  .ccl-quantity-controls {
    margin: 0 auto;
  }
  .ccl-product-price {
    margin-top: 0px;
  }
  .ccl-product-remove {
    bottom: 21px;
  }
}

@media screen and (max-width: 480px) {
  .ccl-cart-item {
    /* padding: 10px; */
  }

  .ccl-product-image {
    width: 76px;
  }

  .ccl-product-details {
    /* width: calc(100% - 50px - 30px); */
  }

  .ccl-product-remove {
    /* width: 30px; */
  }

  .ccl-product-name a {
    font-size: 14px;
    line-height: 1;
  }

  .ccl-cart-subtotal {
    flex-direction: column;
    align-items: flex-start;
  }

  .ccl-cart-actions {
    text-align: center;
    margin-top: 15px;
  }

  .ccl-checkout-button {
    width: 100%;
    text-align: center;
  }
}
