/*
 * Plan Heavy components.
 *
 * Named, reusable components (rule 2.2). Each is defined once and used
 * everywhere; states (hover, focus, disabled) are defined here, not improvised
 * per page (rule 2.3). Touch targets are at least 44px (rule 15.6).
 */

/* --- Button --- */
.ph-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 var(--ph-space-5);
	border: 1px solid transparent;
	border-radius: var(--ph-radius-pill);
	font-family: var(--ph-font-display);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ph-btn:hover,
.ph-btn:focus {
	text-decoration: none;
}

.ph-btn--primary {
	background: var(--ph-color-primary);
	color: #fff;
}

.ph-btn--primary:hover,
.ph-btn--primary:focus {
	filter: brightness(0.93);
	color: #fff;
}

.ph-btn--ghost {
	background: transparent;
	border-color: var(--ph-color-line);
	color: var(--ph-color-ink);
}

.ph-btn--ghost:hover,
.ph-btn--ghost:focus {
	border-color: var(--ph-color-primary);
	color: var(--ph-color-primary);
}

.ph-btn:disabled,
.ph-btn[aria-disabled="true"] {
	opacity: 0.5;
	cursor: not-allowed;
}

.ph-btn:focus-visible {
	outline: 3px solid var(--ph-color-secondary);
	outline-offset: 2px;
}

/* --- Card --- */
.ph-card {
	background: var(--ph-color-surface);
	border-radius: var(--ph-radius-lg);
	box-shadow: var(--ph-shadow-card);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.ph-card__media {
	position: relative;
	display: block;
	aspect-ratio: 3 / 2;
}

.ph-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ph-card__img--placeholder {
	display: block;
	background: linear-gradient(135deg, var(--ph-color-line), var(--ph-color-bg));
}

.ph-card__body {
	padding: var(--ph-space-4);
}

.ph-card__title {
	font-size: 1.1rem;
	margin: 0 0 var(--ph-space-2);
}

.ph-card__title a {
	color: var(--ph-color-ink);
}

.ph-card__desc {
	color: var(--ph-color-ink-soft);
	font-size: var(--ph-text-small);
	margin: 0 0 var(--ph-space-3);
}

.ph-card__meta {
	display: flex;
	justify-content: space-between;
	gap: var(--ph-space-3);
	font-size: var(--ph-text-small);
	color: var(--ph-color-ink-soft);
}

.ph-card__price {
	font-weight: 600;
	color: var(--ph-color-ink);
}

.ph-card--featured {
	outline: 2px solid var(--ph-color-featured);
}

/* --- Badge --- */
.ph-badge {
	position: absolute;
	top: var(--ph-space-3);
	left: var(--ph-space-3);
	padding: var(--ph-space-1) var(--ph-space-3);
	border-radius: var(--ph-radius-pill);
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #fff;
}

.ph-badge--featured {
	background: var(--ph-color-featured);
}

/* --- Panel (sidebar / content blocks) --- */
.ph-panel {
	background: var(--ph-color-surface);
	border: 0;
	border-radius: var(--ph-radius-md);
	padding: var(--ph-space-5);
	margin-bottom: var(--ph-space-5);
	box-shadow: 0 1px 2px rgba(33, 37, 58, 0.05);
}

.ph-panel__title {
	font-size: var(--ph-text-label);
	font-weight: var(--ph-weight-label);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ph-color-ink-soft);
	margin-bottom: var(--ph-space-4);
}

.ph-grid__loading {
	color: var(--ph-color-ink-soft);
}

/*
 * Mode tints (rule 2.6). A single body class re-points the primary token so the
 * accent shifts without redesigning anything. Defined once, here.
 */
.ph-mode-vegan {
	--ph-color-primary: var(--ph-color-vegan);
}

.ph-mode-accessibility {
	--ph-color-primary: var(--ph-color-accessibility);
}
