/**
 * Achol Core – Component Styles (Foundation)
 * Version: 1.0.0
 *
 * Base component states. Expanded in later phases.
 */

/* ========================================
   PRODUCT CARD – STATE SYSTEM
   ======================================== */
.achol-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--achol-color-background);
	border-radius: var(--achol-radius-card);
	overflow: hidden;
	transition: box-shadow var(--achol-transition-base);
}

.achol-product-card:hover {
	box-shadow: var(--achol-shadow-md);
}

.achol-product-card__image {
	position: relative;
	aspect-ratio: var(--achol-product-aspect-ratio);
	overflow: hidden;
	background: var(--achol-color-soft-neutral);
}

.achol-product-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--achol-transition-slow);
}

.achol-product-card:hover .achol-product-card__image img {
	transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
	.achol-product-card:hover .achol-product-card__image img {
		transform: none;
	}
}

.achol-product-card__body {
	padding: var(--achol-space-4);
	display: flex;
	flex-direction: column;
	gap: var(--achol-space-2);
	flex-grow: 1;
}

.achol-product-card__title {
	font-size: var(--achol-font-size-sm);
	font-weight: var(--achol-font-weight-medium);
	color: var(--achol-color-secondary);
	margin: 0;
	line-height: var(--achol-line-height-snug);
}

.achol-product-card__title a {
	color: inherit;
	text-decoration: none;
}

.achol-product-card__title a:hover {
	color: var(--achol-color-primary);
}

.achol-product-card__price {
	font-size: var(--achol-font-size-sm);
	font-weight: var(--achol-font-weight-semibold);
	color: var(--achol-color-secondary);
}

.achol-product-card__price del {
	color: var(--achol-color-text-muted);
	font-weight: var(--achol-font-weight-regular);
	margin-right: var(--achol-space-2);
}

.achol-product-card__price ins {
	text-decoration: none;
	color: var(--achol-color-sale);
}

/* Badges */
.achol-badge {
	display: inline-block;
	padding: 0.2rem 0.5rem;
	font-size: var(--achol-font-size-xs);
	font-weight: var(--achol-font-weight-medium);
	line-height: 1.2;
	border-radius: var(--achol-radius-sm);
	text-transform: uppercase;
	letter-spacing: var(--achol-letter-spacing-wide);
}

.achol-badge--sale {
	background: var(--achol-color-sale);
	color: #fff;
}

.achol-badge--new {
	background: var(--achol-color-new);
	color: #fff;
}

.achol-badge--out-of-stock {
	background: var(--achol-color-out-of-stock);
	color: #fff;
}

.achol-product-card__badges {
	position: absolute;
	top: var(--achol-space-3);
	left: var(--achol-space-3);
	display: flex;
	flex-direction: column;
	gap: var(--achol-space-1);
	z-index: 2;
}

/* Out of stock state */
.achol-product-card.is-out-of-stock {
	opacity: 0.7;
}

.achol-product-card.is-out-of-stock .achol-product-card__image::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.4);
}

/* Loading state */
.achol-product-card.is-loading {
	pointer-events: none;
}

.achol-product-card.is-loading .achol-product-card__image {
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: achol-shimmer 1.5s infinite;
}

@keyframes achol-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.achol-product-card.is-loading .achol-product-card__image {
		animation: none;
		background: var(--achol-color-soft-neutral);
	}
}

/* ========================================
   MODAL BASE STATES
   ======================================== */
.achol-modal {
	position: fixed;
	inset: 0;
	z-index: var(--achol-z-modal);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--achol-space-4);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--achol-transition-base), visibility var(--achol-transition-base);
}

.achol-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.achol-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.achol-modal__content {
	position: relative;
	background: var(--achol-color-background);
	border-radius: var(--achol-radius-lg);
	max-width: 600px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: var(--achol-shadow-lg);
	transform: translateY(10px);
	transition: transform var(--achol-transition-base);
}

.achol-modal.is-open .achol-modal__content {
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	.achol-modal,
	.achol-modal__content {
		transition: none;
	}
}

.achol-modal__close {
	position: absolute;
	top: var(--achol-space-3);
	right: var(--achol-space-3);
	width: 2rem;
	height: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 1.25rem;
	color: var(--achol-color-text-secondary);
	border-radius: var(--achol-radius-full);
}

.achol-modal__close:hover {
	background: var(--achol-color-soft-neutral);
	color: var(--achol-color-secondary);
}

.achol-modal__close:focus-visible {
	outline: var(--achol-focus-outline);
	outline-offset: 2px;
}
