/* ICO Foods B2B Cart */
.woocommerce-cart .entry-header,
.woocommerce-cart .entry-title,
.woocommerce-cart .woocommerce-notices-wrapper:empty {
  display: none;
}

.woocommerce-cart .site-main,
.woocommerce-cart .content-area,
.woocommerce-cart .entry-content,
.woocommerce-cart article,
.woocommerce-cart .woocommerce {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.carrito-page-wrapper {
  width: 100%;
  background: var(--ICO-Blanco, #fff);
  font-family: "Avenir Next LT Pro", sans-serif;
}

.carrito-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(32px, 6vw, 72px);
  box-sizing: border-box;
}

#carrito-breadcrumb {
  width: 100%;
  padding: 24px 0;
}

.carrito-breadcrumb-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.carrito-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ICO-texto-mate, #343737);
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
  text-decoration: none;
  transition: color 0.2s ease;
}

.carrito-breadcrumb-item:hover {
  color: var(--ICO-Celeste, #459CD6);
}

.carrito-breadcrumb-item.active {
  color: var(--ICO-texto-mate, #343737);
  pointer-events: none;
}

.carrito-breadcrumb-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ICO-texto-mate, #343737);
  width: 24px;
  height: 24px;
}

.carrito-breadcrumb-separator img {
  width: 16px;
  height: 16px;
  display: block;
}

.carrito-title {
  color: #0B4460;
  font-size: 32px;
  font-weight: 700;
  line-height: normal;
  margin: 0 0 24px;
}

.carrito-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 40px;
}

.carrito-form {
  flex: 1;
  min-width: 0;
}

.carrito-table-container {
  width: 100%;
  min-width: 600px;
  max-width: 749px;
  border-radius: 8px;
  border: 1px solid var(--ICO-Gris-transparente, #EAEAEA);
  background: var(--Gray-Scale-White, #FFF);
  overflow: hidden;
}

.carrito-table-header {
  display: flex;
  align-items: center;
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--ICO-Gris-transparente, #EAEAEA);
}

.carrito-table-header > div {
  color: var(--ICO-texto-mate, #343737);
  font-size: 14px;
  font-weight: 600;
  line-height: 100%;
  letter-spacing: 0.42px;
  text-transform: uppercase;
}

.th-producto { width: 36%; }
.th-precio { width: 15%; }
.th-cantidad { width: 22%; }
.th-subtotal { width: 20%; }
.th-delete { width: 7%; }

.carrito-table-body {
  display: flex;
  flex-direction: column;
}

.carrito-item {
  display: flex;
  align-items: center;
  min-height: 116px;
  padding: 24px 16px;
  position: relative;
}

.carrito-item-divider {
  height: 1px;
  background-color: #E6E6E6;
  margin: 0 16px;
}

.carrito-item-producto {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 36%;
  text-decoration: none;
}

.producto-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex: 0 0 50px;
}

.producto-nombre {
  color: var(--ICO-texto-mate, #343737);
  font-size: 16px;
  font-weight: 600;
  line-height: 150%;
  max-width: 180px;
}

.carrito-item-precio {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 15%;
}

.precio-actual,
.precio-actual .woocommerce-Price-amount {
  color: var(--ICO-Azul, #0B4460);
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
  text-decoration: none;
}

.precio-tachado,
.precio-tachado .woocommerce-Price-amount {
  color: #A5A5A5;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  text-decoration-line: line-through;
}

.carrito-item-cantidad {
  width: 22%;
  display: flex;
  justify-content: flex-start;
}

.cantidad-selector {
  display: inline-flex;
  padding: 8px 10px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 170px;
  border: 1px solid var(--Gray-Scale-Gray-100, #E6E6E6);
  background: var(--Gray-Scale-White, #FFF);
  width: 144px;
  height: 50px;
  box-sizing: border-box;
}

.btn-cantidad {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.btn-cantidad img {
  width: 34px;
  height: 34px;
  display: block;
}

.cantidad-selector .qty {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  box-sizing: border-box !important;
  height: auto !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: var(--Gray-Scale-Gray-900, #1A1A1A) !important;
  text-align: center !important;
  font-family: "Avenir Next LT Pro", sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: normal !important;
  appearance: textfield;
  -moz-appearance: textfield;
}

.cantidad-selector .qty::-webkit-outer-spin-button,
.cantidad-selector .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.carrito-item-subtotal {
  width: 20%;
  color: var(--ICO-Azul, #0B4460);
  font-size: 18px;
  font-weight: 700;
  line-height: normal;
}

.carrito-item-subtotal .woocommerce-Price-amount {
  color: var(--ICO-Azul, #0B4460);
  font-size: 18px;
  font-weight: 700;
}

.carrito-item-delete {
  width: 7%;
  display: flex;
  justify-content: flex-end;
}

.btn-close-item {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-close-item img {
  width: 24px;
  height: 24px;
  display: block;
}

.carrito-actions {
  display: none;
}

.carrito-update-btn {
  display: none !important;
}

.carrito-resumen {
  width: 363px;
  min-height: 315px;
  border-radius: 8px;
  border: 1px solid var(--Gray-Scale-Gray-100, #E6E6E6);
  background: var(--Gray-Scale-White, #FFF);
  padding: 24px;
  box-sizing: border-box;
  flex: 0 0 363px;
}

.resumen-title {
  color: var(--ICO-Azul, #0B4460);
  font-size: 20px;
  font-weight: 700;
  line-height: normal;
  margin: 0 0 28px;
}

.resumen-detalle {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.resumen-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.resumen-label {
  color: var(--Gray-Scale-Gray-700, #4D4D4D);
  font-size: 14px;
  font-weight: 400;
  line-height: 150%;
}

.resumen-value,
.resumen-value .woocommerce-Price-amount {
  color: var(--ICO-Azul, #0B4460);
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
  white-space: nowrap;
}

.resumen-value.red-text,
.resumen-value.red-text .woocommerce-Price-amount {
  color: #F00;
}

.resumen-total-container {
  display: flex;
  width: 100%;
  min-height: 45px;
  padding: 12px 0;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #EAEAEA;
  background: var(--Gray-Scale-White, #FFF);
  box-sizing: border-box;
}

.resumen-label-total {
  color: var(--Gray-Scale-Gray-900, #1A1A1A);
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
}

.resumen-total {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.resumen-value-total,
.resumen-value-total .woocommerce-Price-amount {
  color: #F00;
  font-size: 18px;
  font-weight: 700;
  line-height: normal;
  white-space: nowrap;
}

.btn-continuar {
  display: flex;
  width: 100%;
  padding: 16px 40px;
  justify-content: center;
  align-items: center;
  gap: 16px;
  border-radius: 43px;
  background: var(--ICO-Celeste, #459CD6);
  color: var(--Gray-Scale-White, #FFF) !important;
  font-size: 16px;
  font-weight: 700;
  line-height: 120%;
  border: none;
  cursor: pointer;
  margin-top: 16px;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-continuar:hover {
  filter: brightness(0.96);
}

/* Variant colors: B2B keeps blue, B2C uses green as in the maquetación. */
.ico-variant-b2b .carrito-page-wrapper .btn-continuar,
.carrito-page-wrapper.carrito-variant-b2b .btn-continuar {
  background: var(--ICO-Celeste, #459CD6);
}

.ico-variant-b2c .carrito-page-wrapper .btn-continuar,
.carrito-page-wrapper.carrito-variant-b2c .btn-continuar {
  background: #8DBF3E;
}

.ico-variant-b2c .carrito-page-wrapper .carrito-breadcrumb-item:hover,
.carrito-page-wrapper.carrito-variant-b2c .carrito-breadcrumb-item:hover {
  color: var(--ICO-Azul, #0B4460);
}

.carrito-empty {
  padding: 40px 24px;
  text-align: center;
  color: #A4A4A4;
  font-size: 16px;
}

.carrito-mobile-title,
.carrito-mobile-divider {
  display: none;
}

@media (max-width: 1023px) {
  #carrito-breadcrumb {
    padding: 18px 24px;
  }

  .carrito-breadcrumb-inner {
    width: 100%;
  }

  .carrito-container {
    padding: 0;
  }

  .carrito-title {
    font-size: 24px;
    margin-top: 10px;
    margin-bottom: 24px;
    padding: 0 24px;
  }

  .carrito-content {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding-bottom: 0;
  }

  .carrito-form {
    width: 100%;
  }

  .carrito-mobile-title {
    display: block;
    color: var(--ICO-texto-mate, #343737);
    font-size: 16px;
    font-weight: 700;
    line-height: normal;
    padding: 16px 24px;
    margin: 0;
  }

  .carrito-mobile-divider {
    display: block;
    height: 1px;
    background-color: #EAEAEA;
    margin: 0 24px;
  }

  .carrito-table-container {
    width: 100%;
    max-width: none;
    min-width: 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .carrito-table-header {
    display: none;
  }

  .carrito-item {
    display: grid;
    grid-template-columns: 80px 1fr 32px;
    grid-template-areas:
      "img nombre delete"
      "img precio precio"
      "img cantidad cantidad";
    gap: 4px 16px;
    padding: 20px 24px;
    align-items: start;
  }

  .carrito-item-divider {
    margin: 0 24px;
    background-color: #EAEAEA;
  }

  .carrito-item-producto {
    display: contents;
  }

  .producto-img {
    grid-area: img;
    width: 80px;
    height: 80px;
    object-fit: contain;
  }

  .producto-nombre {
    grid-area: nombre;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ICO-Azul, #0B4460);
    margin: 0;
    max-width: none;
  }

  .carrito-item-delete {
    grid-area: delete;
    display: flex;
    justify-content: flex-end;
    width: auto;
  }

  .btn-close-item img {
    width: 24px;
    height: 24px;
  }

  .carrito-item-precio {
    grid-area: precio;
    justify-content: start;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    width: auto;
  }

  .precio-actual,
  .precio-actual .woocommerce-Price-amount {
    font-size: 16px;
    font-weight: 700;
  }

  .precio-tachado,
  .precio-tachado .woocommerce-Price-amount {
    font-size: 14px;
  }

  .carrito-item-cantidad {
    grid-area: cantidad;
    margin-top: 8px;
    width: auto;
  }

  .cantidad-selector {
    width: 132px;
    height: 40px;
    padding: 4px 8px;
  }

  .btn-cantidad,
  .btn-cantidad img {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .carrito-item-subtotal {
    display: none;
  }

  .carrito-resumen {
    display: flex;
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    margin: 0;
    padding: 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    border-radius: 16px 16px 0 0;
    background: #F6F9FA;
    box-shadow: 1px 0 8px 0 rgba(0, 0, 0, 0.15);
    min-height: auto;
    font-size: 16px;
  }

  .resumen-title {
    display: none;
  }

  .resumen-detalle,
  .resumen-total-container {
    width: 100%;
    border: none;
    padding: 0;
    min-height: auto;
    margin-bottom: 0;
    gap: 10px;
  }

  .resumen-row:last-child {
    padding-bottom: 24px;
    border-bottom: 1px solid #EAEAEA;
  }

  .resumen-label,
  .resumen-value,
  .resumen-label-total,
  .resumen-value-total,
  .resumen-value .woocommerce-Price-amount,
  .resumen-value-total .woocommerce-Price-amount {
    font-size: 16px;
  }

  .resumen-total {
    padding: 0;
    width: 100%;
    background: #F6F9FA;
  }

  .btn-continuar {
    width: 100%;
    margin-top: 0;
  }
}


/* WooCommerce notices inside custom cart */
.carrito-container .woocommerce-notices-wrapper,
.carrito-container .woocommerce-message,
.carrito-container .woocommerce-info,
.carrito-container .woocommerce-error {
  grid-column: 1 / -1;
  margin: 0 0 12px;
}

.carrito-container .woocommerce-message {
  border-radius: 8px;
  background: #eaf7ec;
  color: #166534;
  border: 1px solid #bfe5c6;
  padding: 10px 14px;
  font-size: 14px;
}

/* Fix breadcrumb visited global ICO */
.carrito-breadcrumb-item,
.carrito-breadcrumb-item:visited,
.carrito-breadcrumb-item:active,
.carrito-breadcrumb-item.active,
.carrito-breadcrumb-item.active:visited {
    color: var(--ICO-texto-mate, #343737) !important;
    text-decoration: none !important;
}

.carrito-breadcrumb-item:hover {
    color: var(--ICO-texto-mate, #343737) !important;
    text-decoration: none !important;
}


/* ICO cart empty state + WooCommerce notices polish */
.carrito-container .woocommerce-notices-wrapper,
.carrito-container .ico-cart-notices {
  width: 100%;
  margin: 0 0 12px;
}

.carrito-container .woocommerce-message,
.carrito-container .woocommerce-info,
.carrito-container .woocommerce-error {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 12px !important;
  padding: 12px 16px !important;
  border-radius: 8px !important;
  border: 1px solid #BFE5C6 !important;
  border-top: 1px solid #BFE5C6 !important;
  background: #EAF7EC !important;
  color: #166534 !important;
  font-family: "Avenir Next LT Pro", sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 130% !important;
  list-style: none !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

.carrito-container .woocommerce-info {
  border-color: #CFE7F7 !important;
  background: #F0F8FD !important;
  color: var(--ICO-Azul, #0B4460) !important;
}

.carrito-container .woocommerce-error {
  border-color: #F4C7C7 !important;
  background: #FFF3F3 !important;
  color: #B42318 !important;
}

.carrito-container .woocommerce-message::before,
.carrito-container .woocommerce-info::before,
.carrito-container .woocommerce-error::before,
.carrito-container .woocommerce-message::after,
.carrito-container .woocommerce-info::after,
.carrito-container .woocommerce-error::after {
  display: none !important;
  content: none !important;
}

.carrito-container .woocommerce-message a,
.carrito-container .woocommerce-info a,
.carrito-container .woocommerce-error a,
.carrito-container .woocommerce-message .restore-item {
  color: var(--ICO-Azul, #0B4460) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.ico-cart-empty {
  width: 100%;
  max-width: 748px;
  min-height: 260px;
  margin: 0;
  padding: 42px 32px;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  background: #FFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

.ico-cart-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: #F0F8FD;
  color: var(--ICO-Celeste, #459CD6);
}

.ico-cart-empty-title {
  margin: 0 0 10px;
  color: var(--ICO-Azul, #0B4460);
  font-family: "Avenir Next LT Pro", sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 130%;
}

.ico-cart-empty-text {
  max-width: 420px;
  margin: 0 0 24px;
  color: var(--ICO-texto-mate, #343737);
  font-family: "Avenir Next LT Pro", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 150%;
}

.ico-cart-empty-button {
  display: inline-flex;
  min-width: 190px;
  height: 48px;
  padding: 0 24px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--ICO-Azul, #0B4460);
  color: #FFF !important;
  font-family: "Avenir Next LT Pro", sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 130%;
  text-decoration: none !important;
  transition: transform .2s ease, opacity .2s ease;
}

.ico-cart-empty-button:hover {
  color: #FFF !important;
  opacity: .92;
  transform: translateY(-1px);
}

.carrito-page-wrapper.carrito-variant-b2c .ico-cart-empty-icon {
  background: #F2FAEA;
  color: #7BC142;
}

.carrito-page-wrapper.carrito-variant-b2c .ico-cart-empty-button {
  background: #7BC142;
}

@media (max-width: 768px) {
  .ico-cart-empty {
    max-width: none;
    min-height: 240px;
    margin: 0 24px;
    padding: 36px 24px;
  }

  .ico-cart-empty-title {
    font-size: 22px;
  }

  .ico-cart-empty-text {
    font-size: 15px;
  }

  .ico-cart-empty-button {
    width: 100%;
  }
}


/* ICO cart empty spacing refinement */
.carrito-page-wrapper .carrito-container:has(.ico-cart-empty) {
  padding-bottom: 72px;
}

.ico-cart-empty {
  margin: 0 auto 0 !important;
}

@media (max-width: 768px) {
  .carrito-page-wrapper .carrito-container:has(.ico-cart-empty) {
    padding-bottom: 48px;
  }

  .ico-cart-empty {
    margin: 0 0 0 !important;
  }
}


/* Carrito B2B: notice de actualización alineado a UX ICO Foods */
.carrito-container .woocommerce-notices-wrapper {
  margin: 0 0 16px !important;
}

.carrito-container .woocommerce-message {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  min-height: 48px !important;
  width: 100% !important;
  margin: 0 0 16px !important;
  padding: 12px 18px 12px 52px !important;
  border-radius: 10px !important;
  border: 1px solid #CFE7F7 !important;
  border-top: 1px solid #CFE7F7 !important;
  background: #F0F8FD !important;
  color: var(--ICO-Azul, #0B4460) !important;
  font-family: "Avenir Next LT Pro", sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.carrito-container .woocommerce-message::before {
  content: "✓" !important;
  position: absolute !important;
  left: 18px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: var(--ICO-Celeste, #459CD6) !important;
  color: #FFFFFF !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.carrito-container .woocommerce-message::after {
  display: none !important;
  content: none !important;
}
