/* =========================================================
   AGROMAQ - Carrito lateral
   Archivo: assets/css/carrito.css
========================================================= */

body.agx-overlay-open {
  overflow: hidden;
}

#cartDrawer.agx-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: block;
  pointer-events: none;
  visibility: hidden;
}

#cartDrawer.agx-cart-drawer.open {
  pointer-events: auto;
  visibility: visible;
}

.agx-cart-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(227, 27, 35, 0.18), transparent 34%),
    rgba(17, 19, 21, 0.68);
  opacity: 0;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: opacity 0.28s ease;
}

.agx-cart-drawer.open .agx-cart-backdrop {
  opacity: 1;
}

.agx-cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--ag-dark-950, #111315);
  background: linear-gradient(135deg, #ffffff 0%, #fbfbf8 58%, #f2f2ef 100%);
  border-left: 1px solid rgba(227, 27, 35, 0.28);
  box-shadow: -30px 0 70px rgba(0, 0, 0, 0.34);
  transform: translateX(104%);
  transition: transform 0.34s cubic-bezier(.2,.8,.2,1);
}

.agx-cart-drawer.open .agx-cart-panel {
  transform: translateX(0);
}

.agx-cart-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(17, 19, 21, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 21, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
}

.agx-cart-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 20px;
  color: var(--ag-white, #ffffff);
  background:
    linear-gradient(145deg, var(--ag-dark-950, #111315), var(--ag-dark-800, #282d32)),
    radial-gradient(circle at 20% 0%, rgba(227, 27, 35, 0.22), transparent 40%);
  border-bottom: 3px solid var(--ag-red-500, #e31b23);
}

.agx-cart-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--ag-red-400, #ff3138);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agx-cart-head h2 {
  margin: 0;
  color: var(--ag-white, #ffffff);
  font-size: 32px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.agx-cart-head p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
}

.agx-icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--ag-white, #ffffff);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease;
}

.agx-icon-btn:hover {
  transform: translateY(-2px);
  background: rgba(227, 27, 35, 0.2);
  border-color: rgba(227, 27, 35, 0.55);
}

.agx-cart-items {
  position: relative;
  z-index: 2;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 24px;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  scroll-padding-bottom: 24px;
}

.agx-cart-items::-webkit-scrollbar {
  width: 7px;
}

.agx-cart-items::-webkit-scrollbar-thumb {
  background: rgba(17, 19, 21, 0.2);
  border-radius: 99px;
}

.agx-cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid rgba(17, 19, 21, 0.1);
  border-left: 4px solid var(--ag-red-500, #e31b23);
  border-radius: 13px;
  box-shadow: 0 16px 34px rgba(17, 19, 21, 0.075);
}

.agx-cart-item h3 {
  margin: 0;
  color: var(--ag-dark-950, #111315);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.agx-cart-item-meta {
  margin-top: 8px;
  color: rgba(17, 19, 21, 0.62);
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 750;
}

.agx-cart-remove {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  padding: 0 12px;
  color: var(--ag-red-600, #c9161d);
  background: rgba(227, 27, 35, 0.08);
  border: 1px solid rgba(227, 27, 35, 0.18);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    background 0.22s ease;
}

.agx-cart-remove:hover {
  transform: translateY(-1px);
  background: rgba(227, 27, 35, 0.13);
}

.agx-cart-qty {
  display: grid;
  grid-template-columns: 34px 28px 34px;
  align-items: center;
  justify-content: end;
  gap: 6px;
}

.agx-cart-qty button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ag-dark-950, #111315);
  background: #ffffff;
  border: 1px solid rgba(17, 19, 21, 0.14);
  border-radius: 9px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 950;
  transition:
    transform 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease;
}

.agx-cart-qty button:hover {
  color: var(--ag-red-600, #c9161d);
  border-color: rgba(227, 27, 35, 0.35);
  transform: translateY(-1px);
}

.agx-cart-qty strong {
  text-align: center;
  color: var(--ag-dark-950, #111315);
  font-size: 15px;
  font-weight: 950;
}

.agx-cart-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: rgba(17, 19, 21, 0.62);
  background: #ffffff;
  border: 1px dashed rgba(17, 19, 21, 0.18);
  border-radius: 16px;
}

.agx-cart-empty i {
  color: var(--ag-red-500, #e31b23);
  font-size: 38px;
}

.agx-cart-empty strong {
  display: block;
  margin-top: 12px;
  color: var(--ag-dark-950, #111315);
  font-size: 17px;
  font-weight: 950;
}

.agx-cart-empty span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.agx-cart-total {
  position: relative;
  z-index: 3;
  padding: 16px 22px 18px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(17, 19, 21, 0.1);
  box-shadow: 0 -14px 36px rgba(17, 19, 21, 0.08);
}

.agx-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 8px;
  color: rgba(17, 19, 21, 0.72);
  font-size: 14px;
  font-weight: 800;
}

.agx-total-line strong {
  color: var(--ag-dark-950, #111315);
  font-size: 18px;
  font-weight: 950;
}

.agx-total-main {
  margin-top: 8px;
  margin-bottom: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(17, 19, 21, 0.12);
}

.agx-total-main span {
  color: var(--ag-dark-950, #111315);
  font-size: 18px;
  font-weight: 950;
}

.agx-total-main strong {
  color: var(--ag-red-600, #c9161d);
  font-size: 28px;
}

.agx-cart-secondary,
.agx-cart-primary {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 9px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 950;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease;
}

.agx-cart-secondary {
  color: var(--ag-dark-950, #111315);
  background: #ffffff;
  border: 1px solid rgba(17, 19, 21, 0.14);
}

.agx-cart-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(227, 27, 35, 0.35);
}

.agx-cart-primary {
  color: var(--ag-white, #ffffff);
  background: linear-gradient(135deg, var(--ag-red-700, #a90f16), var(--ag-red-500, #e31b23));
  border: 1px solid rgba(227, 27, 35, 0.55);
  box-shadow: 0 14px 28px rgba(227, 27, 35, 0.24);
}

.agx-cart-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px rgba(227, 27, 35, 0.32);
}

.agx-cart-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 560px) {
  .agx-cart-panel {
    width: 100%;
    height: 100dvh;
    border-left: 0;
  }

  .agx-cart-head {
    padding: 17px 16px 14px;
  }

  .agx-cart-kicker {
    margin-bottom: 6px;
    font-size: 10px;
  }

  .agx-cart-head h2 {
    font-size: 29px;
  }

  .agx-cart-head p {
    margin-top: 5px;
    font-size: 12px;
  }

  .agx-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .agx-cart-items {
    padding: 12px;
    gap: 10px;
  }

  .agx-cart-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 13px;
    border-radius: 12px;
  }

  .agx-cart-item h3 {
    font-size: 14px;
  }

  .agx-cart-item-meta {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
  }

  .agx-cart-remove {
    min-height: 32px;
    margin-top: 9px;
  }

  .agx-cart-qty {
    grid-template-columns: 32px 28px 32px;
    justify-content: start;
  }

  .agx-cart-qty button {
    width: 32px;
    height: 32px;
  }

  .agx-cart-total {
    padding: 10px 12px 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    row-gap: 7px;
  }

  .agx-total-line {
    margin: 0;
    font-size: 12.5px;
  }

  .agx-total-line strong {
    font-size: 15px;
  }

  .agx-total-main {
    grid-column: 1 / -1;
    margin: 0;
    padding-top: 8px;
  }

  .agx-total-main span {
    font-size: 17px;
  }

  .agx-total-main strong {
    font-size: 25px;
  }

  .agx-cart-secondary,
  .agx-cart-primary {
    min-height: 42px;
    margin-top: 0;
    font-size: 12.5px;
    border-radius: 8px;
  }
}

@media (max-height: 700px) and (max-width: 560px) {
  .agx-cart-head {
    padding-top: 12px;
    padding-bottom: 11px;
  }

  .agx-cart-head h2 {
    font-size: 25px;
  }

  .agx-cart-head p {
    display: none;
  }

  .agx-cart-items {
    padding: 9px;
  }

  .agx-cart-item {
    padding: 11px;
  }

  .agx-cart-total {
    padding: 8px 10px 10px;
    row-gap: 5px;
  }

  .agx-total-line {
    font-size: 12px;
  }

  .agx-total-line strong {
    font-size: 14px;
  }

  .agx-total-main {
    padding-top: 6px;
  }

  .agx-total-main strong {
    font-size: 22px;
  }

  .agx-cart-secondary,
  .agx-cart-primary {
    min-height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agx-cart-backdrop,
  .agx-cart-panel,
  .agx-icon-btn,
  .agx-cart-remove,
  .agx-cart-qty button,
  .agx-cart-secondary,
  .agx-cart-primary {
    transition: none !important;
  }
}
/* =========================================================
   BONIFICACIONES DE PROMOCIONES EN CARRITO
========================================================= */
.agx-cart-promo-block {
  margin: 8px 0 2px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(215, 25, 32, .20);
  background: linear-gradient(145deg, #fff8f8, #ffffff);
}

.agx-cart-promo-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #a90f16;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.agx-cart-promo-head i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #d71920;
}

.agx-cart-promo-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(17, 19, 21, .07);
}

.agx-cart-promo-line strong,
.agx-cart-promo-line span {
  display: block;
}

.agx-cart-promo-line strong {
  color: #111315;
  font-size: 13px;
  font-weight: 900;
}

.agx-cart-promo-line span,
.agx-cart-promo-block small {
  margin-top: 3px;
  color: #74797e;
  font-size: 11px;
  line-height: 1.45;
}

.agx-cart-promo-line b {
  color: #15924e;
  font-size: 13px;
  white-space: nowrap;
}

/* =========================================================
   LOTES Y SUGERENCIAS DE PROMOCIONES V2
========================================================= */
.agx-promo-lot,
.agx-promo-suggestions {
  margin: 10px 0;
  border: 1px solid rgba(215,25,32,.22);
  border-radius: 16px;
  background: #fff;
}

.agx-promo-lot {
  overflow: hidden;
}

.agx-promo-lot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: linear-gradient(135deg, #fff5f5, #fff);
  border-bottom: 1px solid rgba(215,25,32,.13);
}

.agx-promo-lot-head > div {
  min-width: 0;
}

.agx-promo-lot-head span,
.agx-promo-lot-head strong,
.agx-promo-lot-head small {
  display: block;
}

.agx-promo-lot-head span {
  color: #d71920;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.agx-promo-lot-head strong {
  margin-top: 4px;
  color: #111315;
  font-size: 13px;
}

.agx-promo-lot-head small {
  margin-top: 3px;
  color: #6f7478;
  font-size: 10px;
  line-height: 1.4;
}

.agx-promo-lot-head > button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(215,25,32,.2);
  border-radius: 10px;
  background: #fff;
  color: #d71920;
  cursor: pointer;
}

.agx-promo-lot-lines {
  padding: 4px 14px;
}

.agx-promo-lot-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(17,19,21,.1);
}

.agx-promo-lot-line:last-child {
  border-bottom: 0;
}

.agx-promo-lot-line strong,
.agx-promo-lot-line span,
.agx-promo-lot-line small {
  display: block;
}

.agx-promo-lot-line strong {
  color: #111315;
  font-size: 11px;
}

.agx-promo-lot-line span {
  margin-top: 2px;
  color: #777c81;
  font-size: 10px;
}

.agx-promo-lot-line-total {
  flex: 0 0 auto;
  text-align: right;
}

.agx-promo-lot-line-total b {
  font-size: 12px;
}

.agx-promo-lot-line-total small {
  margin-top: 2px;
  color: #16954a;
  font-size: 9px;
  font-weight: 800;
}

.agx-promo-lot-line.is-free {
  color: #16954a;
}

.agx-promo-lot-line.is-free strong,
.agx-promo-lot-line.is-free > b {
  color: #16954a;
}

.agx-promo-lot-foot {
  padding: 10px 14px;
  background: #f7f8f8;
  color: #777c81;
  font-size: 9px;
  line-height: 1.45;
}

.agx-promo-lot-foot i {
  margin-right: 5px;
  color: #d71920;
}

.agx-promo-suggestions {
  position: relative;
  display: block !important;
  width: 100%;
  height: auto !important;
  min-height: max-content;
  max-height: none !important;
  padding: 0;
  overflow: visible !important;
  border-color: rgba(22,149,74,.28);
  background: #f8fff9;
  box-shadow: 0 10px 24px rgba(22,149,74,.07);
}

.agx-promo-suggestions-title {
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 62px;
  margin: 0;
  padding: 12px 13px;
  border-radius: 15px 15px 0 0;
  background: linear-gradient(135deg, #effcf3, #f8fff9);
}

.agx-promo-suggestions-title > i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #16954a;
  border-radius: 10px;
  font-size: 15px;
}

.agx-promo-suggestions-title > div {
  min-width: 0;
}

.agx-promo-suggestions-title strong,
.agx-promo-suggestions-title span {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: none !important;
  overflow: visible !important;
}

.agx-promo-suggestions-title strong {
  color: #111315;
  font-size: 12px;
  line-height: 1.25;
}

.agx-promo-suggestions-title span {
  margin-top: 4px;
  color: #5f6d64;
  font-size: 10px;
  line-height: 1.45;
}

.agx-promo-suggestion {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  height: auto !important;
  max-height: none !important;
  padding: 11px 13px;
  overflow: visible !important;
  visibility: visible !important;
  opacity: 1 !important;
  border-top: 1px solid rgba(22,149,74,.14);
  background: rgba(255,255,255,.72);
}

.agx-promo-suggestion:last-child {
  border-radius: 0 0 15px 15px;
}

.agx-promo-suggestion > div {
  min-width: 0;
}

.agx-promo-suggestion strong,
.agx-promo-suggestion span {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.agx-promo-suggestion strong {
  color: #111315;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 900;
}

.agx-promo-suggestion span {
  margin-top: 4px;
  color: #69736d;
  font-size: 9.5px;
  line-height: 1.45;
}

.agx-promo-suggestion button {
  flex: 0 0 auto;
  min-width: 82px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #128440;
  border-radius: 10px;
  background: #16954a;
  color: #fff;
  box-shadow: 0 7px 16px rgba(22,149,74,.16);
  font-size: 10px;
  font-weight: 950;
  cursor: pointer;
}

.agx-promo-suggestion button:hover,
.agx-promo-suggestion button:focus-visible {
  background: #128440;
  transform: translateY(-1px);
}

@media (max-width: 520px) {
  .agx-promo-suggestions-title {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 58px;
    padding: 11px;
  }

  .agx-promo-suggestions-title > i {
    width: 30px;
    height: 30px;
  }

  .agx-promo-suggestion {
    grid-template-columns: 1fr;
    align-items: stretch;
    min-height: 0;
    padding: 11px;
  }

  .agx-promo-suggestion button {
    width: 100%;
  }
}
