/* ShopDispatch — Storefront design system
   Inspired by modern product-builder UIs (Lovable-style): soft gradients,
   generous radius, subtle depth, confident type scale. */

:root {
	--sd-bg: #fafafa;
	--sd-surface: #ffffff;
	--sd-border: #ececec;
	--sd-text: #18181b;
	--sd-text-muted: #71717a;
	--sd-primary: #7c3aed;
	--sd-primary-dark: #6d28d9;
	--sd-primary-light: #ede9fe;
	--sd-accent: #f97316;
	--sd-success: #16a34a;
	--sd-danger: #dc2626;
	--sd-radius-sm: 8px;
	--sd-radius-md: 14px;
	--sd-radius-lg: 22px;
	--sd-shadow: 0 1px 2px rgba(16,16,20,0.04), 0 8px 24px rgba(16,16,20,0.06);
	--sd-shadow-hover: 0 4px 12px rgba(16,16,20,0.08), 0 16px 40px rgba(16,16,20,0.10);
	--sd-font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.sd-wrap * { box-sizing: border-box; }

.sd-wrap {
	font-family: var(--sd-font);
	color: var(--sd-text);
	max-width: 1180px;
	margin: 0 auto;
	padding: 32px 20px 80px;
}

/* ---------- Hero / header band ---------- */
.sd-hero {
	background: linear-gradient(135deg, var(--sd-primary) 0%, #a855f7 55%, var(--sd-accent) 130%);
	border-radius: var(--sd-radius-lg);
	padding: 48px 40px;
	color: #fff;
	margin-bottom: 36px;
	position: relative;
	overflow: hidden;
}
.sd-hero::after {
	content: "";
	position: absolute; inset: 0;
	background: radial-gradient(600px circle at 85% 20%, rgba(255,255,255,0.18), transparent 60%);
}
.sd-hero h1 { font-size: 32px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.02em; }
.sd-hero p { font-size: 16px; opacity: 0.92; margin: 0; max-width: 540px; }

/* ---------- Product grid ---------- */
.sd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
}

.sd-card {
	background: var(--sd-surface);
	border: 1px solid var(--sd-border);
	border-radius: var(--sd-radius-md);
	overflow: hidden;
	box-shadow: var(--sd-shadow);
	transition: box-shadow .2s ease, transform .2s ease;
	display: flex;
	flex-direction: column;
}
.sd-card:hover { box-shadow: var(--sd-shadow-hover); transform: translateY(-2px); }

.sd-card__image {
	aspect-ratio: 1 / 1;
	width: 100%;
	object-fit: cover;
	background: var(--sd-primary-light);
}
.sd-card__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sd-card__title { font-size: 15px; font-weight: 600; margin: 0; line-height: 1.3; }
.sd-card__price { font-size: 16px; font-weight: 700; color: var(--sd-primary-dark); }
.sd-card__price-old { font-size: 13px; color: var(--sd-text-muted); text-decoration: line-through; margin-right: 6px; }
.sd-card__stock { font-size: 12px; color: var(--sd-danger); font-weight: 600; }

/* ---------- Buttons ---------- */
.sd-btn {
	display: inline-flex; align-items: center; justify-content: center;
	gap: 8px;
	font-family: var(--sd-font);
	font-weight: 600;
	font-size: 14px;
	padding: 11px 20px;
	border-radius: var(--sd-radius-sm);
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.sd-btn-primary { background: var(--sd-primary); color: #fff; }
.sd-btn-primary:hover { background: var(--sd-primary-dark); transform: translateY(-1px); }
.sd-btn-outline { background: transparent; color: var(--sd-primary); border: 1.5px solid var(--sd-primary); }
.sd-btn-outline:hover { background: var(--sd-primary-light); }
.sd-btn-block { width: 100%; }
.sd-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cart / checkout layout ---------- */
.sd-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 780px) { .sd-layout { grid-template-columns: 1fr; } }

.sd-panel {
	background: var(--sd-surface);
	border: 1px solid var(--sd-border);
	border-radius: var(--sd-radius-md);
	padding: 24px;
	box-shadow: var(--sd-shadow);
}
.sd-panel h2 { font-size: 18px; margin: 0 0 16px; }

.sd-line { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--sd-border); }
.sd-line:last-child { border-bottom: none; }
.sd-line__img { width: 64px; height: 64px; border-radius: var(--sd-radius-sm); object-fit: cover; background: var(--sd-primary-light); flex-shrink: 0; }
.sd-line__name { font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.sd-line__meta { font-size: 13px; color: var(--sd-text-muted); }
.sd-line__qty { display: flex; align-items: center; gap: 8px; }
.sd-qty-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--sd-border); background: #fff; cursor: pointer; font-weight: 700; }
.sd-line__total { font-weight: 700; margin-left: auto; }
.sd-line__remove { color: var(--sd-danger); font-size: 12px; cursor: pointer; background: none; border: none; text-decoration: underline; }

.sd-summary-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; color: var(--sd-text-muted); }
.sd-summary-row.sd-total { font-size: 17px; font-weight: 700; color: var(--sd-text); border-top: 1px solid var(--sd-border); margin-top: 8px; padding-top: 14px; }

/* ---------- Forms ---------- */
.sd-field { margin-bottom: 16px; }
.sd-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.sd-field input[type=text],
.sd-field input[type=tel],
.sd-field input[type=email],
.sd-field textarea,
.sd-field select {
	width: 100%;
	padding: 11px 14px;
	border-radius: var(--sd-radius-sm);
	border: 1.5px solid var(--sd-border);
	font-family: var(--sd-font);
	font-size: 14px;
	background: #fff;
}
.sd-field input:focus, .sd-field textarea:focus, .sd-field select:focus {
	outline: none; border-color: var(--sd-primary); box-shadow: 0 0 0 3px var(--sd-primary-light);
}

.sd-toggle-group { display: flex; gap: 10px; margin-bottom: 18px; }
.sd-toggle {
	flex: 1; text-align: center; padding: 14px; border-radius: var(--sd-radius-sm);
	border: 1.5px solid var(--sd-border); cursor: pointer; font-weight: 600; font-size: 14px;
	transition: all .15s ease;
}
.sd-toggle.active { border-color: var(--sd-primary); background: var(--sd-primary-light); color: var(--sd-primary-dark); }

/* ---------- Badges / alerts ---------- */
.sd-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.sd-badge-success { background: #dcfce7; color: #166534; }
.sd-badge-pending { background: #fef3c7; color: #92400e; }
.sd-badge-processing { background: #dbeafe; color: #1e40af; }
.sd-alert { padding: 14px 16px; border-radius: var(--sd-radius-sm); font-size: 14px; margin-bottom: 18px; }
.sd-alert-error { background: #fee2e2; color: #991b1b; }
.sd-alert-success { background: #dcfce7; color: #166534; }

.sd-empty { text-align: center; padding: 60px 20px; color: var(--sd-text-muted); }
.sd-empty h3 { color: var(--sd-text); margin-bottom: 8px; }

.sd-track-code { font-family: monospace; font-size: 18px; font-weight: 700; background: var(--sd-primary-light); color: var(--sd-primary-dark); padding: 8px 14px; border-radius: var(--sd-radius-sm); display: inline-block; }
