/* prefissosidecart.css – versione 1.6 modificata per layout 25/50/25, wrapper e posizionamenti */

/* ==========================================================================
   0) Base / Reset
   ========================================================================== */
/* Nascondi scrollbar orizzontale e box-sizing su tutto il drawer */
.prefissosidecart-drawer {
  overflow-x: hidden !important;
}
.prefissosidecart-drawer,
.prefissosidecart-drawer * {
  box-sizing: border-box !important;
  font-family: 'Open Sans', Arial, sans-serif !important;
}

/* Reset totale per i pulsanti ELIMINA (remove-item & remove-coupon) */
.prefissosidecart-remove-item,
.prefissosidecart-remove-coupon {
  all: unset !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  cursor: pointer !important;
}
/* Icona cestino + testo rosso + hover */
.prefissosidecart-remove-item::before,
.prefissosidecart-remove-coupon::before {
  content: "" !important;
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  background: url("https://sleevemyseal.com/wp-content/uploads/Assets/Cart/Cestino.png")
              no-repeat center/contain !important;
}
.prefissosidecart-remove-item,
.prefissosidecart-remove-coupon {
  color: #e60023 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
.prefissosidecart-remove-item:hover,
.prefissosidecart-remove-coupon:hover {
  text-decoration: underline !important;
}

/* ==========================================================================
   1) Banner “IL MIO CARRELLO” a trapezio
   ========================================================================== */
.prefissosidecart-header {
  clip-path: polygon(4% 0%, 100% 0%, 96% 100%, 0% 100%);
  border-radius: 5px;
  background: #1fae28;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
  margin: 20px;
  font-size: 20px;
  position: relative;
}
.prefissosidecart-header::before,
.prefissosidecart-header::after {
  content: "";
  position: absolute;
  top: 0; height: 100%; width: 20px;
  background: #1fae28;
}
.prefissosidecart-header::before {
  left: -10px;
  transform: skewX(-20deg);
  transform-origin: top left;
}
.prefissosidecart-header::after {
  right: -10px;
  transform: skewX(20deg);
  transform-origin: top right;
}

/* ==========================================================================
   2) Pulsante “CARRELLO” e counter
   ========================================================================== */
.prefissosidecart-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px !important;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(to top, #1e76bd, #67a9f3) !important;
  color: #fff !important;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 2px rgba(0,0,0,0.15) !important;
  text-shadow: 0 3px 0 rgba(0,0,0,0.05) !important;
  overflow: visible;
  position: relative;
  transition: none !important;
  z-index: 0;
}
.prefissosidecart-open-button::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: linear-gradient(to top, #1654ab, #458def);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.prefissosidecart-open-button:hover::before {
  opacity: 1;
  pointer-events: none;
}
.prefissosidecart-open-button .psc-open-icon {
  position: relative;
  top: 1.5px;
  width: 26px;
  height: 26px;
  margin-right: 6px;
  display: block;
  z-index: 1;
}
.prefissosidecart-counter {
  position: absolute;
  top: -13px; right: -13px;
  background: linear-gradient(to top, #f28900, #fac400) !important;
  color: #fff;
  border: solid 3px white;
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* ==========================================================================
   3) Overlay e Drawer
   ========================================================================== */
.prefissosidecart-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}
.prefissosidecart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 35vw; height: 100%;
  background: #fff;
  z-index: 1000;
  overflow-y: auto; overflow-x: hidden;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.prefissosidecart-drawer.open { transform: translateX(0); }
@media (min-width: 3000px) { .prefissosidecart-drawer { width: 21vw; } }
@media (max-width: 768px)  { .prefissosidecart-drawer { width: 100vw; } }

/* ==========================================================================
   4) Lista Prodotti con layout 25% | 50% | 25%
   ========================================================================== */
.prefissosidecart-items { list-style: none; margin: 0; padding: 0; }
.prefissosidecart-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.03);
}
.prefissosidecart-item-image-wrapper {
  flex: 0 0 25% !important;
  max-width: 25% !important;
  border-radius: 10px;
  background: url("https://sleevemyseal.com/wp-content/uploads/Assets/Body/SfondoProdotto.png")
              no-repeat center center !important;
  background-size: 120% !important;
  background-position: center -70px !important;
  transition: box-shadow 0.6s, transform 0.6s;
}
.prefissosidecart-item-image-wrapper img {
  width: 100% !important;
  height: auto !important;
  padding: 10px !important;
  transition: transform 0.8s;
}
.prefissosidecart-item-image-wrapper img:hover { transform: translateY(-2px); }

.prefissosidecart-item-details-wrapper {
  flex: 0 0 50% !important;
  max-width: 50% !important;
  padding-top: 10px !important;
  padding-right: 15px !important;
  padding-left: 10px !important;
  margin-left: -7px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
}
.prefissosidecart-item-details-wrapper .prefissosidecart-item-title { margin: 0 !important; }
.prefissosidecart-item-title { position: relative !important; top: -10px !important; }

@media only screen and (max-width: 768px) {
  #prefissosidecart-drawer .prefissosidecart-item-details-wrapper .prefissosidecart-item-title {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    line-height: 1.4em !important;
    max-height: calc(1.4em * 3) !important;
    margin-bottom: -15px !important;
  }
  #prefissosidecart-drawer .prefissosidecart-item-details-wrapper .prefissosidecart-item-title a {
    display: block !important;
  }
}

.prefissosidecart-item-details-wrapper .prefissosidecart-item-title a {
  all: unset !important;
  display: inline-block !important;
  font-weight: 600 !important;
  font-size: 15.5px !important;
  color: #3e4756 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  margin-left: 10px !important;
}
.prefissosidecart-item-details-wrapper .prefissosidecart-item-title a:hover { text-decoration: underline !important; }

.prefissosidecart-item-details-wrapper .prefissosidecart-item-price {
  font-size: 19px !important;
  color: #56a0f4 !important;
  font-weight: 600 !important;
  margin-top: 5px !important;
  align-self: flex-start !important;
  margin-left: 10px;
}

.prefissosidecart-item-quantity-wrapper {
  flex: 0 0 25% !important;
  max-width: 25% !important;
  margin-top: 0 !important;
  align-self: stretch !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
}

/* ==========================================================================
   5) Controlli Quantità e Rimuovi
   ========================================================================== */
.prefissosidecart-quantity-label {
  font-weight: 600 !important;
  font-size: 14px !important;
  color: #22303c !important;
  margin-left: -13px !important;
}
.prefissosidecart-quantity-controls {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: -2px;
  margin-right: 12px;
}
.prefissosidecart-quantity-controls .prefissosidecart-qty-button {
  width: 26px !important; height: 26px !important;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(to top, #bdcde1, #eff1f3) !important;
  box-shadow: 0 2px 2px rgba(0,0,0,0.15) !important;
  text-shadow: 0 3px 0 rgba(0,0,0,0.05) !important;
  border: none; border-radius: 5px !important;
  font-size: 18px !important; color: #22303c !important;
  padding: 0 !important; line-height: 1 !important;
  cursor: pointer !important;
  position: relative; z-index: 0 !important;
}
.prefissosidecart-quantity-controls .prefissosidecart-qty-button::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: linear-gradient(to top, #9fb6d2, #ebedf1);
  z-index: -1; opacity: 0; transition: opacity 0.7s ease; pointer-events: none;
}
.prefissosidecart-quantity-controls .prefissosidecart-qty-button:hover::before { opacity: 1; }
.prefissosidecart-item-quantity-wrapper .prefissosidecart-remove-item { margin-left: -13px !important; }

.prefissosidecart-quantity-controls .prefissosidecart-qty-input {
  width: 40px !important; height: 26px !important;
  border: 1px solid #ccc !important; border-radius: 5px !important;
  text-align: center !important; font-size: 14px !important;
  font-weight: 600; padding: 0 !important;
  box-shadow: 0 2px 2px rgba(0,0,0,0.15) !important;
}

/* ==========================================================================
   6) Totali, Coupon, Checkout
   ========================================================================== */
.prefissosidecart-totals { padding: 10px; }
.prefissosidecart-totals > div,
.prefissosidecart-totals > a { margin-bottom: 10px; }
#prefissosidecart-coupon-code { width: 60%; padding: 5px; border: 1px solid #ccc; }
#prefissosidecart-apply-coupon { padding: 5px 10px; cursor: pointer; }
.prefissosidecart-applied-coupons { list-style: none; padding: 0; margin: 5px 0 10px; }
.prefissosidecart-applied-coupons li { font-size: 13px; color: #333; }

/* ==========================================================================
   7) Pulsante Checkout
   ========================================================================== */
.prefissosidecart-button-checkout {
  display: block; text-align: center;
  background: #000; color: #fff;
  padding: 10px; text-decoration: none;
}

/* ==========================================================================
   8) Spinner
   ========================================================================== */
.prefissosidecart-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.2); border-top-color: rgba(0,0,0,0.6);
  border-radius: 50%; animation: prefissosidecart-spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes prefissosidecart-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   9) EMPTY CART
   ========================================================================== */
/* Contenitore “Svuota carrello” */
.prefissosidecart-empty-wrap {
  display: flex;
  justify-content: center;
  margin: 15px 0;
}
/* Pulsante “Svuota carrello” */
#prefissosidecart-empty-cart {
  display: inline-block;
  padding: 10px 15px;
  background: none; border: none;
  color: #e60023;
  font-weight: 600; font-size: 14px;
  margin: -5px 0;
  cursor: pointer; opacity: 0.5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s;
  text-align: center;
}
#prefissosidecart-empty-cart:hover { opacity: 1; }

.prefissosidecart-summary-container {
  padding: 25px;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin: 15px;
}
.prefissosidecart-summary-title { font-size: 22px; color: #434c5b; font-weight: 600; }

.prefissosidecart-subtotal { display: flex; justify-content: space-between; align-items: center; }
.prefissosidecart-subtotal .psc-subtotal-label { text-align: left; flex: 1; }
.prefissosidecart-subtotal .psc-subtotal-value { text-align: right; flex: 1; }

.prefissosidecart-subtotal,
.prefissosidecart-shipping {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6aabf4;
  font-size: 16px;
  font-weight: 600;
}
.psc-subtotal-label,
.psc-shipping-label,
.psc-coupon-label{
  flex: 1;
  color: #4b5361 !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  text-align: left;
}
.psc-subtotal-value,
.psc-shipping-value { flex: 1; text-align: right; }

.prefissosidecart-subtotalsubtitle {
  margin-top: -5px;
  color: #b7bfcc;
  font-size: 15px;
  font-weight: 500;
}
.prefissosidecart-spaceundershipping {
  margin-top: 35px !important;
  margin-bottom: 25px !important;
  border-bottom: 1px solid #ccc;
}

/* Contenitore coupon */
.prefissosidecart-coupon {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
#prefissosidecart-coupon-code {
  flex: 0 0 50%;
  width: auto;
  margin: 0;
  border-radius: 6px;
  box-shadow: 0 2px 2px rgba(0,0,0,0.025) !important;
}
#prefissosidecart-apply-coupon {
  position: relative;
  overflow: hidden;
  z-index: 0;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 2px rgba(0,0,0,0.15) !important;
  text-shadow: 0 3px 0 rgba(0,0,0,0.05) !important;
  background: linear-gradient(to top, #1e76bd, #67a9f3) !important;
  color: #fff !important;
  text-decoration: none;
  transition: none !important;
}
#prefissosidecart-apply-coupon::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: linear-gradient(to top, #1654ab, #458def);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.7s ease;
}
#prefissosidecart-apply-coupon:hover::before { opacity: 1; }
.psc-apply-icon { width: 20px; height: 20px; vertical-align: middle; margin-right: 4px; }

@keyframes psc-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}
#prefissosidecart-coupon-code.psc-coupon-error { border: 1px solid red !important; }
.psc-coupon-shake { animation: psc-shake 0.7s ease; }

@media only screen and (max-width: 768px) {
  .prefissosidecart-coupon {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 15px !important;
  }
  .prefissosidecart-coupon .psc-coupon-label {
    width: 100% !important;
    text-align: center !important;
    margin-bottom: 0 !important;
  }
  #prefissosidecart-coupon-code {
    flex: 1 1 auto !important;
    width: 100% !important;
    margin: 0 !important;
  }
  #prefissosidecart-apply-coupon { width: 100% !important; margin-top: 5px !important; }
}

/* Lista coupon */
.prefissosidecart-applied-coupons { margin-top: 1.5em; list-style: none; padding: 0; }
.psc-coupon-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5em; }
.psc-coupon-left { display: flex; align-items: center; }
.psc-coupon-label { font-size: 15px; font-weight: 500; margin-right: 0.25em; }
.psc-coupon-amount { color: #6aabf4; font-size: 17px; font-weight: 600; margin-left: 10px; }
.psc-coupon-right { display: flex; align-items: center; }
.psc-coupon-code {
  display: inline-block; font-size: 15px; font-weight: 600; margin-right: 0.5em;
  background-color: #f3fbf5; padding: 5px 10px 5px 26px; color: #14a92e;
  background-image: url('https://sleevemyseal.com/wp-content/uploads/Assets/Cart/CheckVerde.png');
  background-repeat: no-repeat; background-position: 2px center; background-size: 16px 16px;
  border-radius: 4px; margin-right: 10px;
}

@media only screen and (max-width: 768px) {
  .prefissosidecart-applied-coupons .psc-coupon-left,
  .prefissosidecart-applied-coupons .psc-coupon-right { display: contents !important; }
  .prefissosidecart-applied-coupons .psc-coupon-item {
    display: grid !important;
    grid-template-areas:
      "label  label  label"
      "code   amount remove";
    grid-template-columns: auto auto auto !important;
    row-gap: 0.5em !important;
    justify-items: center !important;
    text-align: center !important;
  }
  .prefissosidecart-applied-coupons .psc-coupon-label { grid-area: label !important; white-space: nowrap !important; }
  .prefissosidecart-applied-coupons .psc-coupon-code { grid-area: code !important; margin: 0 !important; }
  .prefissosidecart-applied-coupons .psc-coupon-amount { grid-area: amount !important; margin: 0 !important; }
  .prefissosidecart-applied-coupons .prefissosidecart-remove-coupon { grid-area: remove !important; margin: 0 !important; }
}

/* Totale Finale */
.prefissosidecart-total {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid #ccc; margin-top: 35px; padding-top: 15px;
}
.psc-total-label { font-size: 22px; font-weight: 600; color: #4b5361; }
.psc-total-value { color: #6aabf4; font-size: 22px; font-weight: 600; }

/* Checkout Button – hover gradient fluido */
.prefissosidecart-button-checkout {
  position: relative; overflow: hidden; z-index: 0;
  display: block !important; width: 50%; margin: 35px auto 0 !important;
  padding: 10px; font-size: 17px; font-weight: 700; border-radius: 6px; cursor: pointer;
  background: linear-gradient(to top, #1e76bd, #67a9f3) !important; color: #fff !important;
  box-shadow: 0 2px 2px rgba(0,0,0,0.15) !important; text-shadow: 0 3px 0 rgba(0,0,0,0.05) !important;
  text-decoration: none; text-align: center; transition: none !important;
}
.prefissosidecart-button-checkout::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit; background: linear-gradient(to top, #1654ab, #458def);
  z-index: -1; opacity: 0; transition: opacity 0.7s ease;
}
.prefissosidecart-button-checkout:hover::before { opacity: 1; }
@media only screen and (max-width: 768px) {
  .prefissosidecart-button-checkout {
    display: block !important; width: 100% !important; margin: 0 !important;
    white-space: nowrap !important; text-align: center !important;
  }
}
.psc-checkout-icon { width: 26px; height: 26px; vertical-align: middle; margin-right: 8px; }
.psc-shipping-free { color: #28a745 !important; font-weight: 700; }

/* Blocca scroll body quando aperto */
body.psc-sidecart-no-scroll { overflow: hidden !important; position: fixed !important; width: 100% !important; }
/* Mobile: sidecart full width */
@media only screen and (max-width: 768px) {
  #prefissosidecart-drawer { width: 100vw !important; max-width: 100vw !important; left: 0 !important; right: auto !important; border-radius: 0 !important; }
}
#prefissosidecart-overlay, #prefissosidecart-drawer { overscroll-behavior: contain; }

/* Close button mobile */
.prefissosidecart-close-mobile {
  position: absolute; top: 15px; right: 15px; padding: 0; background: none !important; border: none;
  font-size: 50px; font-weight: 800; line-height: 1; color: rgba(128,128,128,0.7) !important;
  z-index: 10; box-shadow: none !important; text-shadow: none !important; display: none; cursor: pointer;
}
@media only screen and (max-width: 768px) {
  #prefissosidecart-drawer .prefissosidecart-close-mobile {
    display: block !important; z-index: 1001 !important; top: 15px !important; right: 15px !important; opacity: 1 !important; pointer-events: auto !important;
  }
}

/* Info tooltip */
.psc-info-tooltip {
  position: relative !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 1.3em !important; height: 1.3em !important; margin-left: 6px !important;
  background-color: #868e9a !important; color: transparent !important;
  font-style: italic !important; font-weight: 700 !important; border-radius: 50% !important; cursor: help !important;
  font-size: 1em !important; line-height: 1 !important;
  box-shadow: 0 2px 2px rgba(0,0,0,0.1) !important; text-shadow: 0 3px 0 rgba(0,0,0,0.05) !important;
}
.psc-info-tooltip::before { content: "i" !important; position: relative !important; color: #fff !important; font-style: italic !important; font-weight: normal !important; }
.psc-info-tooltiptext {
  visibility: hidden; width: max-content; max-width: 200px; background-color: rgba(0,0,0,0.8);
  color: #fff; text-align: left; padding: 8px; border-radius: 4px; font-size: 13px; line-height: 1.3;
  position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s;
  z-index: 1002; pointer-events: none;
}
.psc-info-tooltiptext::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border-width: 6px; border-style: solid; border-color: rgba(0,0,0,0.8) transparent transparent transparent;
}
.psc-info-tooltip:hover .psc-info-tooltiptext,
.psc-info-tooltip:focus .psc-info-tooltiptext { visibility: visible; opacity: 1; pointer-events: auto; }

/* Mobile: solo icona nel bottone + badge */
@media only screen and (max-width: 768px) {
  #prefissosidecart-open-button { all: unset !important; font-size: 0 !important; position: relative !important; display: inline-block !important; background: none !important; padding: 0 !important; margin: 0 !important; cursor: pointer !important; }
  #prefissosidecart-open-button::before { display: none !important; }
  #prefissosidecart-open-button .psc-open-icon {
    content: url("https://sleevemyseal.com/wp-content/uploads/Assets/Cart/carrelloblu.png") !important;
    width: 32px !important; height: 32px !important; display: block !important; margin: 0 !important;
  }
  #prefissosidecart-open-button .prefissosidecart-counter {
    display: flex !important; font-size: 12px !important; line-height: 32px !important;
    width: 28px !important; height: 28px !important; top: -5px !important; right: -10px !important;
    position: absolute !important; background: linear-gradient(to top, #f28900, #fac400) !important; color: #fff !important;
    border: 3px solid #fff !important; border-radius: 50% !important; justify-content: center !important; align-items: center !important;
  }
}
@media only screen and (max-width: 768px) {
  #prefissosidecart-open-button { position: relative !important; }
  #prefissosidecart-open-button .prefissosidecart-counter {
    position: absolute !important; top: -15px !important; right: -12px !important; width: 28px !important; height: 28px !important;
    font-size: 11px !important; line-height: 24px !important; display: flex !important; justify-content: center !important; align-items: center !important;
    z-index: 50 !important; border: 2px solid #fff !important;
  }
}
