/**
 * Responsive Styles - Mobile-first polish
 *
 * @package Stam_Chocolate
 * @since 2.0.0
 */

/* ==========================================================================
   Extra Small Devices (phones, 576px and down)
   ========================================================================== */

@media (max-width: 575.98px) {
	:root {
		--container-padding: 16px;
		--text-4xl: 2rem;
		--text-3xl: 1.75rem;
		--text-2xl: 1.5rem;
		--space-4xl: 60px;
		--space-3xl: 48px;
		--grid-gap: 20px;
	}

	/* Header */
	.header-container {
		height: 60px;
	}

	.site-branding img {
		height: 40px;
	}

	.heritage-badge {
		display: none !important;
	}

	.cart-icon {
		width: 40px;
		height: 40px;
	}

	/* Hero */
	.hero {
		min-height: 280px;
		padding: var(--space-xl) var(--container-padding);
	}

	.hero h1 {
		font-size: 1.75rem;
	}

	.hero-subtitle {
		font-size: 0.875rem;
	}

	.hero p {
		font-size: 1rem;
	}

	/* Products */
	.products {
		grid-template-columns: repeat(2, 1fr);
		gap: var(--space-sm);
	}

	.product-info {
		padding: var(--space-sm) 0;
	}

	.products .product .woocommerce-loop-product__title,
	.products .product h2 {
		font-size: 0.9375rem !important;
	}

	.products .product .price {
		font-size: 0.9375rem;
	}

	/* Categories */
	.categories-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: var(--space-sm);
	}

	.category-card {
		padding: var(--space-md);
	}

	.category-image {
		max-width: 100px;
	}

	.category-icon {
		width: 48px;
		height: 48px;
		font-size: 1.5rem;
	}

	/* Heritage */
	.heritage-content {
		gap: var(--space-xl);
	}

	.heritage-stats {
		gap: var(--space-lg);
	}

	.stat-number {
		font-size: 2rem;
	}

	/* Footer */
	.footer-widgets {
		gap: var(--space-lg);
	}

	.site-info {
		flex-direction: column;
		gap: var(--space-md);
		text-align: center;
	}

	.payment-icons {
		justify-content: center;
	}

	/* Forms */
	.woocommerce-billing-fields__field-wrapper,
	.woocommerce-shipping-fields__field-wrapper {
		grid-template-columns: 1fr;
	}

	/* Single Product */
	.single-product .product {
		gap: var(--space-xl);
	}

	.single-product .quantity {
		margin-right: 0;
		margin-bottom: var(--space-sm);
		width: 100%;
	}

	.single-product .quantity .qty {
		width: 100%;
	}

	.single-product .single_add_to_cart_button {
		width: 100%;
	}
}

/* ==========================================================================
   Small Devices (landscape phones, 576px to 767px)
   ========================================================================== */

@media (min-width: 576px) and (max-width: 767.98px) {
	.products {
		grid-template-columns: repeat(2, 1fr);
	}

	.categories-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.heritage-stats {
		flex-wrap: wrap;
		gap: var(--space-xl);
	}
}

/* ==========================================================================
   Medium Devices (tablets, 768px to 991px)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 991.98px) {
	.products {
		grid-template-columns: repeat(3, 1fr);
	}

	.categories-grid {
		grid-template-columns: repeat(4, 1fr);
	}

	.footer-widgets {
		grid-template-columns: repeat(2, 1fr);
	}

	.woocommerce-checkout {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Large Devices (desktops, 992px to 1199px)
   ========================================================================== */

@media (min-width: 992px) and (max-width: 1199.98px) {
	.products {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
	/* Show add to cart button on touch devices since there's no hover */
	.products .product .button,
	.products .product .add_to_cart_button,
	.products .product .product_type_variable {
		transform: translateY(0);
		position: relative;
		bottom: auto;
		margin-top: var(--space-sm);
	}

	/* Increase tap targets */
	.primary-menu a {
		padding: var(--space-md);
	}

	.btn,
	.button,
	button {
		min-height: 48px;
		padding: var(--space-md) var(--space-lg);
	}

	/* Remove hover effects that don't work on touch */
	.products .product:hover img {
		transform: none;
	}

	.category-card:hover {
		transform: none;
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.site-header,
	.site-footer,
	.shipping-notice,
	.hero-dots,
	.search-form,
	.product-overlay,
	.add_to_cart_button {
		display: none !important;
	}

	body {
		font-size: 12pt;
		line-height: 1.5;
		color: #000;
		background: #fff;
	}

	.container {
		max-width: 100%;
		padding: 0;
	}

	a {
		color: #000;
		text-decoration: underline;
	}

	a[href]::after {
		content: " (" attr(href) ")";
		font-size: 10pt;
	}

	img {
		max-width: 100% !important;
	}
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.hero-slide {
		animation: none;
	}
}

/* ==========================================================================
   Dark Mode (if user prefers)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
	/* Only apply if theme supports it - for now, keep light */
	/* Can be enabled in future version */
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
	:root {
		--color-border: #4A3428;
	}

	.btn,
	.button,
	button {
		border-width: 2px;
	}

	a:focus,
	button:focus,
	input:focus {
		outline: 3px solid var(--color-gold);
		outline-offset: 2px;
	}
}

/* ==========================================================================
   Landscape Orientation Adjustments
   ========================================================================== */

@media (orientation: landscape) and (max-height: 500px) {
	.hero {
		min-height: 250px;
		padding: var(--space-xl) var(--container-padding);
	}

	.hero h1 {
		font-size: var(--text-2xl);
	}
}

/* ==========================================================================
   Safe Area Insets (for devices with notches)
   ========================================================================== */

@supports (padding: env(safe-area-inset-top)) {
	.site-header {
		padding-top: env(safe-area-inset-top);
	}

	.site-footer {
		padding-bottom: env(safe-area-inset-bottom);
	}

	.container {
		padding-left: max(var(--container-padding), env(safe-area-inset-left));
		padding-right: max(var(--container-padding), env(safe-area-inset-right));
	}
}

