#localCartRoot,
#localCartRoot * { box-sizing: border-box; }

#localCartRoot .lcd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 99990;
}

#localCartRoot.open .lcd-overlay {
  opacity: 1;
  pointer-events: auto;
}

#localCartRoot .lcd-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: #fff;
  z-index: 99991;
  transform: translateX(105%);
  transition: transform .28s ease;
  display: flex;
  flex-direction: column;
  font-family: Poppins, system-ui, sans-serif;
  color: #121212;
  box-shadow: -10px 0 40px rgba(0,0,0,.12);
}

#localCartRoot.open .lcd-drawer { transform: translateX(0); }

#localCartRoot .lcd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(18,18,18,.08);
}

#localCartRoot .lcd-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

#localCartRoot .lcd-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

#localCartRoot .lcd-timer {
  margin: 12px 18px 0;
  background: #121212;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

#localCartRoot .lcd-body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 8px;
}

#localCartRoot .lcd-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  padding: 10px 0 16px;
  border-bottom: 1px solid rgba(18,18,18,.08);
}

#localCartRoot .lcd-item img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f3f3;
}

#localCartRoot .lcd-item__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

#localCartRoot .lcd-item__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

#localCartRoot .lcd-remove {
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: .7;
  padding: 2px;
}

#localCartRoot .lcd-item__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
}

#localCartRoot .lcd-qty {
  display: inline-flex;
  align-items: center;
  background: #f3f3f3;
  border-radius: 8px;
  overflow: hidden;
}

#localCartRoot .lcd-qty button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

#localCartRoot .lcd-qty span {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}

#localCartRoot .lcd-prices {
  text-align: right;
}

#localCartRoot .lcd-price {
  color: #ffce12;
  font-weight: 700;
  font-size: 15px;
}

#localCartRoot .lcd-compare {
  color: #888;
  text-decoration: line-through;
  font-size: 12px;
  display: block;
}

#localCartRoot .lcd-save-note {
  color: #888;
  font-size: 12px;
}

#localCartRoot .lcd-upsell {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(18,18,18,.1);
  border-radius: 12px;
  background: #fff;
}

#localCartRoot .lcd-upsell img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

#localCartRoot .lcd-upsell__title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.25;
}

#localCartRoot .lcd-upsell__price {
  font-size: 13px;
}
#localCartRoot .lcd-upsell__price strong { color: #ffce12; }
#localCartRoot .lcd-upsell__price s { color: #999; margin-left: 6px; }

#localCartRoot .lcd-switch {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: 0;
  background: #ddd;
  position: relative;
  cursor: pointer;
  padding: 0;
  transition: background .2s ease;
}
#localCartRoot .lcd-switch.on { background: #ffce12; }
#localCartRoot .lcd-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
#localCartRoot .lcd-switch.on i { left: 23px; }

#localCartRoot .lcd-gifts {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
}
#localCartRoot .lcd-gifts img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

#localCartRoot .lcd-footer {
  border-top: 1px solid rgba(18,18,18,.1);
  padding: 14px 18px 18px;
  background: #fff;
}

#localCartRoot .lcd-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 15px;
}

#localCartRoot .lcd-row.savings { color: #ffce12; font-weight: 700; }
#localCartRoot .lcd-row.subtotal { font-weight: 700; font-size: 17px; margin-bottom: 12px; }

#localCartRoot .lcd-checkout {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: #ffce12;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}
#localCartRoot .lcd-checkout:disabled { opacity: .6; cursor: wait; }

#localCartRoot .lcd-pays {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  opacity: .85;
}
#localCartRoot .lcd-pays span {
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 3px 6px;
  color: #555;
  background: #fafafa;
}

#localCheckoutModal {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(420px, calc(100% - 2rem));
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
  font-family: Poppins, sans-serif;
  z-index: 100000;
}
#localCheckoutModal::backdrop { background: rgba(0,0,0,.45); }
#localCheckoutModal .box { padding: 24px; }
#localCheckoutModal h2 { margin: 0 0 8px; font-size: 22px; }
#localCheckoutModal p { margin: 0 0 14px; color: #666; font-size: 14px; }
#localCheckoutModal label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
#localCheckoutModal input { border: 1px solid #ccc; border-radius: 6px; padding: 12px; font: inherit; }
#localCheckoutModal .row { display: flex; gap: 10px; align-items: center; }
#localCheckoutModal .pay {
  flex: 1; min-height: 52px; border: 0; border-radius: 8px;
  background: #ffce12; color: #121212; font-weight: 700; font-size: 16px; cursor: pointer;
}
#localCheckoutModal .cancel {
  border: 1px solid #121212; background: #fff; border-radius: 6px;
  padding: 12px 16px; cursor: pointer; font-weight: 600;
}
#localCheckoutModal .err { color: #b42318; font-size: 13px; margin-top: 10px; display: none; }

.shopify-pc__banner__dialog, #shopify-pc__banner { display: none !important; }

@media (max-width: 749px) {
  #localCartRoot .lcd-drawer {
    width: 100%;
    max-width: 100%;
  }
  #localCartRoot .lcd-header h2 { font-size: 18px; }
  #localCartRoot .lcd-item {
    grid-template-columns: 72px 1fr;
  }
  #localCartRoot .lcd-checkout {
    min-height: 54px;
    font-size: 17px;
  }
  #localCartRoot .lcd-footer {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
}

/* Help Shopify theme product section on small screens */
@media (max-width: 749px) {
  .product,
  .featured-product,
  .product--medium {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Nascondi sticky ATC del tema: usiamo solo #lcdStickyAtc */
  sticky-atc,
  .sticky-atc {
    display: none !important;
  }

  body.lcd-sticky-atc-on {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #lcdStickyAtc {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99970;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 253, 248, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(18, 18, 18, 0.08);
    box-shadow: 0 -6px 24px rgba(18, 18, 18, 0.06);
    transition: transform .28s ease, opacity .28s ease;
  }

  #lcdStickyAtc.is-hidden {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
  }

  #lcdStickyAtc button {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: #ffce12;
    color: #121212;
    font-family: Poppins, system-ui, sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(18, 18, 18, 0.12);
    animation: lcdAtcPulse 2.4s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  #lcdStickyAtc button span {
    display: inline-block;
  }

  .lcd-atc-arrow {
    flex-shrink: 0;
    display: block;
    opacity: 0.85;
    animation: lcdAtcArrow 1.6s ease-in-out infinite;
  }

  #lcdStickyAtc:not(.is-hidden) button {
    animation: lcdAtcIn .45s ease both, lcdAtcPulse 2.4s ease-in-out .45s infinite;
  }

  #lcdStickyAtc button:active {
    transform: translateY(1px) scale(0.99);
    animation: none;
  }

  /* Freccia minimale anche sul bottone in pagina */
  button.product-form__submit .main-atc__label,
  .main-atc .main-atc__label,
  button.product-form__submit .button__label {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  button.product-form__submit .main-atc__label__text,
  .main-atc .main-atc__label__text {
    display: inline-block;
    animation: lcdAtcSoft 2.8s ease-in-out infinite;
  }

  button.product-form__submit .main-atc__label::after,
  .main-atc .main-atc__label::after,
  button.product-form__submit .button__label::after {
    content: "";
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background: currentColor;
    opacity: 0.85;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 8h9M8.5 4.5 12.5 8 8.5 11.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 8h9M8.5 4.5 12.5 8 8.5 11.5'/%3E%3C/svg%3E") center / contain no-repeat;
    animation: lcdAtcArrow 1.6s ease-in-out infinite;
  }
}

@media (min-width: 750px) {
  button.product-form__submit .main-atc__label,
  .main-atc .main-atc__label,
  button.product-form__submit .button__label {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  button.product-form__submit .main-atc__label::after,
  .main-atc .main-atc__label::after,
  button.product-form__submit .button__label::after {
    content: "";
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    background: currentColor;
    opacity: 0.85;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 8h9M8.5 4.5 12.5 8 8.5 11.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 8h9M8.5 4.5 12.5 8 8.5 11.5'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}

@keyframes lcdAtcIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes lcdAtcPulse {
  0%, 100% { box-shadow: 0 2px 0 rgba(18, 18, 18, 0.12), 0 0 0 0 rgba(255, 206, 18, 0.45); }
  50% { box-shadow: 0 2px 0 rgba(18, 18, 18, 0.12), 0 0 0 8px rgba(255, 206, 18, 0); }
}

@keyframes lcdAtcSoft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes lcdAtcArrow {
  0%, 100% { transform: translateX(0); opacity: 0.75; }
  50% { transform: translateX(3px); opacity: 1; }
}

@media (min-width: 750px) {
  #lcdStickyAtc { display: none !important; }
  body.lcd-sticky-atc-on { padding-bottom: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  #lcdStickyAtc button,
  #lcdStickyAtc:not(.is-hidden) button,
  button.product-form__submit .main-atc__label__text,
  .main-atc .main-atc__label__text,
  .lcd-atc-arrow,
  button.product-form__submit .main-atc__label::after,
  .main-atc .main-atc__label::after,
  button.product-form__submit .button__label::after {
    animation: none !important;
  }
}
