/* ── Página ──────────────────────────────────────────────── */
.cdp-page { margin: 20px 0; }
.cdp-ref { font-size: 1.25rem; margin: 0 0 4px; }
.cdp-meta { color: var(--color--fg-subtle, #52525b); margin: 0 0 16px; }
.cdp-empty { padding: 24px; text-align: center; color: var(--color--fg-subtle, #52525b); }

.cdp-alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-weight: 600; }
.cdp-alert--success { background: #e8f6ec; color: var(--color--link, #2f793f); }
.cdp-alert--error { background: #fdecea; color: #a3201a; }

/* ── Filtros ─────────────────────────────────────────────── */
.cdp-filters { margin-bottom: 24px; }
.cdp-filters-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.cdp-field { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: .875rem; color: var(--color--fg-subtle, #52525b); }
.cdp-field--grow { flex: 1 1 260px; }
.cdp-field input, .cdp-field select { height: 40px; padding: 0 10px; border: 1px solid var(--color--border-base, #e4e4e7); border-radius: 6px; font-size: 1rem; background-color: #fff; color: var(--color--fg-base, #18181b); }
/* Chevron propio con aire a la derecha (mismo que el selector de oferta del carrito):
   el nativo queda pegado al borde y desalineado. */
.cdp-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23464a4c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}
.cdp-field input:focus-visible, .cdp-field select:focus-visible { outline: 2px solid var(--color--brand-blue, #2a64c8); outline-offset: 1px; }
.cdp-search-btn { padding-left: 20px; padding-right: 20px; }

/* ── Tabla ───────────────────────────────────────────────── */
.cdp-table-wrap { overflow-x: auto; }
.cdp-table { width: 100%; border-collapse: collapse; }
.cdp-table th, .cdp-table td { padding: 12px 10px; border-bottom: 1px solid var(--color--border-base, #e4e4e7); text-align: left; vertical-align: middle; }
.cdp-table thead th { font-size: .8125rem; color: var(--color--fg-subtle, #52525b); text-transform: uppercase; letter-spacing: .02em; }
.cdp-table .cdp-num { text-align: right; white-space: nowrap; }
.cdp-table .cdp-center { text-align: center; }
.cdp-table a { color: inherit; }
.cdp-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.cdp-actions-col { text-align: right !important; }
.cdp-delete-form { margin: 0; display: inline-flex; }
.cdp-action { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--color--fg-base, #18181b); cursor: pointer; text-decoration: none; }
.cdp-action:hover, .cdp-action:focus-visible { background: var(--color--bg-subtle, #f8f7f4); }
.cdp-action:focus-visible { outline: 2px solid var(--color--brand-blue, #2a64c8); outline-offset: 1px; }
.cdp-action--danger:hover, .cdp-action--danger:focus-visible { color: #c0291f; }

/* ── Ficha ───────────────────────────────────────────────── */
.cdp-table--ficha .cdp-img { width: 72px; }
.cdp-table--ficha img { display: block; max-width: 60px; height: auto; }
.cdp-name { display: block; font-weight: 600; color: var(--color--link, #2f793f); }
.cdp-unit { display: block; color: var(--color--fg-muted, #a1a1aa); font-size: .875rem; }
.cdp-dto { display: block; color: var(--color--link, #2f793f); font-weight: 700; font-size: .875rem; }
.cdp-table--ficha del { display: block; color: var(--color--fg-muted, #a1a1aa); }
.cdp-table--ficha tfoot th { font-weight: 600; }
.cdp-total th, .cdp-total td { font-size: 1.125rem; font-weight: 700; }
.cdp-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* ── Botón en el carrito ─────────────────────────────────── */
.cdp-save-form { display: inline-block; margin: 8px 0; }
.cdp-save-form--inline { margin: 0 0 0 8px; vertical-align: middle; }
.cdp-save-form .btn { display: inline-flex; }

/* ── Móvil ───────────────────────────────────────────────── */
@media (max-width: 767px) {
  .cdp-table thead { display: none; }
  .cdp-table, .cdp-table tbody, .cdp-table tr, .cdp-table td { display: block; width: 100%; }
  .cdp-table tr { border: 1px solid var(--color--border-base, #e4e4e7); border-radius: 8px; margin-bottom: 12px; padding: 4px 0; }
  .cdp-table:not(.cdp-table--ficha) td { border: 0; display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; text-align: right !important; }
  .cdp-table:not(.cdp-table--ficha) td[data-label]::before { content: attr(data-label); color: var(--color--fg-subtle, #52525b); text-align: left; }
  .cdp-actions { justify-content: flex-start; }
  .cdp-table--ficha thead { display: none; }
  .cdp-table--ficha tr { display: table-row; border: 0; }
  .cdp-table--ficha, .cdp-table--ficha tbody, .cdp-table--ficha tfoot { display: table; }
  .cdp-table--ficha td, .cdp-table--ficha th { display: table-cell; width: auto; }
}

.cdp-action i { font-size: 1.125rem; line-height: 1; }
