#scwfc-widget,
#scwfc-reopen {
/*  font-family: Arial, sans-serif; */
  box-sizing: border-box;
}

#scwfc-widget * {
  box-sizing: border-box;
}

#scwfc-widget {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 310px;
  background: var(--scwfc-dark, #111);
  color: #fff;
  border-radius: 16px;
  padding: 12px;
  z-index: 99999;
  box-shadow: 0 10px 28px rgba(0,0,0,.26);
}

.scwfc-close {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 28px;
  height: 28px;
  line-height: 24px;
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 24px;
  cursor: pointer;
}

.scwfc-label {
  font-size: 12px;
  opacity: .75;
  margin-bottom: 3px;
}

.scwfc-price-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding-right: 20px;
}

.scwfc-qty-wrap {
  width: 102px;
}

.scwfc-qty-wrap label {
  display: block;
  font-size: 10px;
  opacity: .75;
  margin-bottom: 3px;
}

.scwfc-qty-control {
  display: grid;
  grid-template-columns: 26px 1fr 26px;
  gap: 3px;
}

.scwfc-qty-minus,
.scwfc-qty-plus {
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

#scwfc-qty {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 7px 4px;
  font-weight: bold;
  text-align: center;
  font-size: 13px;
}

.scwfc-price-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.scwfc-price {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.05;
  display: flex;
  align-items: center;
}

.scwfc-delivery-link {
  margin-top: 3px;
  font-size: 10px;
  color: var(--scwfc-primary, #ffdd00);
  text-decoration: underline;
  font-weight: bold;
  line-height: 1.1;
}

.scwfc-saving {
  color: var(--scwfc-primary, #ffdd00);
  font-weight: bold;
  font-size: 12px;
  line-height: 1.15;
  display: flex;
  align-items: center;
}

.scwfc-discount-link {
  display: inline-block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--scwfc-primary, #ffdd00);
  text-decoration: underline;
  font-weight: bold;
}

.scwfc-mobile-discount-link {
  display: none;
}

.scwfc-info,
.scwfc-progress-text {
  font-size: 11px;
  line-height: 1.3;
  margin-top: 5px;
  color: #e8e8e8;
}

.scwfc-details-toggle {
  display: none;
  width: 100%;
  margin-top: 6px;
  border: 0;
  border-radius: 9px;
  padding: 7px 8px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.scwfc-details-icon {
  font-size: 15px;
  font-weight: bold;
  line-height: 1;
}

.scwfc-dynamic {
  margin-top: 7px;
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: #e8e8e8;
}

.scwfc-dynamic-item {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  background: rgba(255,255,255,.07);
  border-radius: 7px;
}

.scwfc-dynamic-item span {
  opacity: .78;
}

.scwfc-dynamic-item strong {
  text-align: right;
  color: #fff;
}

.scwfc-progress {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 7px;
}

.scwfc-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--scwfc-primary, #ffdd00);
  border-radius: 999px;
  transition: width .25s ease;
}

.scwfc-actions {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.scwfc-add,
.scwfc-whatsapp {
  border: 0;
  border-radius: 10px;
  padding: 9px;
  font-weight: bold;
  cursor: pointer;
}

.scwfc-add {
  flex: 1;
  background: var(--scwfc-primary, #ffdd00);
  color: #111;
}

.scwfc-whatsapp {
  width: 44px;
  background: #25d366;
  color: #fff;
  font-size: 0;
}

#scwfc-reopen {
  display: none;
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 99999;
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  background: var(--scwfc-dark, #111);
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(0,0,0,.24);
  cursor: pointer;
}

@media (max-width: 768px) {
  #scwfc-widget {
    left: 6px;
    right: 6px;
    bottom: 6px;
    width: auto;
    border-radius: 13px;
    padding: 7px;
  }

    .scwfc-close {
        top: 1px;
        right: 4px;
        font-size: 28px;
        font-weight: bold;
        width: 30px;
        height: 30px;
        line-height: 30px;
        background: #ffffff;
        color: #000000;
        border-radius: 24px;
    }

  .scwfc-label,
  .scwfc-info,
  .scwfc-progress,
  .scwfc-progress-text,
  .scwfc-discount-link {
    display: none !important;
  }

  .scwfc-price-row {
    display: grid;
    grid-template-columns: 125px 1fr 76px;
    gap: 5px;
    align-items: stretch;
    padding-right: 24px;
  }

  .scwfc-qty-wrap {
    width: auto;
    order: 1;
    background: rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 0 4px;
  }

  .scwfc-qty-wrap label {
    display: block;
    text-align: center;
    font-size: 10px;
    margin-bottom: 0px;
    opacity: .8;
    color: #dddddd;
  }

  .scwfc-qty-control {
    grid-template-columns: 24px 1fr 24px;
    gap: 2px;
  }

  .scwfc-qty-minus,
  .scwfc-qty-plus {
    height: 20px;
    border-radius: 7px;
    font-size: 15px;
  }

  #scwfc-qty {
    height: 20px;
    padding: 3px;
    font-size: 13px;
    border-radius: 7px;
  }

  .scwfc-mobile-discount-link {
    display: block;
    margin-top: 3px;
    color: var(--scwfc-primary, #ffdd00);
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    text-decoration: underline;
    font-weight: bold;
  }

  .scwfc-price-wrap {
    order: 2;
    background: rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 5px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .scwfc-price {
    background: transparent;
    padding: 0;
    font-size: 20px;
    line-height: 1.05;
    text-align: center;
    justify-content: center;
  }

  .scwfc-delivery-link {
    display: block;
    font-size: 9px;
    margin-top: 5px;
    text-align: center;
  }

  .scwfc-saving {
    order: 3;
    margin: 0;
    background: rgba(255,221,0,.14);
    border-radius: 10px;
    padding: 6px 4px;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    color: var(--scwfc-primary, #ffdd00);
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .scwfc-saving::before {
    content: "🏷️ Ahorra ";
    margin-right: 2px;
  }

  .scwfc-details-toggle {
    display: flex;
  }

  .scwfc-dynamic {
    display: none !important;
  }

  #scwfc-widget.scwfc-expanded .scwfc-dynamic {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 6px;
    font-size: 12px;
  }

  .scwfc-actions {
    gap: 6px;
    margin-top: 6px;
  }

  .scwfc-add {
    flex: 1;
    padding: 8px;
    border-radius: 10px;
    font-size: 13px;
  }

  .scwfc-whatsapp {
    width: 40px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
  }

  #scwfc-reopen {
    right: 6px;
    bottom: 6px;
    padding: 9px 13px;
    font-size: 12px;
  }
}
/* Evita que el widget móvil tape botones nativos inferiores del tema. */
@media (max-width: 768px) {
  body.scwfc-widget-open {
    padding-bottom: 86px;
  }

  body.scwfc-widget-expanded {
    padding-bottom: 190px;
  }
}

/* Efecto visual cuando PrestaShop/Dynamic Product actualiza el precio. */
.scwfc-price-wrap {
  position: relative;
  transition: background .22s ease, box-shadow .22s ease, transform .22s ease;
}

.scwfc-price-flash {
  background: rgba(255, 221, 0, .16);
  box-shadow: 0 0 0 2px rgba(255, 221, 0, .42), 0 0 18px rgba(255, 221, 0, .28);
  transform: scale(1.015);
}

.scwfc-price-updated {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--scwfc-primary, #ffdd00);
  color: #111;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.scwfc-price-updated-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .scwfc-price-updated {
    margin-left: auto;
    margin-right: auto;
    font-size: 9px;
    padding: 3px 6px;
  }

  .scwfc-price-flash {
    transform: scale(1.01);
  }
}

/* Botón WhatsApp mejorado y reutilizable.
   Se puede usar fuera del widget con: class="scwfc-whatsapp-trigger" o data-scwfc-whatsapp="1". */
.scwfc-whatsapp,
.scwfc-whatsapp-external {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: #25d366;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

.scwfc-whatsapp:hover,
.scwfc-whatsapp-external:hover {
  filter: brightness(.96);
  color: #fff;
  text-decoration: none;
}

.scwfc-wa-cart,
.scwfc-wa-icon {
  font-family: FontAwesome;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.scwfc-wa-cart::before {
  content: "\f07a";
}

.scwfc-wa-icon::before {
  content: "\f232";
}

.scwfc-whatsapp .scwfc-wa-text {
  display: none;
}

.scwfc-whatsapp.scwfc-whatsapp-has-text {
  width: auto;
  min-width: 128px;
  padding-left: 11px;
  padding-right: 11px;
  font-size: 12px;
}

.scwfc-whatsapp.scwfc-whatsapp-has-text .scwfc-wa-text {
  display: inline-flex;
}

.scwfc-whatsapp-external {
  min-height: 42px;
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(37, 211, 102, .24);
}

.scwfc-whatsapp-external .scwfc-wa-cart,
.scwfc-whatsapp-external .scwfc-wa-icon {
  font-size: 17px;
}

.scwfc-whatsapp-external .scwfc-wa-text {
  display: inline-flex;
}

.scwfc-whatsapp-external.scwfc-wa-compact,
.scwfc-whatsapp-external[data-scwfc-show-text="0"] {
  width: 44px;
  min-width: 44px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
}

.scwfc-whatsapp-external.scwfc-wa-compact .scwfc-wa-text,
.scwfc-whatsapp-external[data-scwfc-show-text="0"] .scwfc-wa-text {
  display: none;
}

.scwfc-whatsapp .scwfc-wa-cart,
.scwfc-whatsapp .scwfc-wa-icon {
  font-size: 18px;
}

.scwfc-whatsapp.scwfc-whatsapp-has-text {
  font-size: 12px;
}

@media (max-width: 768px) {
  .scwfc-whatsapp.scwfc-whatsapp-has-text {
    min-width: 118px;
    height: 34px;
    padding: 0 9px;
  }
}
