/* Drawer lock */
body.ca-atc-lock { overflow: hidden; }

/* Drawer base */
.ca-atc-drawer { position: fixed; inset: 0; z-index: 9999; display: none; }
.ca-atc-drawer.is-open { display: block; }

.ca-atc-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }

.ca-atc-panel {
  position: absolute; right: 0; top: 0; height: 100%;
  width: 440px; max-width: 92vw;
  background: #fff; box-shadow: -10px 0 30px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
  padding: 18px 18px 16px;
  overflow: hidden;
}

.ca-atc-close {
  position: absolute; right: 10px; top: 8px;
  border: 0; background: transparent;
  font-size: 28px; line-height: 1; cursor: pointer;
  color: #2b2b2b;
}

.ca-atc-header { padding-right: 26px; border-bottom: 1px solid #eee; padding-bottom: 12px; margin-bottom: 14px; }
.ca-atc-header__row { display: flex; gap: 10px; align-items: flex-start; }
.ca-atc-check {
  width: 20px; height: 20px; border-radius: 50%;
  background: #22c55e; display: inline-block; margin-top: 2px;
}
.ca-atc-title { font-weight: 700; font-size: 22px; color: #1b1b1b; }
.ca-atc-subtitle { font-size: 14px; color: #6b7280; margin-top: 2px; }

/* Added box */
.ca-atc-added {
  display: grid; grid-template-columns: 90px 1fr;
  gap: 12px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 18px;
}
.ca-atc-added__img img { width: 90px; height: 90px; object-fit: contain; border-radius: 8px; background: #fff; }
.ca-atc-imgph { display: grid; place-items: center; width: 90px; height: 90px; border-radius: 8px; background: #e5e7eb; color: #6b7280; font-weight: 600; }
.ca-atc-added__name { font-weight: 600; margin-bottom: 6px; }
.ca-atc-added__price { font-weight: 800; font-size: 20px; margin-bottom: 8px; }
.ca-atc-added__meta { font-size: 13px; color: #374151; display: grid; gap: 4px; }

/* Related */
.ca-atc-related__title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.ca-atc-related__desc { margin: 0 0 12px; color: #6b7280; font-size: 14px; }

.ca-atc-related__list { display: grid; gap: 12px; }
.ca-atc-item {
  display: grid; grid-template-columns: 86px 1fr;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}
.ca-atc-item__img img { width: 86px; height: 86px; object-fit: contain; border-radius: 8px; background: #fff; }
.ca-atc-item__name { font-weight: 600; margin-bottom: 6px; color: #111827; }
.ca-atc-item__price { font-weight: 800; margin-bottom: 10px; }

.ca-atc-add {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px solid #111827;
    background: #fff;
    color: #111827;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;

    &:hover {
        border: 2px solid #111827 !important;
        background: #fff !important;
    }

    &:focus{
        background: #f1c40f;
    }
}
.ca-atc-add.is-loading { opacity: .65; pointer-events: none; }

.ca-atc-item__actions {
  position: relative;
}

.ca-atc-add-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index: 2;
}

.ca-atc-add-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #111827;
}

.ca-atc-add-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.ca-atc-carticon {
  width: 18px; height: 18px; display: inline-block;
  border: 2px solid currentColor; border-radius: 3px;
  position: relative;
}
.ca-atc-carticon:before {
  content: ""; position: absolute; left: 3px; right: 3px; top: -6px; height: 8px;
  border: 2px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0;
}

/* Actions */
.ca-atc-actions {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 40px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.ca-atc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 14px; border-radius: 10px; text-decoration: none;
  font-weight: 800; cursor: pointer;


}

.ca-atc-btn.ca-atc-btn--primary {
    background: #f1c40f;
    color: #111827 !important;
    border: 0;
    text-decoration: none;

    &:hover {
       background: #dcb100 !important;
    }
}

.ca-atc-btn--ghost {
    background: #fff;
    color: #111827;
    border: 2px solid #111827;

    &:hover {
        border: 2px solid #111827 !important;
        background: black !important;
        color: #f1c40f !important;
    }

    &:focus{
        background: #f1c40f;
    }
}

/* Bottom toast */
.ca-atc-toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 9998;
  width: min(92vw, 980px);
}
.ca-atc-toast.is-open { display: block; }
.ca-atc-toast__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #111827; color: #fff;
  padding: 18px 28px; border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.ca-atc-toast__text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  flex: 1 1 auto;
}
.ca-atc-toast__link { color: #fff; text-decoration: underline; font-weight: 700; }
.ca-atc-toast__close {
  border: 0; background: transparent; color: #fff;
  font-size: 34px; line-height: 1; cursor: pointer;
  padding: 0;
  margin-left: 8px;
}

.ca-atc-related {
    flex: 1 1 auto;
    min-height: 0; /* 👈 CLAVE para que el overflow funcione en flex */
    display: flex;
    flex-direction: column;
}

.ca-atc-related__list {
    flex: 1 1 auto;
    min-height: 0; /* 👈 CLAVE */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px; /* opcional: espacio para el scroll */
}
