/*
 * Shopo documents — customer portal (My Account → Invoices & warranties,
 * claim pages, guest documents page, thank-you page box).
 * Inherits the theme's font; --sd-accent comes from Documents settings.
 */

.sd { --sd-ink: #101418; --sd-soft: #5b6472; --sd-rule: #e2e6ec; --sd-bg: #f6f7f9; color: var(--sd-ink); }
.sd *, .sd *::before, .sd *::after { box-sizing: border-box; }
.sd p { margin: 0 0 10px; }
.sd h2, .sd h3 { margin: 0; line-height: 1.3; letter-spacing: -0.01em; }
.sd-muted { color: var(--sd-soft); font-size: 0.875em; }
.sd-title { font-size: 1.375rem; margin-bottom: 4px !important; }

/* Buttons and links */
.sd-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
	border: 1px solid var(--sd-accent); border-radius: 8px; background: var(--sd-accent); color: #fff !important;
	font: inherit; font-size: 0.9rem; font-weight: 600; line-height: 1; text-decoration: none !important; cursor: pointer;
	transition: filter 150ms ease, border-color 150ms ease, transform 100ms ease;
}
.sd-btn:hover { filter: brightness(0.92); }
.sd-btn:active { transform: scale(0.98); }
.sd-btn--line { background: #fff; color: var(--sd-ink) !important; border-color: #cfd5dd; }
.sd-btn--line:hover { border-color: var(--sd-ink); filter: none; }
.sd-link { color: var(--sd-accent); font-weight: 600; font-size: 0.875rem; text-decoration: none; padding: 8px 2px; }
.sd-link:hover { text-decoration: underline; }
.sd a:focus-visible, .sd button:focus-visible, .sd input:focus-visible, .sd textarea:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }

/* Status chips */
.sd-chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.sd-chip--good { background: #e5f4ec; color: #0f6b4a; }
.sd-chip--warn { background: #fff1d6; color: #7a4d00; }
.sd-chip--danger { background: #fde8e6; color: #a3261a; }
.sd-chip--muted { background: #eef0f3; color: #46505c; }
.sd-chip--info { background: var(--sd-wash); color: var(--sd-accent); }

/* Notices */
.sd-alert { margin: 0 0 16px; padding: 12px 14px; border: 1px solid; border-left-width: 3px; border-radius: 6px; font-size: 0.9rem; }
.sd-alert--good { background: #f0faf5; border-color: #9fd6bb; color: #0f5b3f; }
.sd-alert--warn { background: #fff8e6; border-color: #e3c98a; color: #5c3d00; }
.sd-alert--danger { background: #fdf0ee; border-color: #efb4ad; color: #7a1a10; }

/* Summary strip: one bordered row, not cards */
.sd-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--sd-rule); border-radius: 10px; margin-bottom: 28px; }
.sd-summary > div { padding: 14px 16px; border-left: 1px solid var(--sd-rule); }
.sd-summary > div:first-child { border-left: 0; }
.sd-summary b { display: block; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sd-summary span { font-size: 0.8125rem; color: var(--sd-soft); }

/* Sections */
.sd-section { margin-bottom: 32px; }
.sd-section > h2, .sd-section > h3, .sd-section__head h2 { font-size: 1.0625rem; margin-bottom: 12px; }
.sd-section__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sd-section__head h2 { margin: 0; }
.sd-filter { display: inline-flex; padding: 3px; border: 1px solid var(--sd-rule); border-radius: 8px; background: var(--sd-bg); }
.sd-filter a { padding: 6px 12px; border-radius: 6px; color: var(--sd-soft); font-size: 0.8125rem; font-weight: 600; text-decoration: none; }
.sd-filter a[aria-current] { background: #fff; color: var(--sd-ink); box-shadow: 0 1px 2px rgba(16, 20, 24, 0.08); }

/* Claims list */
.sd-claims { list-style: none; margin: 0; padding: 0; border: 1px solid var(--sd-rule); border-radius: 10px; }
.sd-claims li + li { border-top: 1px solid var(--sd-rule); }
.sd-claims a { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 12px 16px; color: inherit; text-decoration: none; }
.sd-claims a:hover { background: var(--sd-bg); }

/* Orders */
.sd-order { border: 1px solid var(--sd-rule); border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.sd-order__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--sd-bg); border-bottom: 1px solid var(--sd-rule); }
.sd-order__head h3 { font-size: 1rem; }
.sd-order__head p { margin: 2px 0 0; }
.sd-order__docs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sd-credit { margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--sd-rule); font-size: 0.875rem; }
.sd-lines { list-style: none; margin: 0; padding: 0; }
.sd-line { padding: 14px 16px; }
.sd-line + .sd-line { border-top: 1px solid var(--sd-rule); }
.sd-line__name strong { font-weight: 600; }
.sd-line__name p { margin: 4px 0 0; }
.sd-line--plain { font-size: 0.875rem; background: #fcfcfd; }
.sd-unit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 10px; }
.sd-unit__info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.sd-unit__dates { font-size: 0.875rem; color: var(--sd-soft); }
.sd-unit__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.sd-empty { padding: 28px 20px; border: 1px dashed #cfd5dd; border-radius: 10px; text-align: center; }
.sd-pages { display: flex; justify-content: space-between; gap: 10px; }

/* Claim pages */
.sd-back { margin-bottom: 14px !important; }
.sd-back a { color: var(--sd-soft); text-decoration: none; font-size: 0.9rem; }
.sd-back a:hover { color: var(--sd-ink); }
.sd-claim-product { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin: 12px 0 18px; border: 1px solid var(--sd-rule); border-radius: 8px; background: var(--sd-bg); }
.sd-claim-head { display: flex; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sd-claim-head > div { min-width: 0; flex: 1; }
.sd-claim-head > .sd-chip { flex: none; margin-top: 4px; }
.sd-status-help { margin: 10px 0 18px !important; color: var(--sd-soft); }
.sd-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; list-style: none; margin: 0 0 28px; padding: 0; counter-reset: step; }
.sd-steps li { counter-increment: step; padding-top: 10px; border-top: 3px solid var(--sd-rule); font-size: 0.8125rem; color: var(--sd-soft); }
.sd-steps li.is-done { border-color: var(--sd-accent); }
.sd-steps li.is-now { border-color: var(--sd-accent); color: var(--sd-ink); font-weight: 700; }
.sd-timeline { list-style: none; margin: 0; padding: 0; }
.sd-event { position: relative; padding: 0 0 18px 20px; border-left: 2px solid var(--sd-rule); margin-left: 4px; }
.sd-event::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--sd-accent); }
.sd-event--customer::before { background: #fff; border: 2px solid var(--sd-soft); }
.sd-event__meta { font-size: 0.8125rem; color: var(--sd-soft); margin-bottom: 4px; }
.sd-event__meta strong { color: var(--sd-ink); }
.sd-event__body { white-space: normal; overflow-wrap: anywhere; }
.sd-files { list-style: none; margin: 8px 0 0; padding: 0; font-size: 0.875rem; }
.sd-files li { margin-bottom: 4px; }

/* Forms */
.sd-form { max-width: 620px; }
.sd-field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9375rem; }
.sd-field input:not([type="file"]), .sd-field textarea {
	width: 100%; padding: 10px 12px; border: 1px solid #cfd5dd; border-radius: 8px; background: #fff; font: inherit; font-size: 16px; color: var(--sd-ink);
}
.sd-field textarea { resize: vertical; min-height: 120px; }
.sd-field input[type="file"] { font: inherit; font-size: 0.9rem; max-width: 100%; }
.sd-help { display: block; margin-top: 6px; font-size: 0.8125rem; color: var(--sd-soft); }
.sd-field { margin-bottom: 16px !important; }
.sd-file-error { display: block; margin-top: 6px; font-size: 0.8125rem; color: #a3261a; }

/* Order page / thank-you box */
.sd-orderbox { margin: 24px 0; padding: 16px 18px; border: 1px solid var(--sd-rule); border-left: 3px solid var(--sd-accent); border-radius: 8px; }
.sd-orderbox h2 { font-size: 1.0625rem; margin-bottom: 8px; }
.sd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-lookup { max-width: 560px; }

@media (max-width: 640px) {
	.sd-summary { grid-template-columns: 1fr 1fr; }
	.sd-summary > div:nth-child(3) { border-left: 0; }
	.sd-summary > div:nth-child(n+3) { border-top: 1px solid var(--sd-rule); }
	.sd-claims a { grid-template-columns: 1fr auto; }
	.sd-claims a .sd-muted { grid-column: 1 / -1; }
	.sd-order__docs { width: 100%; }
	.sd-unit__actions { width: 100%; }
	.sd-steps { grid-template-columns: 1fr; gap: 0; }
	.sd-steps li { padding: 6px 0 6px 12px; border-top: 0; border-left: 3px solid var(--sd-rule); }
	.sd-steps li.is-done, .sd-steps li.is-now { border-left-color: var(--sd-accent); }
}

@media (prefers-reduced-motion: reduce) { .sd-btn { transition: none; } }

/* Keep the theme's body-link styling (colour, underline) out of list rows and tabs. */
.sd .sd-claims a, .sd .sd-claims a *, .sd .sd-filter a { color: inherit; text-decoration: none !important; }
.sd .sd-claims a strong { color: var(--sd-ink); }
.sd .sd-filter a { color: var(--sd-soft); }
.sd .sd-filter a[aria-current] { color: var(--sd-ink); }
.sd .sd-btn, .sd .sd-btn * { text-decoration: none !important; }
