/* Ragna's panel: product list, product editor and store settings.
   Built on the Kit's style.css with the tokens in brand.css. */

h1 { font-stretch: 112%; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-stretch: 108%; }
button { font-stretch: 108%; }
button.primary:hover { background: #2b2b2b; border-color: #2b2b2b; }
button:hover { border-color: var(--text); }

.wordmark { margin: 0; font-stretch: 125%; font-weight: 900; font-size: 18px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--text); }
.login-card .wordmark { font-size: 22px; }
.brand .wordmark { margin-right: -0.32em; }
aside { background: var(--surface); border-right-color: var(--soft-line); }
nav button[aria-current] { color: var(--text); background: var(--accent); }

select, textarea { width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
select { min-height: 44px; }
textarea { resize: vertical; line-height: 1.5; }
select:focus-visible, textarea:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Publication bar: always reachable at the top of the content. */
.publication { position: sticky; top: 0; z-index: 5; background: var(--canvas); margin-top: -16px; padding-top: 16px; }
#version { color: var(--text); }

/* ── Product list ── */
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.search { flex: 1 1 260px; max-width: 420px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { min-height: 40px; padding: 8px 14px; font-weight: 500; }
.tabs button[aria-pressed="true"] { background: var(--text); color: var(--brand-ink); border-color: var(--text); }
.count { margin-bottom: 12px; font-size: 13px; }
.product-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.product-row { width: 100%; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 10px 16px 10px 10px; text-align: left; font-weight: 400; background: var(--surface); border-color: var(--soft-line); }
.product-row:hover { border-color: var(--text); }
.row-thumb { width: 64px; height: 85px; background: var(--soft-line); overflow: hidden; }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-info { display: grid; gap: 4px; min-width: 0; }
.row-info strong { font-weight: 600; overflow-wrap: anywhere; }
.row-meta { color: var(--muted); font-size: 13px; }
.row-price { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }
.row-price s { color: var(--muted); font-size: 13px; }
.row-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: end; min-width: 120px; }
.tag { padding: 3px 8px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.tag-sale { background: var(--text); color: var(--brand-ink); border-color: var(--text); letter-spacing: 0.06em; }
.tag-soft { border-color: var(--soft-line); color: var(--muted); font-weight: 500; }
.tag-alert { border-color: var(--error); color: var(--error); }

/* ── Product editor ── */
#editor-view { display: grid; gap: 24px; max-width: 880px; }
.back { justify-self: start; border-color: transparent; background: none; padding-left: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.back:hover { border-color: transparent; }
.group { margin: 0; padding: 24px; border: 1px solid var(--soft-line); background: var(--surface); display: grid; gap: 16px; min-width: 0; }
.group legend { padding: 0 8px; margin-left: -8px; font-weight: 700; font-stretch: 108%; font-size: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; }
.field-label { color: var(--text); font-size: 13px; font-weight: 600; margin: 0; }
.field-hint { color: var(--muted); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 15px; cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--text); flex-shrink: 0; }
.colors { display: grid; gap: 16px; }
.color-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--soft-line); background: var(--canvas); }
.color-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.swatch { width: 44px; height: 44px; padding: 2px; cursor: pointer; }
.link-button { border-color: transparent; background: none; text-decoration: underline; text-underline-offset: 4px; font-weight: 500; }
.link-button:hover { border-color: transparent; }
.photos { display: flex; flex-wrap: wrap; gap: 12px; }
.photo { position: relative; margin: 0; width: 96px; height: 128px; background: var(--soft-line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-remove { position: absolute; right: 4px; bottom: 4px; min-height: 32px; padding: 4px 8px; font-size: 12px; background: var(--surface); }
.photos .photo-choice { width: 96px; height: 128px; min-height: 0; padding: 8px; font-size: 13px; border-color: var(--line); background: var(--surface); }
.stock { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.stock input { text-align: center; }
.editor-footer { display: flex; justify-content: end; }
.danger { color: var(--error); border-color: var(--error); background: var(--surface); }
.danger:hover { border-color: var(--error); background: #fbeef0; }

/* ── Settings ── */
.settings-form { display: grid; gap: 24px; max-width: 560px; padding: 24px; border: 1px solid var(--soft-line); background: var(--surface); }

.empty { list-style: none; border-color: var(--line); background: var(--surface); }
.toast { border-radius: 0; }

@media (max-width: 700px) {
  aside { border-bottom-color: var(--soft-line); }
  .publication { margin-top: -8px; padding-top: 8px; }
  .product-row { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 4px 12px; padding: 8px 12px 8px 8px; }
  .row-thumb { width: 56px; height: 75px; grid-row: 1 / 3; }
  .row-tags { grid-column: 2 / 4; justify-content: start; min-width: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .group { padding: 16px; }
  .color-head { grid-template-columns: 44px minmax(0, 1fr); }
  .color-head .link-button { grid-column: 1 / -1; justify-self: start; padding-left: 0; }
  .filters { align-items: stretch; }
  .search { max-width: none; }
  .settings-form { padding: 16px; }
}

/* ── Orders ── */
.nav-count { margin-left: 8px; padding: 1px 7px; background: var(--text); color: var(--brand-ink); font-size: 12px; font-weight: 700; }
nav button { display: flex; align-items: center; justify-content: space-between; }
.order-tabs { margin-bottom: 16px; }
.order-list { display: grid; gap: 16px; }
.envia-balance { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.envia-balance.is-low { padding: 12px 16px; border: 1px solid var(--error); background: var(--surface); color: var(--text); font-size: 15px; }
.envia-balance a { color: inherit; }
.order { display: grid; gap: 16px; padding: 24px; border: 1px solid var(--soft-line); background: var(--surface); }
.order-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.order-head h2 { font-size: 18px; letter-spacing: 0.04em; }
.order-head .tag { margin-left: auto; }
.status-pending { border-color: var(--text); background: var(--accent); }
.status-paid { border-color: var(--success); color: var(--success); }
.status-shipped, .status-delivered { border-color: var(--soft-line); color: var(--muted); }
.status-cancelled { border-color: var(--error); color: var(--error); }
.order-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.order-block { display: grid; gap: 2px; align-content: start; }
.order-block p { color: var(--text); }
.order-block a { color: var(--text); text-underline-offset: 3px; overflow-wrap: anywhere; }
.order-strong { font-weight: 600; color: var(--text); }
.order-items { list-style: none; margin: 0; padding: 12px 0; border-block: 1px solid var(--soft-line); display: grid; gap: 8px; }
.order-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 16px; }
.order-items .row-meta { grid-column: 1; }
.order-amount { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; }
.order-totals { margin: 0; display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.order-totals div { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.order-totals dd { margin: 0; color: var(--text); }
.order-totals .order-total { color: var(--text); font-weight: 700; font-size: 17px; padding-top: 4px; }

@media (max-width: 700px) {
  .order { padding: 16px; }
  .order-details { grid-template-columns: 1fr; }
  .order .actions button { flex: 1; }
  .order-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .order-tabs button { flex-shrink: 0; }
}

/* ── Correo Argentino ── */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.order-shipment { display: grid; gap: 8px; padding: 16px; background: var(--canvas); border: 1px solid var(--soft-line); }
.order-shipment p { color: var(--text); }
.order-shipment a { color: var(--text); text-underline-offset: 3px; }
.order-shipment > button { justify-self: start; }
.tracking { display: grid; grid-template-columns: minmax(0, 320px) auto; gap: 12px; align-items: end; }
@media (max-width: 700px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tracking { grid-template-columns: 1fr; }
  .order-shipment > button, .tracking button { width: 100%; }
}
.grid-2, .grid-3 { align-items: start; }

/* ── Novedades ── */
.post-products { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.post-products li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 4px 12px; border-left: 2px solid var(--soft-line); }
.post-picker { display: grid; grid-template-columns: minmax(0, 360px) auto; gap: 12px; align-items: end; }
@media (max-width: 700px) {
  .post-picker { grid-template-columns: 1fr; }
}
.order-shipment .link-button { justify-self: start; padding-left: 0; }
.movements { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--text); }

/* ── Resumen ── */
.month-pick { min-width: 220px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { display: grid; gap: 6px; align-content: start; padding: 20px 24px; border: 1px solid var(--soft-line); background: var(--surface); }
.stat-value { color: var(--text); font-size: 28px; font-weight: 700; font-stretch: 112%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metrics > .empty { margin-bottom: 24px; }
.metric-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.metric-block h2 { font-size: 16px; font-stretch: 108%; }
.metric-block > button { justify-self: start; }
.metric-text { color: var(--text); }
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .metric-blocks { grid-template-columns: 1fr; }
  .stats { gap: 8px; }
  .stat { padding: 16px; }
  .stat-value { font-size: 22px; }
  #metrics > header { flex-direction: column; align-items: stretch; }
  .month-pick { min-width: 0; width: 100%; }
}

/* ── Cupones y reseñas ── */
.list-title { margin-top: 16px; font-size: 16px; }
.coupon .order-head h2 { overflow-wrap: anywhere; }
#coupon-form:not(:empty) { margin-bottom: 24px; max-width: 880px; }
.review-stars { color: var(--gold); font-size: 20px; letter-spacing: 0.08em; line-height: 1; }
.review-text { color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }

/* ── Pedidos: exportar y lista para armar ── */
#orders > header { flex-wrap: wrap; }
.export-box { max-width: 560px; margin-bottom: 24px; }
.export-box h2 { font-size: 16px; }
.packing { display: grid; gap: 16px; }
.packing-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.packing-head > div { display: grid; gap: 4px; }
.pack-order { display: grid; gap: 8px; padding: 16px 24px; border: 1px solid var(--soft-line); background: var(--surface); break-inside: avoid; }
.pack-order h3 { font-size: 18px; letter-spacing: 0.04em; }
.pack-items { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--soft-line); display: grid; gap: 8px; }
.pack-items li { display: grid; grid-template-columns: 18px auto minmax(0, 1fr); gap: 0 10px; align-items: center; color: var(--text); }
.pack-box { width: 18px; height: 18px; border: 1.5px solid var(--text); }
.pack-qty { font-variant-numeric: tabular-nums; font-weight: 700; }
.pack-variant { grid-column: 2 / -1; color: var(--muted); font-size: 13px; }

@media (max-width: 700px) {
  #orders > header .actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  #orders > header #packing-open { grid-column: 1 / -1; }
  .pack-order { padding: 16px; }
  .packing-head .primary { width: 100%; }
}

/* Printing the packing list: only the list, in black on white. */
@media print {
  aside, #publication, #license, .toast, .progress, .no-print, #orders > header, #envia-balance, #export-box { display: none !important; }
  body { background: #fff; }
  .layout { display: block; }
  .content { padding: 0; max-width: none; }
  .pack-order { border-color: #000; padding: 10px 14px; }
  .pack-variant, .pack-order .row-meta { color: #000; }
}

/* Section headers: the main action keeps its size next to a long description. */
.content header > button, .content header > .actions { flex-shrink: 0; }
.content header > button { white-space: nowrap; }
