:root {
	--scw-accent: #10b5a0;
	--scw-btn: #0b6aa2;
	--scw-count-bg: #10b5a0;
	--scw-count-color: #fff;
	--scw-fab-size: 58px;
	--scw-text: #222;
	--scw-muted: #6b7280;
	--scw-line: #e5e7eb;
	--scw-track: #dedfee;
	--scw-upsell-bg: #f7f7fd;
	--scw-green: #2e8b3d;
	--scw-red: #d9453b;
}

html.scw-lock { overflow: hidden; }

/* ---------- Overlay y drawer ---------- */
.scw-overlay {
	position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
	opacity: 0; visibility: hidden;
	transition: opacity .25s, visibility 0s .25s;
	z-index: 999998;
}
.scw-overlay.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }

.scw-drawer {
	position: fixed; top: 0; right: 0; height: 100%;
	width: 460px; max-width: 100%;
	background: #fff; color: var(--scw-text);
	font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	border-radius: 0; overflow: hidden;
	box-shadow: -8px 0 30px rgba(0, 0, 0, .18);
	transform: translateX(105%); visibility: hidden;
	transition: transform .3s ease, visibility 0s .3s, width .2s;
	z-index: 999999; box-sizing: border-box;
}
.scw-drawer *, .scw-drawer *::before, .scw-drawer *::after { box-sizing: border-box; }
.scw-drawer.scw-wide { width: 660px; }
.scw-drawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.scw-drawer.is-loading .scw-main { opacity: .6; pointer-events: none; transition: opacity .15s; }

body.rtl .scw-drawer { right: auto; left: 0; border-radius: 0; transform: translateX(-105%); box-shadow: 8px 0 30px rgba(0, 0, 0, .18); }
body.rtl .scw-drawer.is-open { transform: none; }

.scw-drawer button { font-family: inherit; }
.scw-drawer a { color: var(--scw-btn); }
.scw-drawer del { color: var(--scw-red); opacity: .9; }
.scw-drawer h2, .scw-drawer h3 { margin: 0; padding: 0; border: 0; }
.scw-img { display: block; object-fit: contain; max-width: none; }

.scw-panel { display: flex; width: 100%; height: 100%; }

/* ---------- Iconos de interfaz dibujados con CSS (trazos de 1 px, sin desenfoque) ---------- */
.scw-i { position: relative; display: inline-block; flex: none; width: var(--s, 12px); height: var(--s, 12px); color: inherit; vertical-align: middle; }
.scw-i::before, .scw-i::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; margin-top: 0; background: currentColor; }
.scw-i-minus::after { display: none; }
.scw-i-plus::after { left: 50%; right: auto; top: 0; bottom: 0; width: 1px; height: auto; margin: 0; }
.scw-i-x::before, .scw-i-x::after { margin-top: -.5px; }
.scw-i-x::before { transform: rotate(45deg); }
.scw-i-x::after { transform: rotate(-45deg); }
.scw-i-chevron::before {
	left: 50%; right: auto; top: 50%; box-sizing: border-box;
	width: calc(var(--s, 16px) * .5); height: calc(var(--s, 16px) * .5);
	margin: calc(var(--s, 16px) * -.375) 0 0 calc(var(--s, 16px) * -.25);
	background: none; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg);
}
.scw-i-chevron::after { display: none; }

/* ---------- Upsell (columna izquierda) ---------- */
.scw-upsell {
	width: 190px; flex: none; overflow-y: auto;
	background: var(--scw-upsell-bg); padding: 18px 12px; text-align: center;
}
.scw-upsell-title { font-size: 14px; font-weight: 600; margin-bottom: 16px !important; color: var(--scw-text); }
.scw-up-item { margin-bottom: 26px; }
.scw-up-thumb { display: block; width: 64px; margin: 0 auto 8px; }
.scw-up-thumb img { display: block; width: 100%; height: auto !important; max-width: 100%; object-fit: contain; }
.scw-up-name { display: block; font-weight: 500; font-size: 14px; color: var(--scw-text) !important; text-decoration: none; }
.scw-up-price { margin-top: 4px; font-size: 14px; }
.scw-up-price del { margin-right: 4px; }
.scw-up-price ins { text-decoration: none; }
.scw-add {
	display: inline-block; margin-top: 8px; padding: 5px 20px; cursor: pointer;
	background: #fff; color: var(--scw-btn) !important; text-decoration: none;
	border: 1px solid var(--scw-btn); border-radius: 6px; font-size: 14px; line-height: 1.4;
	transition: background .15s, color .15s;
}
.scw-add:hover, .scw-add:focus-visible { background: var(--scw-btn); color: #fff !important; }
.scw-add:disabled { opacity: .5; cursor: default; }

.scw-upsell-inline { display: none; }

/* ---------- Columna principal ---------- */
.scw-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; position: relative; }
.scw-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.scw-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 500; color: var(--scw-text); }
.scw-title-count {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 26px; height: 26px; padding: 0 6px; border-radius: 50%;
	background: var(--scw-count-bg); color: var(--scw-count-color);
	font-size: 13px; font-weight: 600; line-height: 1;
}
.scw-close { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--scw-text); line-height: 0; border-radius: 6px; }
.scw-close:hover { background: #f1f1f4; }

/* ---------- Barra de recompensas ---------- */
.scw-rewards { padding: 14px 20px 40px; text-align: center; border-top: 1px solid var(--scw-line); border-bottom: 1px solid var(--scw-line); }
.scw-reward-msg { margin: 0 0 20px; font-size: 14px; }
.scw-track { position: relative; height: 6px; margin: 0 26px; border-radius: 4px; background: var(--scw-track); }
.scw-fill { height: 100%; border-radius: 4px; background: var(--scw-accent); transition: width .4s ease; }
.scw-ms {
	position: absolute; top: 50%; transform: translate(-50%, -50%);
	width: 34px; height: 34px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: #fff; color: #555; border: 2px solid var(--scw-track);
	transition: background .3s, border-color .3s, color .3s;
}
.scw-ms .scw-img { width: 18px; height: 18px; }
.scw-ms.is-done { background: var(--scw-accent); border-color: var(--scw-accent); color: #fff; }
.scw-ms-label {
	position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
	white-space: nowrap; font-size: 12px; color: var(--scw-muted);
}

/* ---------- Productos ---------- */
.scw-body { flex: 1; overflow-y: auto; padding: 0 20px; }
.scw-items { list-style: none; margin: 0; padding: 0; }
.scw-item { display: flex; gap: 14px; padding: 16px 0; margin: 0; align-items: flex-start; }
.scw-thumb { position: relative; width: 64px; flex: none; }
.scw-thumb img { display: block; width: 100%; height: auto !important; max-width: 100%; object-fit: contain; }
.scw-remove {
	position: absolute; top: -7px; left: -7px; z-index: 1;
	width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: #d6d6da; color: #333; cursor: pointer;
}
.scw-remove:hover { background: var(--scw-red); color: #fff; }
.scw-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.scw-name, .scw-name a { font-size: 15px; font-weight: 500; color: var(--scw-text) !important; text-decoration: none; display: block; }

/* Color / talla: siempre debajo del nombre, una línea por atributo */
.scw-meta { display: block; width: 100%; margin-top: 3px; }
.scw-meta-line { display: block; font-size: 13px; line-height: 1.4; color: var(--scw-muted); }
.scw-meta-key, .scw-meta-val { display: inline; }

.scw-qty { display: inline-flex; align-items: center; margin-top: 8px; border: 1px solid var(--scw-line); border-radius: 6px; overflow: hidden; }
.scw-qty-btn { width: 28px; height: 28px; padding: 0; border: 0; background: #f6f6f8; color: var(--scw-text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.scw-qty-btn:hover:not(:disabled) { background: #ebebef; }
.scw-qty-btn:disabled { opacity: .4; cursor: default; }
.scw-qty-num { min-width: 34px; text-align: center; font-size: 14px; }
.scw-price { text-align: right; white-space: nowrap; font-size: 15px; }
.scw-price del { display: block; font-size: 13px; }
.scw-save { color: var(--scw-green); font-size: 13px; }

.scw-empty { text-align: center; padding: 56px 10px; color: var(--scw-muted); }
.scw-empty p { margin: 14px 0 20px; }
.scw-btn { display: inline-block; padding: 10px 22px; border-radius: 6px; background: var(--scw-btn); color: #fff !important; text-decoration: none; font-weight: 500; }

/* ---------- Footer ---------- */
.scw-foot { border-top: 1px solid var(--scw-line); }
.scw-coupon-toggle {
	width: 100%; display: flex; align-items: center; justify-content: space-between;
	padding: 16px 20px; background: none; border: 0; border-bottom: 1px solid var(--scw-line);
	font-size: 15px; font-weight: 500; color: var(--scw-text); cursor: pointer; text-align: left;
}
.scw-coupon-title { display: inline-flex; align-items: center; gap: 10px; }
.scw-coupon-toggle .scw-i-chevron { transition: transform .2s; }
.scw-coupon-toggle[aria-expanded="true"] .scw-i-chevron { transform: rotate(180deg); }
.scw-coupon-box { padding: 12px 20px; border-bottom: 1px solid var(--scw-line); }
.scw-coupon-row { display: flex; gap: 8px; }
.scw-coupon-msg { margin-top: 8px; font-size: 13px; line-height: 1.35; color: var(--scw-text); }
.scw-coupon-msg[hidden] { display: none; }
.scw-coupon-msg .scw-bad { color: var(--scw-red); }

/* Animaciones de aparición (fundido suave) */
@keyframes scw-fade-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes scw-fade-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-6px); } }
.scw-coupon-box:not([hidden]) { animation: scw-fade-in .28s ease; }
.scw-coupon-box.no-anim { animation: none; }
.scw-coupon-box.is-closing { animation: scw-fade-out .2s ease forwards; }
.scw-coupon-msg:not([hidden]) { animation: scw-fade-in .25s ease; }
.scw-anim { animation: scw-fade-in .35s ease both; }
.scw-coupon-box[hidden] { display: none; }
.scw-coupon-input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid #cfd2d8; border-radius: 6px; font-size: 14px; background: #fff; color: var(--scw-text); }
.scw-drawer .scw-coupon-input:focus { outline: 0 !important; box-shadow: none !important; border: 1px solid var(--scw-btn) !important; }
.scw-coupon-apply { padding: 0 18px; border: 0; border-radius: 6px; background: var(--scw-btn); color: #fff; cursor: pointer; font-size: 14px; }

.scw-totals { padding: 12px 20px 0; }
.scw-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 14px; color: var(--scw-muted); }
.scw-discount { color: var(--scw-green); }
.scw-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 6px 1px 8px; font-size: 13px; color: var(--scw-green); background: #f3faf4; border: 1px dashed var(--scw-green); border-radius: 12px; }
.scw-chip-x { width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #6b6f76; color: #fff; cursor: pointer; }

/* Total: etiqueta + nota a la izquierda, importe grande a la derecha */
.scw-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 6px; }
.scw-total-left { display: flex; flex-direction: column; min-width: 0; }
.scw-total-label { font-size: 17px; font-weight: 500; line-height: 1.2; color: var(--scw-text); }
.scw-total-note { margin-top: 3px; font-size: 12px; line-height: 1.3; color: var(--scw-text); }
.scw-total-amount { font-size: 24px; font-weight: 400; line-height: 1.1; white-space: nowrap; color: var(--scw-text); }

/* Botones */
.scw-actions { display: flex; gap: 10px; margin: 10px 20px 20px; }
.scw-checkout, .scw-cartbtn {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	padding: 14px 16px; border-radius: 8px; text-decoration: none;
	font-size: 17px; font-weight: 500; line-height: 1.2; text-align: center;
	transition: filter .15s, background .15s, color .15s;
}
.scw-checkout { flex: 1.4; background: var(--scw-btn); color: #fff !important; border: 2px solid var(--scw-btn); }
.scw-checkout:hover { filter: brightness(1.08); }
.scw-cartbtn { flex: 1; background: #fff; color: var(--scw-btn) !important; border: 2px solid var(--scw-btn); }
.scw-cartbtn:hover { background: var(--scw-btn); color: #fff !important; }
.scw-actions .scw-img { width: 22px; height: 22px; }

/* ---------- Toast ---------- */
.scw-toast {
	position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%);
	max-width: 85%; padding: 10px 16px; border-radius: 8px;
	background: #1f2937; color: #fff; font-size: 14px; text-align: center;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .25); z-index: 5;
}
.scw-toast.is-error { background: var(--scw-red); }

/* ---------- Iconos con contador (flotante y shortcode) ---------- */
.scw-fab, .scw-inline-icon {
	position: relative; cursor: pointer; border: 0; line-height: 0; text-decoration: none;
	display: inline-flex; align-items: center; justify-content: center;
}
.scw-ico { display: inline-flex; line-height: 0; color: var(--ico, currentColor); transition: color .15s; }
.scw-svg { display: block; }
.scw-ico-hover { display: none; }
.scw-has-hover:hover .scw-ico-main, .scw-has-hover:focus-visible .scw-ico-main { display: none; }
.scw-has-hover:hover .scw-ico-hover, .scw-has-hover:focus-visible .scw-ico-hover { display: inline-flex; }
.scw-fab:hover .scw-ico, .scw-fab:focus-visible .scw-ico,
.scw-inline-icon:hover .scw-ico, .scw-inline-icon:focus-visible .scw-ico,
.scw-checkout:hover .scw-ico, .scw-checkout:focus-visible .scw-ico,
.scw-cartbtn:hover .scw-ico, .scw-cartbtn:focus-visible .scw-ico,
.scw-coupon-toggle:hover .scw-ico, .scw-coupon-toggle:focus-visible .scw-ico { color: var(--ico-h, var(--ico, currentColor)); }
/* Icono del hito: un color con la barra incompleta y otro con la barra completa */
.scw-ms .scw-ico { color: var(--ico, currentColor); }
.scw-ms.is-done .scw-ico { color: var(--ico-d, currentColor); }

.scw-fab {
	position: fixed; bottom: 22px; right: 22px;
	width: var(--scw-fab-size); height: var(--scw-fab-size); border-radius: 50%;
	background: var(--scw-btn); color: #fff; z-index: 99990;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .25); transition: transform .15s;
}
.scw-fab:hover { transform: scale(1.06); }
.scw-fab.scw-pos-left { right: auto; left: 22px; }
.scw-fab-plain { background: none; box-shadow: none; border-radius: 0; color: var(--scw-btn); }
.scw-inline-icon { background: none; color: inherit; padding: 4px; }
.scw-inline-icon .scw-img, .scw-fab .scw-img { display: block; }

.scw-count {
	position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
	border-radius: 10px; background: var(--scw-count-bg); color: var(--scw-count-color);
	font: 600 11px/20px -apple-system, "Segoe UI", Roboto, Arial, sans-serif; text-align: center;
}
.scw-count[data-count="0"] { display: none; }

/* ---------- Móvil ---------- */
@media (max-width: 700px) {
	.scw-drawer, .scw-drawer.scw-wide { width: 100%; border-radius: 0; }
	.scw-upsell { display: none; }
	.scw-upsell-inline { display: block; padding: 6px 0 16px; border-top: 1px solid var(--scw-line); }
	.scw-upsell-inline .scw-upsell-title { margin: 12px 0 10px !important; }
	.scw-upsell-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
	.scw-upsell-row .scw-up-item { flex: 0 0 130px; margin: 0; padding: 10px; text-align: center; background: var(--scw-upsell-bg); border-radius: 10px; }
	.scw-fab { bottom: 16px; right: 16px; }
	.scw-fab.scw-pos-left { right: auto; left: 16px; }
	.scw-fab.scw-hide-mobile { display: none; }
	.scw-checkout, .scw-cartbtn { font-size: 15px; padding: 12px 10px; }
}

/* ---------- Esquinas rectas (fotos, botones, +/- y campo de cupón) ---------- */
.scw-drawer .scw-thumb img,
.scw-drawer .scw-up-thumb img,
.scw-drawer .scw-add,
.scw-drawer .scw-btn,
.scw-drawer .scw-qty,
.scw-drawer .scw-qty-btn,
.scw-drawer .scw-coupon-input,
.scw-drawer .scw-coupon-apply,
.scw-drawer .scw-checkout,
.scw-drawer .scw-cartbtn,
.scw-drawer .scw-close,
.scw-drawer .scw-upsell-row .scw-up-item { border-radius: 0 !important; }

@media (prefers-reduced-motion: reduce) {
	.scw-coupon-box, .scw-coupon-msg, .scw-anim { animation: none !important; }
	.scw-drawer, .scw-overlay, .scw-fill, .scw-ms { transition: none; }
}
