CSS modularization Phase 2: account, cart, checkout

Extract account/cart/checkout styles into dedicated CSS files; remove inline styles and orphaned style blocks from HTML. Wire $extraHead on all account pages, cart.php, and checkout.php.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 17:51:57 +00:00
parent 771e1a15b1
commit 5637b6d7f5
14 changed files with 556 additions and 345 deletions
+223
View File
@@ -0,0 +1,223 @@
/* Account Layout */
.account-layout {
display: grid;
grid-template-columns: 250px 1fr;
gap: 2rem;
}
.account-sidebar {
background: var(--color-surface);
border-radius: var(--radius-lg);
padding: 1.5rem;
height: fit-content;
position: sticky;
top: 90px;
}
.account-avatar {
width: 80px;
height: 80px;
background: var(--color-primary);
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 2rem;
margin: 0 auto 1rem;
}
.account-sidebar-user {
text-align: center;
margin-bottom: 1.5rem;
}
.account-sidebar-user h3 {
margin: 0 0 0.25rem;
font-size: 1rem;
}
.account-sidebar-user p {
font-size: 0.875rem;
margin: 0;
color: var(--color-text-muted);
}
.account-nav {
list-style: none;
}
.account-nav li {
margin-bottom: 0.5rem;
}
.account-nav a {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.75rem 1rem;
border-radius: var(--radius-md);
color: var(--color-text);
transition: all 0.2s;
}
.account-nav a:hover {
background: var(--color-background);
color: var(--color-primary);
}
.account-nav a.active {
background: var(--color-primary);
color: white;
}
.account-nav a i {
width: 20px;
text-align: center;
}
.account-nav a.danger {
color: var(--color-error);
}
.account-content {
min-height: 500px;
}
.account-header {
margin-bottom: 2rem;
}
.account-header h1 {
font-size: 1.75rem;
margin-bottom: 0.5rem;
}
/* Section Cards */
.section-card {
background: var(--color-surface);
border-radius: var(--radius-lg);
margin-bottom: 1.5rem;
}
.section-card-header {
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--color-border);
display: flex;
justify-content: space-between;
align-items: center;
}
.section-card-header h3 {
margin: 0;
font-size: 1rem;
}
.section-card-body {
padding: 1.5rem;
}
/* Order List Items */
.order-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 0;
border-bottom: 1px solid var(--color-border);
}
.order-item:last-child {
border-bottom: none;
padding-bottom: 0;
}
.order-item:first-child {
padding-top: 0;
}
.order-info h4 {
margin: 0 0 0.25rem;
font-size: 0.9375rem;
}
.order-info p {
margin: 0;
color: var(--color-text-muted);
font-size: 0.875rem;
}
.order-meta {
text-align: right;
}
.order-meta .amount {
font-weight: 600;
margin-bottom: 0.25rem;
}
/* Dashboard Stats Grid */
.dashboard-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
margin-bottom: 2rem;
}
.dashboard-stat {
background: var(--color-surface);
border-radius: var(--radius-lg);
padding: 1.5rem;
text-align: center;
}
.dashboard-stat-icon {
width: 50px;
height: 50px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 1rem;
font-size: 1.25rem;
}
.dashboard-stat-icon.primary {
background: rgba(255, 94, 26, 0.1);
color: var(--color-primary);
}
.dashboard-stat-icon.success {
background: rgba(16, 185, 129, 0.1);
color: var(--color-success);
}
.dashboard-stat-icon.warning {
background: rgba(245, 158, 11, 0.1);
color: var(--color-warning);
}
.dashboard-stat-value {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 0.25rem;
}
.dashboard-stat-label {
color: var(--color-text-muted);
font-size: 0.875rem;
}
/* Responsive */
@media (max-width: 768px) {
.account-layout {
grid-template-columns: 1fr;
}
.account-sidebar {
position: static;
}
.dashboard-grid {
grid-template-columns: repeat(2, 1fr);
}
}
+154
View File
@@ -0,0 +1,154 @@
/* Cart Page Layout */
.cart-layout {
display: grid;
grid-template-columns: 1fr 350px;
gap: 2rem;
align-items: start;
}
.cart-empty {
padding: 3rem;
text-align: center;
}
.cart-empty-icon {
font-size: 4rem;
color: var(--color-text-muted);
margin-bottom: 1rem;
}
/* Cart Items */
.cart-items-list {
display: grid;
gap: 1rem;
}
.cart-item {
display: grid;
grid-template-columns: 80px 1fr auto auto;
gap: 1rem;
align-items: center;
padding-bottom: 1rem;
border-bottom: 1px solid var(--color-border);
}
.cart-item:last-child {
border-bottom: none;
padding-bottom: 0;
}
.cart-item-img {
width: 80px;
height: 80px;
object-fit: cover;
border-radius: var(--radius-md);
}
.cart-item-name {
font-weight: 600;
margin-bottom: 0.25rem;
}
.cart-item-price {
color: var(--color-text-muted);
margin: 0;
}
/* Quantity Selector */
.quantity-selector {
display: flex;
align-items: center;
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
}
.qty-btn {
padding: 0.25rem 0.75rem;
background: none;
border: none;
cursor: pointer;
font-size: 1rem;
color: var(--color-text);
transition: var(--transition);
}
.qty-btn:hover {
color: var(--color-primary);
}
.qty-input {
width: 50px;
text-align: center;
border: none;
outline: none;
font-size: 1rem;
font-family: inherit;
}
.cart-item-total {
text-align: right;
}
.cart-item-total .amount {
font-weight: 600;
margin-bottom: 0.25rem;
}
.btn-remove {
background: none;
border: none;
color: var(--color-error);
cursor: pointer;
font-size: 0.875rem;
padding: 0;
}
/* Order Summary Sidebar */
.cart-summary {
position: sticky;
top: 100px;
}
.cart-summary-row {
display: flex;
justify-content: space-between;
margin-bottom: 0.5rem;
}
.cart-summary-total {
display: flex;
justify-content: space-between;
font-size: 1.25rem;
font-weight: 600;
}
.free-shipping-msg {
font-size: 0.875rem;
color: var(--color-primary);
margin: 0.5rem 0;
}
@media (max-width: 768px) {
.cart-layout {
grid-template-columns: 1fr;
}
.cart-summary {
position: static;
}
.cart-item {
grid-template-columns: 64px 1fr;
grid-template-rows: auto auto;
}
.cart-item-img {
width: 64px;
height: 64px;
}
.quantity-selector,
.cart-item-total {
grid-column: 2;
}
}
+103
View File
@@ -0,0 +1,103 @@
/* Checkout Page Layout */
.checkout-layout {
display: grid;
grid-template-columns: 1fr 400px;
gap: 2rem;
align-items: start;
}
/* Address grid: city / state / zip */
.address-grid {
display: grid;
grid-template-columns: 2fr 1fr 1fr;
gap: 1rem;
}
/* Order Summary Sidebar */
.checkout-summary {
position: sticky;
top: 100px;
}
/* Scrollable cart preview in sidebar */
.checkout-items-preview {
max-height: 250px;
overflow-y: auto;
margin-bottom: 1rem;
}
.checkout-item {
display: flex;
gap: 1rem;
margin-bottom: 1rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--color-border);
}
.checkout-item:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
.checkout-item-img {
width: 60px;
height: 60px;
object-fit: cover;
border-radius: var(--radius-md);
flex-shrink: 0;
}
.checkout-item-info {
flex: 1;
}
.checkout-item-info p {
font-weight: 500;
margin-bottom: 0.25rem;
}
.checkout-item-info small {
color: var(--color-text-muted);
font-size: 0.875rem;
}
.checkout-item-total {
text-align: right;
font-weight: 600;
}
.checkout-summary-row {
display: flex;
justify-content: space-between;
margin-bottom: 0.5rem;
}
.checkout-summary-total {
display: flex;
justify-content: space-between;
font-size: 1.25rem;
font-weight: 600;
}
.secure-badge {
font-size: 0.75rem;
color: var(--color-text-muted);
text-align: center;
margin-top: 1rem;
}
@media (max-width: 768px) {
.checkout-layout {
grid-template-columns: 1fr;
}
.checkout-summary {
position: static;
order: -1;
}
.address-grid {
grid-template-columns: 1fr 1fr;
}
}