/* Extensiones de la paleta celeste & azul de Al Paso para los rubros comerciales */
.comercio-theme .inicio-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.comercio-theme .inicio-metrics > a.metric-link,
.comercio-theme .inicio-metrics > div {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 13px;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 2px 10px #0f172a08;
    transition: border-color .15s, transform .15s;
}
.comercio-theme .inicio-metrics > a.metric-link:hover {
    border-color: #93b4f5;
    transform: translateY(-1px);
}
.comercio-theme .inicio-metrics small { display: block; font-size: 12px; color: var(--muted); }
.comercio-theme .inicio-metrics strong { font-size: 20px; letter-spacing: -.03em; color: #0f172a; }

.inicio-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.inicio-vender-btn {
    flex: 1 1 280px;
    min-height: 48px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}
.inicio-vender-btn svg,
.inicio-cta .button svg { width: 18px; height: 18px; }

.dollar-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s;
}
.dollar-pill:hover { background: #dbeafe; border-color: #93c5fd; }
.dollar-pill svg { width: 16px; height: 16px; }

.charge-btn {
    background: #eef4ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    font-weight: 700;
}

.compact-grid { gap: 8px; margin-bottom: 6px; }

.pres-picker {
    border-top: 1px solid var(--line);
    padding-top: 10px;
    margin-top: 4px;
}
.pres-heading {
    display: block;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .06em;
    color: var(--muted);
    margin-bottom: 8px;
}
.pres-list {
    display: grid;
    gap: 7px;
}
.pres-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid #cfe0ff;
    background: #f5f9ff;
    color: var(--ink);
    text-align: left;
    transition: background-color .14s, border-color .14s;
}
.pres-btn:hover { background: #e8eeff; border-color: #2563eb; }
.pres-btn strong { display: block; font-size: 13.5px; color: #0f172a; }
.pres-btn small { display: block; font-size: 11.5px; color: var(--muted); }
.pres-btn b { color: #1d4ed8; font-size: 15px; white-space: nowrap; }

.feature-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin: 10px 0 14px;
}
.toggle-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #f8fbff;
    cursor: pointer;
}
.toggle-card:hover { border-color: #93c5fd; background: #eff6ff; }
.toggle-card input { width: auto !important; margin-top: 3px; flex-shrink: 0; }
.toggle-card strong { display: block; font-size: 13.5px; color: #0f172a; }
.toggle-card small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }

.product .srv-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
}
.product .pres-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
}
.product .promo-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
}

.help-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #dbe4f0;
    background: #f8faff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.help-pill:hover { background: #e8eeff; border-color: #bfd3ff; color: #1d4ed8; }
.help-pill svg { width: 15px; height: 15px; }

.cat-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
}
.help-card h3 { margin: 8px 0 6px; font-size: 16px; color: #0f172a; }
.help-card p { margin: 0; font-size: 13.5px; line-height: 1.5; }

.comercio-theme textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    resize: vertical;
}
.comercio-theme textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px #dbeafe;
}

/* Listado mejorado de productos */
.prod-open-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 0;
    padding: 0;
    text-align: left;
    color: inherit;
    width: 100%;
    cursor: pointer;
}
.prod-open-btn:hover strong { color: #1d4ed8; }
.prod-thumb {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #dbe4f0;
}
.prod-thumb-placeholder {
    display: grid;
    place-items: center;
    background: #e8eeff;
    color: #1d4ed8;
    font-weight: 750;
    font-size: 14px;
}
.prod-cell-info { min-width: 0; }
.prod-cell-info strong { display: block; font-size: 13.5px; color: #0f172a; }
.prod-cell-info small { display: block; font-size: 11.5px; color: var(--muted); }
.prod-pres-inline { color: #1d4ed8; font-weight: 600; }
.row-inactive { opacity: .62; }
.fav-star {
    background: transparent;
    border: 0;
    font-size: 18px;
    line-height: 1;
    color: #94a3b8;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
}
.fav-star:hover { background: #eff6ff; color: #2563eb; }
.fav-star.on { color: #f59e0b; }

/* Modal de producto (6 pestañas, estilo celeste/azul Al Paso) */
dialog.product-modal {
    width: min(760px, 95vw);
    max-width: 760px;
    max-height: 90vh;
    padding: 0;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
    overflow: hidden;
    background: #ffffff;
}
dialog.product-modal::backdrop {
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(3px);
}
.pm-shell {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.pm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px 12px;
    border-bottom: 1px solid #eef2f8;
    background: #ffffff;
}
.pm-header h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; color: #0f172a; }
.pm-header small { display: block; margin-top: 2px; font-size: 12.5px; }

.pm-tabs {
    display: flex;
    gap: 4px;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
    overflow-x: auto;
}
.pm-tabs button {
    position: relative;
    background: transparent;
    border: 0;
    padding: 11px 12px;
    font-size: 13.5px;
    font-weight: 560;
    color: var(--muted);
    white-space: nowrap;
    cursor: pointer;
    transition: color .14s;
}
.pm-tabs button:hover { color: #1d4ed8; }
.pm-tabs button.active {
    color: #1d4ed8;
    font-weight: 680;
}
.pm-tabs button.active::after {
    content: '';
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 0;
    height: 2.5px;
    border-radius: 3px 3px 0 0;
    background: #2563eb;
}

.pm-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
.pm-body {
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 180px);
}
.pm-panel {
    display: grid;
    gap: 13px;
}
.pm-panel label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.pm-panel input:not([type=checkbox]):not([type=file]),
.pm-panel select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
}
.pm-panel input:focus,
.pm-panel select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px #dbeafe;
}
.pm-hint {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    font-weight: 450;
    color: #64748b;
}
.pm-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pm-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pm-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

/* Multi-barcode chips */
.pm-bc-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.pm-bc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-bc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f1f5ff;
    border: 1px solid #cfe0ff;
    color: #0f172a;
    font: 650 12.5px/1 ui-monospace, Consolas, monospace;
}
.pm-bc-chip button {
    border: 0;
    background: transparent;
    color: #64748b;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.pm-bc-chip button:hover { color: #dc2626; }
#pm-bc-input { flex: 1 1 160px; margin-top: 0 !important; }

/* Foto del producto */
.pm-photo-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fbff;
}
.pm-photo-preview {
    width: 62px;
    height: 62px;
    border-radius: 12px;
    background: #e8eeff;
    color: #1d4ed8;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}
.pm-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.pm-photo-preview svg { width: 28px; height: 28px; }
.pm-photo-actions strong { display: block; font-size: 13.5px; margin-bottom: 6px; color: #0f172a; }
.pm-upload-label { display: inline-flex !important; cursor: pointer; margin: 0; }

/* Caja de Costo / Margen / Precio */
.pm-pricing-box {
    padding: 13px 14px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fbff;
    display: grid;
    gap: 10px;
}
.pm-usd-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.pm-buy-pair {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 6px;
    margin-top: 4px;
}
.pm-buy-pair input { margin-top: 0 !important; }

/* Switch toggles */
.pm-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 4px 0;
}
.pm-switch {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.pm-switch input { display: none; }
.pm-slider {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #cbd5e1;
    flex-shrink: 0;
    transition: background-color .16s;
}
.pm-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .22);
    transition: transform .16s;
}
.pm-switch input:checked + .pm-slider { background: #2563eb; }
.pm-switch input:checked + .pm-slider::after { transform: translateX(18px); }
.pm-switch strong { display: block; font-size: 13px; color: #0f172a; line-height: 1.2; }
.pm-switch small { display: block; font-size: 11.5px; font-weight: 450; color: var(--muted); }

/* Presentaciones & Ficha técnica dinámicas */
.pm-empty-box {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 4px;
    padding: 26px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}
.pm-empty-box span {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #e8eeff;
    color: #1d4ed8;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
}
.pm-empty-box p { margin: 0; font-size: 13px; }
.pm-dynamic-list { display: grid; gap: 10px; }
.pm-pres-card {
    display: grid;
    grid-template-columns: 1.3fr .7fr .75fr 1fr 1.1fr auto;
    gap: 8px;
    align-items: end;
    padding: 12px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fbff;
}
.pm-ficha-row {
    display: grid;
    grid-template-columns: 1fr 1.3fr auto;
    gap: 8px;
    align-items: center;
}
.pm-row-del {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    width: 34px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}
.pm-row-del:hover { border-color: #fca5a5; background: #fef2f2; color: #dc2626; }

.pm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 22px;
    border-top: 1px solid #eef2f8;
    background: #ffffff;
}
.pm-trash-btn {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 16px;
    cursor: pointer;
}
.pm-trash-btn:hover { background: #fee2e2; border-color: #f87171; }

.pm-change-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid #eef2f8;
    border-radius: 9px;
    background: #f8fafc;
    margin-bottom: 7px;
    font-size: 13px;
}

/* Variantes de tamaño y componentes para modales del sistema */
dialog.product-modal.modal-narrow {
    width: min(560px, 95vw);
    max-width: 560px;
}
dialog.product-modal.modal-wide {
    width: min(940px, 96vw);
    max-width: 940px;
}
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}
.swatch-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #cbd5e1;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.swatch-btn:hover { transform: scale(1.1); }
.swatch-btn.active { box-shadow: 0 0 0 2px #1d4ed8; transform: scale(1.1); }

.promo-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.promo-type-card {
    text-align: left;
    padding: 10px 12px;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    display: grid;
    gap: 2px;
    transition: border-color .15s, background .15s;
}
.promo-type-card strong { font-size: 13.5px; color: #0f172a; }
.promo-type-card small { font-size: 12px; color: #64748b; }
.promo-type-card:hover { border-color: #93c5fd; background: #f8fbff; }
.promo-type-card.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #2563eb;
}

.pin-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pin-input-row input { flex: 1; }

.msg-preview-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
    white-space: pre-wrap;
}

@media (max-width: 720px) {
    .pm-grid-2, .pm-grid-3, .pm-grid-4, .pm-pres-card, .pm-usd-bar, .promo-type-grid { grid-template-columns: 1fr; }
}
