/* Editor público — Herramienta de edición (Fase 5) */

.et-pub {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

.et-pub__back {
    margin: 0 0 12px;
    font-size: 0.9rem;
}
.et-pub__back a {
    color: #15803d;
    text-decoration: none;
}
.et-thumb-cell {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.et-thumb-cell img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.et-pub__header {
    margin-bottom: 16px;
}

.et-pub__title {
    margin: 0 0 6px;
    font-size: 1.5rem;
}

.et-pub__price {
    margin: 0 0 6px;
    font-weight: 600;
}

.et-pub__hint {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}

.et-pub__sidebar-toggle {
    display: none;
    margin-bottom: 10px;
}

.et-pub__layout {
    display: grid;
    grid-template-columns: 140px 1fr 180px;
    gap: 16px;
    align-items: start;
}

.et-pub__sidebar {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.et-pub__sidebar-title,
.et-pub__section-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.et-pub__base-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.et-pub__base-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: inherit;
}

.et-pub__base-btn.is-active {
    border-color: #4caf1b;
    background: #f0fdf4;
}

.et-pub__base-btn .et-thumb-cell {
    width: 100%;
    max-width: 110px;
    height: 72px;
}

.et-pub__view-tabs-wrap {
    margin-bottom: 8px;
    overflow-x: auto;
}

.et-pub__view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.et-pub__view-tab {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    font-size: 0.85rem;
    cursor: pointer;
}

.et-pub__view-tab.is-active {
    background: #4caf1b;
    border-color: #4caf1b;
    color: #fff;
}

.et-pub__canvas-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f1f5f9;
    overflow: hidden;
}

.et-pub__canvas-host {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: min(70vh, 560px);
    margin: 0 auto;
}

#et-pub-konva-container {
    width: 100%;
    height: 100%;
}

.et-pub__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    min-height: 4.5rem;
}

.et-pub__tool-sliders {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    flex: 1 1 220px;
    min-width: 200px;
    max-width: 100%;
}

.et-pub__slider-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #334155;
}

.et-pub__slider-label input[type='range'] {
    flex: 1 1 140px;
    min-width: 120px;
    width: 100%;
    max-width: 100%;
}

.et-pub__dialog {
    max-width: min(92vw, 26rem);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0;
}

.et-pub__dialog-inner {
    padding: 1.25rem 1.35rem;
}

.et-pub__dialog-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.et-pub__dialog-msg {
    margin: 0 0 14px;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #374151;
}

.et-pub__dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.et-pub__tool-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.et-pub__tool-meta {
    font-size: 0.8rem;
    color: #64748b;
}

.et-pub__accessories {
    margin-top: 14px;
}

.et-pub__acc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
}

.et-pub__acc-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #fff;
    border-color: #e2e8f0;
    cursor: pointer;
    font-size: 0.72rem;
    font-family: inherit;
}

.et-pub__acc-btn.is-picked {
    border-color: #4caf1b;
    background: #f0fdf4;
}

.et-pub__acc-btn .et-thumb-cell {
    width: 64px;
    height: 64px;
}

.et-pub__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.et-pub__quote-btn {
    opacity: 0.6;
}

.et-pub__quote-btn:not(:disabled) {
    opacity: 1;
}

.et-pub__quote-hint {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: #64748b;
    min-height: 1.2em;
}

.et-pub__quote-hint--warn {
    color: #92400e;
}

.et-pub__quote-dialog {
    max-width: min(96vw, 42rem);
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 0;
}

.et-pub__quote-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.et-pub__quote-dialog-inner {
    padding: 1rem 1.15rem 1.25rem;
    max-height: min(88vh, 720px);
    display: flex;
    flex-direction: column;
}

.et-pub__quote-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.et-pub__quote-dialog-body {
    overflow: auto;
    flex: 1 1 auto;
    min-height: 120px;
}

.et-pub-quote-embed__title {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.et-pub-quote-embed__hint {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: #64748b;
}

.et-pub-quote-embed__actions {
    margin-top: 14px;
}

.et-pub__status {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #64748b;
    min-height: 1.2em;
}

.et-pub__status.is-error {
    color: #b91c1c;
}

.et-pub__previews {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.et-pub__preview-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.et-pub__preview-item {
    display: block;
    border-radius: 6px;
}
.et-pub__preview-btn {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.et-pub__preview-item--active .et-pub__preview-btn {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}
.et-pub__preview-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.et-pub__preview-btn .et-thumb-cell {
    width: 100%;
    height: 120px;
    pointer-events: none;
}
.et-pub__refs-total {
    margin: 10px 0 0;
    font-weight: 600;
    font-size: 0.9rem;
}
.et-pub__refs-total[hidden] {
    display: none !important;
}

@media (max-width: 1024px) {
    .et-pub__layout {
        grid-template-columns: 1fr;
    }

    .et-pub__previews {
        order: -1;
    }

    .et-pub__preview-list {
        flex-direction: row;
        overflow-x: auto;
    }

    .et-pub__preview-item {
        flex: 0 0 120px;
    }

    .et-pub__sidebar-toggle {
        display: inline-block;
    }

    .et-pub__sidebar.et-pub__sidebar--collapsed {
        display: none;
    }
}

@media (max-width: 768px) {
    .et-pub__sidebar-toggle {
        display: inline-block;
    }

    .et-pub__sidebar.et-pub__sidebar--collapsed {
        display: none;
    }
}

/* Productos referenciados visibles al cliente (Fase 8) */
.et-pub__refs {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.et-pub__refs-title {
    margin: 0 0 6px;
    font-size: 1rem;
}

.et-pub__refs-disclaimer {
    margin: 0 0 10px;
    font-size: 0.8rem;
    color: #64748b;
}

.et-pub__refs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.et-pub__refs-item--inactive {
    opacity: 0.55;
}

.et-pub__refs-note {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

.et-pub__refs-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
}

.et-pub__refs-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.et-pub__refs-meta strong {
    display: block;
    font-size: 0.9rem;
}

.et-pub__refs-type {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
}

.et-pub__refs-price {
    display: block;
    margin-top: 4px;
}

@media (min-width: 1025px) {
    .et-pub__refs {
        grid-column: 1 / -1;
    }
}
