forked from Creditra/Creditra-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAprBreakdown.css
More file actions
255 lines (213 loc) · 6.94 KB
/
Copy pathAprBreakdown.css
File metadata and controls
255 lines (213 loc) · 6.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
/* AprBreakdown.css
*
* Design-token-first — all colours via CSS custom properties from src/index.css.
* No one-off hex values.
*
* Layout:
* ≥601 px — anchored popover above/below the trigger
* ≤600 px — full-width bottom-sheet with slide-up animation
*
* prefers-reduced-motion: all transitions/animations removed.
*/
/* ── Wrapper ───────────────────────────────────────────────────────────────── */
.apr-breakdown-wrapper {
position: relative;
display: inline-flex;
align-items: center;
}
/* ── Trigger button ────────────────────────────────────────────────────────── */
.apr-breakdown-trigger {
display: inline-flex;
align-items: center;
gap: 0.3rem;
/* 44×44 px minimum touch target */
min-height: 44px;
padding: 0.25rem 0.5rem;
border: none;
background: transparent;
color: var(--text);
font-size: inherit;
font-weight: 600;
cursor: pointer;
border-radius: 4px;
text-decoration: underline dotted var(--muted);
text-underline-offset: 3px;
}
.apr-breakdown-trigger:hover {
color: var(--accent);
text-decoration-color: var(--accent);
}
.apr-breakdown-trigger:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
text-decoration: none;
}
/* ── Chevron ───────────────────────────────────────────────────────────────── */
.apr-breakdown-chevron {
flex-shrink: 0;
transition: transform 150ms ease;
}
.apr-breakdown-chevron.open {
transform: rotate(180deg);
}
/* ── Mobile backdrop ───────────────────────────────────────────────────────── */
.apr-breakdown-backdrop {
position: fixed;
inset: 0;
z-index: 49;
background: rgba(7, 10, 14, 0.7);
backdrop-filter: blur(2px);
}
/* ── Panel base ────────────────────────────────────────────────────────────── */
.apr-breakdown-panel {
position: absolute;
/* Open above the trigger by default; flip with JS if needed (CSS-only: opens above) */
bottom: calc(100% + 8px);
left: 0;
z-index: 50;
width: min(340px, calc(100vw - 2rem));
border: 1px solid var(--border);
border-radius: 0.75rem;
background: var(--surface);
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
padding: 1rem;
animation: aprPopoverEnter 140ms ease-out;
}
@keyframes aprPopoverEnter {
from { opacity: 0; transform: translateY(6px); }
to { opacity: 1; transform: translateY(0); }
}
/* ── Bottom-sheet (mobile) ─────────────────────────────────────────────────── */
.apr-breakdown-panel.bottom-sheet {
position: fixed;
bottom: 0;
left: 0;
right: 0;
width: 100%;
border-radius: 1rem 1rem 0 0;
border-bottom: none;
z-index: 50;
animation: aprSheetEnter 200ms ease-out;
}
@keyframes aprSheetEnter {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
/* ── Panel header ──────────────────────────────────────────────────────────── */
.apr-breakdown-panel-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.875rem;
}
.apr-breakdown-panel-header h3 {
font-size: 0.9rem;
font-weight: 700;
color: var(--text);
margin: 0;
}
.apr-breakdown-close {
min-width: 32px;
min-height: 32px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid var(--border);
border-radius: 999px;
background: transparent;
color: var(--muted);
font-size: 1.2rem;
cursor: pointer;
line-height: 1;
}
.apr-breakdown-close:hover {
color: var(--text);
border-color: var(--accent);
}
.apr-breakdown-close:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* ── Table ─────────────────────────────────────────────────────────────────── */
.apr-breakdown-table {
width: 100%;
border-collapse: collapse;
font-size: 0.82rem;
}
.apr-breakdown-table thead th {
padding: 0 0 0.5rem;
text-align: left;
font-size: 0.72rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--muted);
border-bottom: 1px solid var(--border);
}
.apr-breakdown-num {
text-align: right;
}
.apr-breakdown-table tbody tr + tr td {
padding-top: 0.625rem;
}
.apr-breakdown-table tbody tr:first-child td {
padding-top: 0.625rem;
}
.apr-breakdown-row-label {
display: block;
color: var(--text);
font-weight: 500;
}
.apr-breakdown-row-desc {
display: block;
color: var(--muted);
font-size: 0.72rem;
margin-top: 0.1rem;
}
.apr-breakdown-row-value {
color: var(--text);
font-variant-numeric: tabular-nums;
vertical-align: top;
padding-top: 0.625rem;
}
/* ── Total row ─────────────────────────────────────────────────────────────── */
.apr-breakdown-total-row td {
padding-top: 0.75rem;
border-top: 1px solid var(--border);
}
.apr-breakdown-total-row .apr-breakdown-row-label {
color: var(--accent);
}
.apr-breakdown-total-value {
color: var(--accent);
font-weight: 700;
font-size: 1rem;
font-variant-numeric: tabular-nums;
vertical-align: top;
padding-top: 0.75rem;
}
/* ── Footnote ──────────────────────────────────────────────────────────────── */
.apr-breakdown-footnote {
margin-top: 0.875rem;
padding-top: 0.75rem;
border-top: 1px solid var(--border);
font-size: 0.72rem;
color: var(--muted);
line-height: 1.5;
}
/* ── Reduced motion ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
.apr-breakdown-panel,
.apr-breakdown-panel.bottom-sheet,
.apr-breakdown-chevron {
animation: none;
transition: none;
}
}
/* Reduced Motion Override */
[data-motion="reduced"] .apr-breakdown-panel,
[data-motion="reduced"] .apr-breakdown-panel.bottom-sheet,
[data-motion="reduced"] .apr-breakdown-chevron {
animation: none;
transition: none;
}