/* Editor envolvente de tazas (modo «wrap»). Usa los tokens del tema regalos-organic. */
.rw-trigger { margin: 16px 0; }
.rw-trigger .ragpd-open-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
	border: 0; border-radius: var(--wp--custom--radius--lg, 16px); padding: 14px 32px;
	font: 600 15px/1.2 var(--wp--preset--font-family--body, inherit); letter-spacing: .03em;
	background: var(--wp--preset--color--cta-orange, #d56532); color: #fff; cursor: pointer;
}
.rw-trigger .ragpd-open-btn::before { content: "🎨"; }
.rw-trigger .ragpd-open-btn:hover { background: var(--wp--preset--color--primary, #82542b); }
.rw-trigger-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 8px; border: 1px solid #e4dccf; border-radius: 12px; background: #fffaf3; }
.rw-trigger-preview[hidden] { display: none; }
.rw-trigger-preview img { width: 140px; height: auto; border-radius: 8px; background: #fff; }
.rw-trigger-preview span { font-size: 14px; color: var(--wp--preset--color--secondary, #5b614c); font-weight: 600; }
.ragpd-status { font-size: 13px; margin: 8px 0 0; }
.ragpd-status.is-ok { color: #5b614c; }
.ragpd-status.is-error { color: #ba1a1a; }

.rw-modal { position: fixed; inset: 0; z-index: 2147483000; background: rgba(28, 28, 24, .7); display: flex; align-items: center; justify-content: center; padding: 12px; font-family: var(--wp--preset--font-family--body, system-ui, sans-serif); color: #2b2a26; }
.rw-modal[hidden] { display: none; }
.rw-shell { width: min(1240px, 100%); max-height: calc(100vh - 24px); display: flex; flex-direction: column; background: #fdfaf5; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.rw-head { display: flex; align-items: baseline; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #ece4d8; background: #fff; }
.rw-head strong { font-family: var(--wp--preset--font-family--heading, Georgia, serif); font-size: 22px; color: #22382c; }
.rw-head-sub { font-size: 13px; color: #6f6a60; }
.rw-x { margin-left: auto; border: 0; background: #f2ece3; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.rw-x:hover { background: #e7ddcf; }

.rw-body { flex: 1; display: grid; grid-template-columns: 300px 1fr; min-height: 0; overflow: hidden; }
.rw-side { border-right: 1px solid #ece4d8; background: #fff; overflow-y: auto; }
.rw-main { overflow-y: auto; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }

.rw-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid #ece4d8; position: sticky; top: 0; background: #fff; z-index: 1; }
.rw-tab { border: 0; background: none; padding: 12px 2px; font-size: 12px; font-weight: 600; color: #6f6a60; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-tab.is-active { color: #82542b; border-bottom-color: #d56532; }
.rw-panel { display: none; padding: 16px; }
.rw-panel.is-active { display: block; }

.rw-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px; border: 2px dashed #d9c9b3; border-radius: 14px; background: #fffaf3; text-align: center; cursor: pointer; transition: .15s; }
.rw-drop:hover, .rw-drop.is-over { border-color: #d56532; background: #fff3e8; }
.rw-drop-icon { font-size: 26px; color: #d56532; }
.rw-drop small { color: #7a7368; font-size: 12px; line-height: 1.4; }
.rw-qr-btn { margin-top: 10px; font-size: 13px; padding: 10px 12px; }
.rw-qr { margin-top: 10px; padding: 14px; border: 1px solid #e4dccf; border-radius: 14px; background: #fff; text-align: center; }
.rw-qr[hidden] { display: none; }
.rw-qr-code { display: flex; justify-content: center; }
.rw-qr-code svg, .rw-qr-code img { width: 190px; height: 190px; }
.rw-qr-steps { text-align: left; font-size: 12.5px; color: #5f5a52; margin: 10px 0 6px; padding-left: 20px; line-height: 1.5; }
.rw-qr-state { font-size: 13px; font-weight: 600; color: #5b614c; margin: 6px 0; }
.rw-link { border: 0; background: none; color: #82542b; text-decoration: underline; cursor: pointer; font-size: 13px; }
@media (max-width: 900px) { .rw-qr-btn, .rw-qr { display: none !important; } } /* en el móvil ya se suben directamente */
.rw-uploads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.rw-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: #f2ece3 center/cover no-repeat; cursor: pointer; padding: 0; }
.rw-thumb:hover { border-color: #d56532; }
.rw-thumb.is-loading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='18' fill='none' stroke='%23d56532' stroke-width='5' stroke-dasharray='80 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center/40% no-repeat; }
.rw-thumb.is-error { border-color: #ba1a1a; }
.rw-thumb .rw-badge { position: absolute; left: 4px; bottom: 4px; font-size: 10px; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; }
.rw-tip { font-size: 12.5px; color: #7a7368; line-height: 1.5; margin: 12px 0 0; }

.rw-btn { border: 1px solid #d9c9b3; background: #fff; color: #3b3a35; border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: 14px; cursor: pointer; }
.rw-btn:hover { border-color: #82542b; }
.rw-btn:disabled { opacity: .55; cursor: wait; }
.rw-btn-wide { width: 100%; }
.rw-btn-primary { background: #d56532; border-color: #d56532; color: #fff; }
.rw-btn-primary:hover { background: #82542b; border-color: #82542b; }

.rw-field { display: block; margin-top: 14px; font-size: 12px; font-weight: 600; color: #6f6a60; }
.rw-field > span { display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.rw-field textarea { width: 100%; box-sizing: border-box; border: 1px solid #d9c9b3; border-radius: 10px; padding: 10px; font-size: 16px; resize: vertical; }
.rw-field input[type=range] { width: 100%; accent-color: #d56532; }
.rw-inline { display: flex; align-items: center; gap: 10px; }
.rw-inline > span { margin: 0; }
.rw-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rw-font { border: 1px solid #e4dccf; background: #fff; border-radius: 8px; padding: 8px 6px; font-size: 18px; cursor: pointer; line-height: 1.1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rw-font small { display: block; font: 600 10px/1.2 system-ui, sans-serif; color: #8a8378; margin-top: 2px; }
.rw-font.is-active { border-color: #d56532; background: #fff3e8; }
.rw-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.rw-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #d9c9b3; cursor: pointer; padding: 0; }
.rw-swatches-lg .rw-swatch { width: 40px; height: 40px; }
.rw-swatch.is-active { box-shadow: 0 0 0 2px #d56532; }
.rw-row { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.rw-text-props.is-disabled { opacity: .45; pointer-events: none; }

.rw-templates { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.rw-tpl { border: 1px solid #e4dccf; border-radius: 12px; background: #fff; padding: 8px; cursor: pointer; text-align: left; }
.rw-tpl:hover { border-color: #d56532; }
.rw-tpl .canvas-container { width: 100% !important; height: auto !important; }
.rw-tpl canvas { width: 100% !important; height: auto !important; position: static !important; display: block; border-radius: 6px; background: #fff; }
.rw-tpl span { display: block; font-size: 13px; font-weight: 600; margin-top: 6px; color: #3b3a35; }

.rw-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; background: #fff; border: 1px solid #ece4d8; border-radius: 12px; }
.rw-icon { min-width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 17px; cursor: pointer; color: #3b3a35; }
.rw-icon:hover:not(:disabled) { background: #f2ece3; }
.rw-icon:disabled { opacity: .3; cursor: default; }
.rw-icon.is-active { background: #fff3e8; color: #d56532; }
.rw-danger:hover:not(:disabled) { background: #fde7e5; }
.rw-sep { width: 1px; height: 22px; background: #e4dccf; margin: 0 4px; }

.rw-stage-box { background: #fff; border: 1px solid #ece4d8; border-radius: 14px; padding: 10px 12px 8px; }
.rw-labels { display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #9a9286; margin-bottom: 6px; }
.rw-stage { margin: 0 auto; box-shadow: 0 2px 10px rgba(0,0,0,.08); border-radius: 4px; overflow: hidden; touch-action: none; }
.rw-stage.is-over { outline: 3px dashed #d56532; outline-offset: 3px; }
.rw-hint { font-size: 12px; color: #8a8378; margin: 8px 0 0; text-align: center; }
.rw-warn { padding: 10px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.4; }
.rw-warn[hidden] { display: none; }
.rw-warn.is-yellow { background: #fff6d6; color: #6b5200; border: 1px solid #f0d77a; }
.rw-warn.is-red { background: #fde7e5; color: #8c1d18; border: 1px solid #f2b8b5; }

.rw-views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rw-views.is-flat { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; width: 100%; }
.rw-tab[hidden] { display: none; }
.rw-views.is-flat.is-portrait { max-width: 300px; }
.rw-views figure { margin: 0; background: linear-gradient(#fff, #f6f0e6); border: 1px solid #ece4d8; border-radius: 14px; padding: 6px; text-align: center; }
.rw-view { width: 100%; height: auto; display: block; }
.rw-views figcaption { font-size: 12px; color: #7a7368; margin-top: 2px; }

.rw-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid #ece4d8; background: #fff; }
.rw-status { margin: 0 auto 0 0; font-size: 13.5px; color: #5b614c; }
.rw-status.is-error { color: #ba1a1a; }
.rw-design-id { font-size: 11px; color: #a39b8f; }

@media (max-width: 900px) {
	.rw-modal { padding: 0; }
	.rw-shell { max-height: 100vh; height: 100%; border-radius: 0; }
	.rw-body { grid-template-columns: 1fr; overflow-y: auto; display: flex; flex-direction: column; }
	.rw-main { order: 1; overflow: visible; padding: 10px; }
	.rw-side { order: 2; border-right: 0; border-top: 1px solid #ece4d8; overflow: visible; }
	.rw-uploads { grid-template-columns: repeat(4, 1fr); }
	.rw-templates { grid-template-columns: 1fr 1fr; }
	.rw-head-sub, .rw-design-id { display: none; }
	.rw-foot { flex-wrap: wrap; padding: 10px; }
	.rw-foot .rw-status { flex-basis: 100%; }
	.rw-foot .rw-btn { flex: 1; padding: 12px 10px; }
	.rw-views { gap: 6px; }
}
