/* Smart Add to Cart — front */

.ps-atc {
  margin-top: 0.75rem;
}

.ps-atc--listing {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 0.5rem;
  box-sizing: border-box;
}

.ps-atc__row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

/*
 * Listing button without qty / full-width must match centered title+price.
 * Themes use text-align:center on those, but a flex row stays left-aligned
 * (and width:100% is ignored when the parent is a flex column with
 * align-items:flex-start). Force a block + text-align stack like the title.
 */
.product-miniature .ps-atc.ps-atc--center,
.js-product-miniature .ps-atc.ps-atc--center,
.product-description .ps-atc.ps-atc--center,
.ps-atc.ps-atc--listing.ps-atc--center {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  float: none !important;
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: stretch !important;
  flex: 0 0 auto !important;
  flex-basis: 100% !important;
}

.product-miniature .ps-atc--center .ps-atc__row,
.js-product-miniature .ps-atc--center .ps-atc__row,
.product-description .ps-atc--center .ps-atc__row,
.ps-atc--center .ps-atc__row,
.ps-atc__row--center {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  float: none !important;
  text-align: center !important;
  justify-content: center !important;
}

.product-miniature .ps-atc--center .ps-atc__btn,
.js-product-miniature .ps-atc--center .ps-atc__btn,
.product-description .ps-atc--center .ps-atc__btn,
.ps-atc--center .ps-atc__btn {
  display: inline-flex !important;
  width: auto !important;
  max-width: 100% !important;
  float: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  flex: 0 0 auto !important;
}

.ps-atc--full .ps-atc__row {
  width: 100%;
}

.ps-atc__btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  background: var(--atc-bg, #2fb5d2);
  color: var(--atc-text, #fff);
  border-radius: var(--atc-radius, 4px);
  font-size: var(--atc-font, 14px);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.ps-atc__btn:hover,
.ps-atc__btn:focus {
  background: var(--atc-hover-bg, #2596ad);
  color: var(--atc-hover-text, #fff);
  outline: none;
}

.ps-atc__btn:active {
  transform: translateY(1px);
}

.ps-atc__btn:disabled,
.ps-atc__btn.is-loading {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.ps-atc__btn.is-oos,
.ps-atc__btn.is-oos:hover,
.ps-atc__btn.is-oos:focus {
  background: #9aa3ad;
  color: #fff;
  opacity: 1;
  cursor: not-allowed;
  pointer-events: none;
}

.ps-atc--oos .ps-atc__qty {
  opacity: 0.55;
  pointer-events: none;
}

.ps-atc--oos .ps-atc__qty-btn,
.ps-atc--oos .ps-atc__qty-input {
  cursor: not-allowed;
}

.ps-atc__btn .ps-atc__label {
  white-space: nowrap;
}

.ps-atc__btn--block {
  width: 100%;
}

.ps-atc__qty {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.2rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 32, 0.05);
}

.ps-atc__qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.ps-atc__qty-btn:hover:not(:disabled),
.ps-atc__qty-btn:focus:not(:disabled) {
  background: var(--atc-bg, #2fb5d2);
  color: var(--atc-text, #fff);
  outline: none;
}

.ps-atc__qty-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.ps-atc__qty-icon {
  width: 12px;
  height: 12px;
  display: block;
}

.ps-atc__qty-input,
.ps-atc__qty input {
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f2933;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 2.15rem;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.ps-atc__qty input::-webkit-outer-spin-button,
.ps-atc__qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.product-miniature .ps-atc.ps-atc--listing,
.js-product-miniature .ps-atc.ps-atc--listing,
.product-description .ps-atc.ps-atc--listing {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  align-self: stretch !important;
  flex-basis: 100% !important;
}

.ps-atc--listing .ps-atc__row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.ps-atc--listing .ps-atc__qty {
  flex: 0 0 auto;
  min-height: 2.4rem;
  padding: 0.12rem;
}

.ps-atc--listing .ps-atc__qty-btn,
.ps-atc--listing .ps-atc__qty-input,
.ps-atc--listing .ps-atc__qty input {
  width: 1.75rem;
  height: 1.75rem;
}

.ps-atc--listing .ps-atc__qty-input,
.ps-atc--listing .ps-atc__qty input {
  line-height: 1.75rem;
  font-size: 0.85rem;
}

.ps-atc--listing .ps-atc__btn {
  flex: 1 1 8.5rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.ps-atc--listing .ps-atc__btn .ps-atc__label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

body.ps-atc-hide-qv .quick-view,
body.ps-atc-hide-qv .js-quick-view {
  display: none !important;
}

/* Modal */
.ps-atc-modal[hidden] {
  display: none !important;
}

.ps-atc-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ps-atc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 32, 0.55);
}

.ps-atc-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  background: #f7f7f7;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  padding: 1.1rem;
}

.ps-atc-modal__layout {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 1.1rem;
}

.ps-atc-modal__media {
  background: transparent;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  min-width: 0;
  overflow: hidden;
}

.ps-atc-modal__media img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: transparent;
}

.ps-atc-modal__main {
  min-width: 0;
}

.ps-atc-modal__x {
  position: absolute;
  top: 0.45rem;
  right: 0.65rem;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: #666;
  cursor: pointer;
  z-index: 2;
}

.ps-atc-modal__title {
  margin: 0 1.5rem 0.35rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #232323;
  text-transform: uppercase;
}

.ps-atc-modal__price {
  color: var(--atc-bg, #2fb5d2);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.ps-atc-modal__desc {
  margin: 0 0 0.75rem;
  color: #777;
  font-size: 0.9rem;
}

.ps-atc-modal__group {
  margin-bottom: 0.85rem;
}

.ps-atc-modal__group-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
}

.ps-atc-modal__attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ps-atc-modal__attr {
  appearance: none;
  border: 1px solid #cfcfcf;
  background: #fff;
  color: #232323;
  border-radius: 4px;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.ps-atc-modal__attr.is-selected {
  border-color: var(--atc-bg, #2fb5d2);
  background: var(--atc-bg, #2fb5d2);
  color: var(--atc-text, #fff);
}

.ps-atc-modal__attr.is-color {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border-radius: 50%;
  border-width: 2px;
}

.ps-atc-modal__attr.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ps-atc-modal__select {
  width: 100%;
  max-width: 260px;
  height: 2.3rem;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  padding: 0 0.5rem;
  background: #fff;
}

.ps-atc-modal__total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.7rem 0 0.4rem;
  padding-top: 0.55rem;
  border-top: 1px solid #e5e5e5;
  font-size: 0.95rem;
}

.ps-atc-modal__total-row strong {
  color: var(--atc-bg, #2fb5d2);
  font-size: 1.1rem;
}

.ps-atc-modal__error {
  margin: 0.45rem 0;
  color: #c0392b;
  font-size: 0.9rem;
}

.ps-atc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.ps-atc-modal__actions .ps-atc__btn {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.ps-atc-modal__actions .ps-atc__btn .ps-atc__label {
  white-space: normal;
}

.ps-atc-modal__cancel,
.ps-atc-modal__remove,
.ps-atc-sticky__remove {
  appearance: none;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: var(--atc-radius, 4px);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.ps-atc-modal__remove,
.ps-atc-sticky__remove {
  border-color: #e0a0a0;
  color: #b33;
}

/* Sticky bar */
.ps-atc-sticky[hidden] {
  display: none !important;
}

.ps-atc-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10040;
  background: #fff;
  border-top: 1px solid #e8ebef;
  box-shadow: 0 -12px 40px rgba(15, 23, 32, 0.12);
  padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom));
}

.ps-atc-sticky.is-visible {
  display: block;
  animation: ps-atc-sticky-in 0.22s ease;
}

@keyframes ps-atc-sticky-in {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ps-atc-sticky__x {
  position: absolute;
  top: 0.4rem;
  right: 0.65rem;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: #f2f4f7;
  font-size: 1.15rem;
  line-height: 1;
  color: #5b6570;
  cursor: pointer;
}

.ps-atc-sticky__x:hover {
  background: #e7ebf0;
  color: #232323;
}

.ps-atc-sticky__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
  text-align: left;
}

.ps-atc-sticky__product {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 240px;
  flex: 1.2 1 240px;
}

.ps-atc-sticky__img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f5f7;
  border: 1px solid #eef1f4;
  flex-shrink: 0;
}

.ps-atc-sticky__meta {
  min-width: 0;
  text-align: left;
}

.ps-atc-sticky__name {
  font-weight: 700;
  font-size: 0.98rem;
  color: #1f2933;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.ps-atc-sticky__prices {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-top: 0.28rem;
}

.ps-atc-sticky__unit {
  color: #6b7280;
  font-size: 0.88rem;
  font-weight: 600;
}

.ps-atc-sticky__total-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.ps-atc-sticky__total-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a94a0;
  font-weight: 700;
}

.ps-atc-sticky__total {
  color: var(--atc-bg, #2fb5d2);
  font-weight: 800;
  font-size: 1.05rem;
}

.ps-atc-sticky__controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem 1rem;
  flex: 2 1 340px;
  flex-wrap: wrap;
  text-align: left;
}

.ps-atc-sticky__field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
}

.ps-atc-sticky__field label {
  margin: 0;
  font-size: 0.72rem;
  color: #6b7280;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  white-space: nowrap;
  line-height: 1;
}

.ps-atc-sticky__field select {
  min-width: 104px;
  height: 2.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  padding: 0 0.85rem;
  color: #1f2933;
  font-weight: 600;
}

.ps-atc-sticky__actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
}

.ps-atc__btn--sticky {
  min-height: 2.7rem;
  padding: 0.75rem 1.35rem;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(47, 181, 210, 0.28);
}

.ps-atc-sticky__remove {
  border-radius: 8px;
  min-height: 2.7rem;
  padding: 0.65rem 0.95rem;
  background: #fff;
}

body.ps-atc-sticky-visible {
  padding-bottom: 6.25rem;
}

@media (max-width: 767px) {
  .ps-atc-modal__layout {
    grid-template-columns: 1fr;
  }

  .ps-atc-modal__media {
    min-height: 160px;
  }

  .ps-atc-sticky {
    padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom));
  }

  .ps-atc-sticky__inner {
    gap: 0.7rem;
  }

  .ps-atc-sticky__name {
    max-width: 180px;
    font-size: 0.9rem;
  }

  .ps-atc-sticky__img {
    width: 52px;
    height: 52px;
  }

  .ps-atc-sticky__actions {
    width: 100%;
  }

  .ps-atc-sticky__actions .ps-atc__btn {
    flex: 1;
  }
}

@media (min-width: 768px) {
  body.ps-atc-desktop-off .ps-atc,
  body.ps-atc-desktop-off .ps-atc-sticky {
    display: none !important;
  }
}

@media (max-width: 767px) {
  body.ps-atc-mobile-off .ps-atc,
  body.ps-atc-mobile-off .ps-atc-sticky {
    display: none !important;
  }
}
