:root {
	/* Layout & Spacing */
	--container-width: 1200px;
	--container-wide: 1400px;
	--gap: 16px;
	--gap-sm: 8px;
	--gap-lg: 24px;
	--gap-xl: 32px;
	
	/* Borders & Shapes */
	--border-radius: 10px;
	--border-radius-sm: 6px;
	--border-radius-lg: 16px;
	--border: #e1ddd6;
	
	/* Shadows */
	--card-shadow: 0 4px 12px rgba(114, 47, 55, 0.08);
	--card-shadow-hover: 0 8px 24px rgba(114, 47, 55, 0.15);
	--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	
	/* Colors: Base */
	--bg: #faf9f7;
	--bg-secondary: #f6f4f1;
	--surface: #ffffff;
	
	/* Colors: Typography */
	--text: #2c1810;
	--text-secondary: #5a4d42;
	--text-muted: #6b5d52;
	
	/* Colors: Brand (Wine Theme) */
	--wine-primary: #722f37;
	--wine-secondary: #8b1538;
	--wine-accent: #d4af37;
	--wine-rose: #c4969f;
	--wine-deep: #4a1c20;
	
	/* Colors: Functional Aliases */
	--brand: var(--wine-primary);
	--brand-hover: var(--wine-secondary);
	--brand-light: var(--wine-rose);
	--accent: var(--wine-accent);
	--success: #059669;
	--warning: #d97706;
	--error: #dc2626;
	--info: #0284c7;
	
	/* Typography */
	--font-primary: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
	--font-serif: Georgia, 'Times New Roman', Times, serif;
	--font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
	--font-heading: var(--font-serif);
	
	/* Fluid Typography */
	--font-size-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem);
	--font-size-sm: clamp(0.8125rem, 0.75rem + 0.3vw, 0.875rem);
	--font-size-base: clamp(0.9375rem, 0.875rem + 0.3vw, 1rem);
	--font-size-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);
	--font-size-xl: clamp(1.125rem, 1.0625rem + 0.3vw, 1.25rem);
	--font-size-2xl: clamp(1.25rem, 1.125rem + 0.625vw, 1.5rem);
	--font-size-3xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
	
	/* Fluid Spacing */
	--spacing-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.375rem);
	--spacing-sm: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
	--spacing-md: clamp(0.75rem, 0.6rem + 0.75vw, 1.125rem);
	--spacing-lg: clamp(1rem, 0.8rem + 1vw, 1.5rem);
	--spacing-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
	
	/* Interactive Elements */
	--touch-target-sm: clamp(32px, 30px + 1vw, 40px);
	--touch-target-md: clamp(36px, 34px + 1vw, 44px);
	--touch-target-lg: clamp(44px, 42px + 1vw, 48px);
	
	--font-weight-normal: 400;
	--font-weight-medium: 500;
	--font-weight-semibold: 600;
	--font-weight-bold: 700;
	
	--line-height-tight: 1.25;
	--line-height-normal: 1.5;
	--line-height-relaxed: 1.75;
}

/* -------------------------------------------------------------------------
   Global Resets & Typography
   ------------------------------------------------------------------------- */
body {
	font-family: var(--font-primary);
	font-size: var(--font-size-base);
	line-height: var(--line-height-normal);
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-serif);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-tight);
	color: var(--text);
	margin: 0 0 1rem;
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }

.container { 
	max-width: var(--container-width); 
	margin-inline: auto; 
	padding: 0 20px; 
}

.container-wide {
	max-width: var(--container-wide);
	margin-inline: auto;
	padding: 0 20px;
}

/* -------------------------------------------------------------------------
   Header & Navigation
   ------------------------------------------------------------------------- */
.site-header { 
	position: sticky; 
	top: 0; 
	z-index: 100; 
	background: var(--surface);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-bottom: 1px solid rgba(114, 47, 55, 0.1);
	transition: var(--transition);
	will-change: transform;
	transform: translateY(0);
}

.site-header.header-hidden {
	transform: translateY(-100%);
}

.header-inner { 
	display: flex; 
	align-items: center; 
	gap: var(--gap-lg); 
	padding: 16px 0;
	min-height: 80px;
	justify-content: center;
}

/* Branding */
.branding {
	display: flex;
	align-items: center;
	height: 48px;
	order: 1;
	flex-shrink: 0;
}

.branding .custom-logo-wrapper {
	display: flex;
	align-items: center;
	height: 48px;
}

.branding .custom-logo-wrapper a {
	display: flex;
	align-items: center;
	height: 100%;
}

.branding .custom-logo-wrapper img {
	max-height: 48px;
	width: auto;
	height: auto;
}

.branding .site-logo { 
	font-family: var(--font-serif);
	font-weight: var(--font-weight-bold);
	color: var(--brand); 
	font-size: var(--font-size-2xl);
	text-decoration: none;
	transition: var(--transition);
	line-height: 1;
	display: flex;
	align-items: center;
	height: 48px;
	white-space: nowrap;
}

.branding .site-logo span {
	display: inline-block;
}

.branding .site-logo:hover {
	color: var(--brand-hover);
}

/* Language Selector */
.language-selector {
	order: 5;
}

/* Primary Navigation */
.primary-nav .menu { 
	display: flex; 
	gap: var(--gap-lg); 
	list-style: none; 
	margin: 0; 
	padding: 0; 
}

.primary-nav .menu li {
	position: relative;
}

.primary-nav a { 
	color: var(--text);
	font-weight: var(--font-weight-medium);
	text-decoration: none;
	padding: 8px 12px;
	border-radius: var(--border-radius-sm);
	transition: var(--transition);
}

.primary-nav a:hover,
.primary-nav a:focus {
	color: var(--brand);
	background: rgba(114, 47, 55, 0.05);
}

/* Category Navigation (Header Buttons) */
.category-nav {
	display: flex;
	align-items: center;
	margin-left: auto;
	position: relative;
	z-index: 1;
	height: 40px;
	order: 3;
}

.category-menu {
	display: flex;
	gap: 12px;
	list-style: none;
	margin: 0;
	padding: 0;
	align-items: center;
	height: 40px;
}

.category-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	padding: 0 14px;
	min-width: 100px;
	background: linear-gradient(135deg, rgba(246, 244, 241, 0.6) 0%, rgba(250, 249, 247, 0.4) 100%);
	color: var(--brand);
	text-decoration: none;
	border-radius: 8px;
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-semibold);
	letter-spacing: 0.01em;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
	border: 1.5px solid rgba(114, 47, 55, 0.08);
	box-shadow: 0 1px 3px rgba(114, 47, 55, 0.04);
	position: relative;
	overflow: hidden;
}

/* Shine effect for category buttons */
.category-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
	transition: left 0.5s ease;
}

.category-btn:hover::before {
	left: 100%;
}

.category-btn:hover,
.category-btn:focus {
	background: linear-gradient(135deg, var(--wine-accent) 0%, var(--wine-primary) 100%);
	color: var(--surface);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(114, 47, 55, 0.25), 0 2px 8px rgba(212, 175, 55, 0.2);
	border-color: var(--wine-accent);
}

.category-btn:active {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(114, 47, 55, 0.2);
}

/* Desktop Search */
.header-search-desktop {
	position: relative;
	z-index: 100;
	flex-shrink: 0;
	width: 245px;
	min-height: 48px;
	transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	order: 2;
}

.header-search-desktop .divinho-search-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 245px;
	transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-search-desktop:hover .divinho-search-container,
.header-search-desktop .divinho-search-container:focus-within {
	width: 680px;
	max-width: calc(100vw - 40px);
	z-index: 102;
}

.header-search-desktop .divinho-search-input-container {
	border: 2px solid transparent;
	background: transparent;
	box-shadow: none;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	height: 48px;
}

.header-search-desktop:hover .divinho-search-input-container {
	background: rgba(255, 255, 255, 0.98);
	border-color: rgba(114, 47, 55, 0.18);
	box-shadow: 0 3px 12px rgba(114, 47, 55, 0.12);
}

.header-search-desktop .divinho-search-container:focus-within .divinho-search-input-container {
	background: #ffffff;
	border-color: var(--wine-accent);
	box-shadow: 0 8px 32px rgba(114, 47, 55, 0.2), 0 0 0 4px rgba(212, 175, 55, 0.12);
	transform: translateY(-2px);
}

.header-search-desktop .divinho-search-input {
	color: var(--wine-primary);
	font-weight: var(--font-weight-medium);
	opacity: 1;
	transition: opacity 0.3s ease 0.1s;
}

.header-search-desktop .divinho-search-input::placeholder {
	background: linear-gradient(135deg, var(--wine-accent) 0%, var(--wine-primary) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	opacity: 0.7;
}

.header-search-desktop .divinho-search-submit {
	background: linear-gradient(135deg, var(--wine-accent) 0%, var(--wine-primary) 100%);
	box-shadow: 0 2px 8px rgba(114, 47, 55, 0.2);
	width: 44px;
	height: 44px;
	border-radius: 12px;
}

.header-search-desktop .divinho-search-submit:hover {
	background: linear-gradient(135deg, var(--wine-primary) 0%, var(--wine-secondary) 100%);
	box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
	transform: translateY(-50%) scale(1.05);
}

/* Header Actions (Cart, Account, Login) */
.header-actions { 
	display: flex; 
	align-items: center; 
	gap: 12px;
	height: 48px;
	order: 4;
}

.header-store-btn.mobile-only {
	display: none;
}

.cart-link,
.account-link,
.login-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 48px;
	padding: 0 16px;
	background: transparent;
	color: var(--wine-primary);
	text-decoration: none;
	border-radius: 8px;
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-semibold);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	border: none;
	box-shadow: none;
	position: relative;
}

.cart-link:hover,
.account-link:hover,
.login-link:hover {
	background: transparent;
	color: var(--wine-accent);
}

.cart-link svg,
.account-link svg,
.login-link svg {
	width: 20px;
	height: 20px;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-link:hover svg,
.account-link:hover svg,
.login-link:hover svg {
	transform: scale(1.1);
}

.cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: var(--wine-primary);
	color: white;
	font-size: 11px;
	font-weight: 700;
	border-radius: 10px;
	position: absolute;
	top: 6px;
	right: 6px;
	box-shadow: 0 2px 6px rgba(114, 47, 55, 0.3);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-link:hover .cart-count {
	background: var(--wine-accent);
	transform: scale(1.05);
}

.header-search-mobile {
	display: none !important;
}

/* -------------------------------------------------------------------------
   New Social Media Components (BEM)
   ------------------------------------------------------------------------- */
.divinho-social-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gap-sm);
	list-style: none;
	padding: 0;
	margin: 0;
}

/* Shared Link Styles */
.divinho-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	color: inherit;
}

/* SVG Icon Sizing & Color */
.divinho-social-icon {
	width: 24px;
	height: 24px;
	fill: currentColor; /* Critical for Firefox & coloring */
	transition: transform 0.3s ease;
}

/* --- Hero Context (Large, Glassmorphic) --- */
.divinho-social-list--hero {
	gap: var(--gap);
	justify-content: flex-start;
}

.divinho-social-list--hero .divinho-social-link {
	padding: 12px 24px;
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50px;
	color: #ffffff;
	font-weight: 600;
	font-size: var(--font-size-sm);
	letter-spacing: 0.5px;
	gap: 10px;
}

.divinho-social-list--hero .divinho-social-link:hover {
	background: rgba(255, 255, 255, 0.2);
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
	border-color: rgba(255, 255, 255, 0.4);
}

.divinho-social-list--hero .divinho-social-icon {
	width: 20px;
	height: 20px;
}

/* Brand Colors for Hero Hover */
.divinho-social-list--hero .divinho-social-link--instagram:hover {
	background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
	border-color: transparent;
}

.divinho-social-list--hero .divinho-social-link--facebook:hover {
	background: #1877F2;
	border-color: transparent;
}

.divinho-social-list--hero .divinho-social-link--twitter:hover {
	background: #1DA1F2;
	border-color: transparent;
}

.divinho-social-list--hero .divinho-social-link--youtube:hover {
	background: #FF0000;
	border-color: transparent;
}

/* --- Footer Context (Minimal, Centered) --- */
.divinho-social-list--footer {
	justify-content: center;
	gap: var(--gap);
	margin-bottom: var(--gap);
}

.divinho-social-list--footer .divinho-social-link {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: #e8dcd8;
	border: 1px solid rgba(255, 255, 255, 0.15);
}

.divinho-social-list--footer .divinho-social-link:hover {
	background: var(--surface);
	transform: translateY(-3px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Footer Brand Hover Colors */
.divinho-social-list--footer .divinho-social-link--instagram:hover {
	color: #E1306C;
}

.divinho-social-list--footer .divinho-social-link--facebook:hover {
	color: #1877F2;
}

.divinho-social-list--footer .divinho-social-link--twitter:hover {
	color: #1DA1F2;
}

.divinho-social-list--footer .divinho-social-link--youtube:hover {
	color: #FF0000;
}

.divinho-social-list--footer .divinho-social-icon {
	width: 20px;
	height: 20px;
}

/* Hide Legacy Social Styles to prevent conflicts */
.footer-social .social-links-wrapper, 
.social-links-wrapper .social-link, 
.social-link .social-icon {
	display: none !important; 
}

/* -------------------------------------------------------------------------
   Footer Structure
   ------------------------------------------------------------------------- */
.site-footer { 
	background: var(--wine-deep);
	color: #d4c4c0; 
	padding: 60px 0 30px;
}

.footer-widgets {
	margin-bottom: var(--gap-xl);
}

.footer-widget-area {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: var(--gap-xl);
}

.footer-widget-column .widget {
	margin-bottom: var(--gap-lg);
}

.footer-widget-column .widget-title {
	color: var(--wine-accent);
	font-family: var(--font-serif);
	font-size: var(--font-size-lg);
	margin-bottom: var(--gap);
}

.footer-widget-column ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.footer-widget-column li {
	padding: var(--gap-sm) 0;
	border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.footer-widget-column li:last-child {
	border-bottom: none;
}

.footer-widget-column a {
	color: #e8dcd8;
	text-decoration: none;
	transition: var(--transition);
}

.footer-widget-column a:hover,
.footer-widget-column a:focus {
	color: var(--wine-accent);
}

.footer-bottom {
	display: flex; 
	flex-direction: column;
	align-items: center; 
	justify-content: center;
	text-align: center;
	gap: var(--gap-lg);
	padding-top: var(--gap-xl);
	border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.footer-social-compact {
	margin-bottom: var(--gap);
	width: 100%;
	display: flex;
	justify-content: center;
}

.footer-nav .menu {
	display: flex;
	justify-content: center;
	gap: var(--gap-lg);
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-nav a {
	color: #e8dcd8;
	text-decoration: none;
	transition: var(--transition);
	font-weight: var(--font-weight-medium);
}

.footer-nav a:hover,
.footer-nav a:focus {
	color: var(--wine-accent);
}

.footer-info {
	text-align: center;
}

.credits {
	margin: 0;
	font-size: var(--font-size-sm);
	color: #e8dcd8;
}

.legal-links {
	margin: var(--gap-sm) 0 0;
	font-size: var(--font-size-sm);
	color: #d4c4c0;
}

.legal-links a {
	color: #e8dcd8;
	text-decoration: none;
	transition: var(--transition);
}

.legal-links a:hover {
	color: var(--wine-accent);
}

.legal-links .separator {
	color: #8a7a76;
}

.site-info {
	margin: var(--gap-sm) 0 0;
	font-size: var(--font-size-xs);
	color: #d4c4c0;
}

.site-info a {
	color: var(--wine-accent);
	text-decoration: none;
}

.site-info a:hover {
	text-decoration: underline;
}

.site-content { 
	background: var(--bg); 
	padding: var(--gap-xl) 0 60px;
	min-height: calc(100vh - 200px);
}

/* -------------------------------------------------------------------------
   Mobile Responsiveness
   ------------------------------------------------------------------------- */
@media (max-width: 768px) {
	.header-inner {
		display: flex;
		flex-wrap: wrap;
		gap: 0;
		padding: var(--spacing-md) 0;
		align-items: center;
		justify-content: space-between;
	}
	
	.branding,
	.language-selector,
	.header-store-btn.mobile-only,
	.header-cart,
	.header-login,
	.header-account {
		flex: 0 0 auto;
		margin-bottom: var(--spacing-md);
	}
	
	.branding { order: 1; }
	.branding .site-logo { font-size: clamp(0.875rem, 0.85rem + 0.125vw, 1rem); }
	.branding .custom-logo-wrapper img { max-height: 36px; }
	
	.language-selector { order: 2; }
	.header-store-btn.mobile-only { order: 3; display: inline-flex !important; }
	.header-cart { order: 4; }
	.header-login, .header-account { order: 5; }
	
	.header-actions { display: contents; }
	.header-search-desktop, .primary-nav, .category-nav { display: none !important; }
	
	.header-search-mobile {
		display: block !important;
		flex-basis: 100%;
		width: 100%;
		order: 6;
	}
	
	.header-search-mobile .divinho-search-input-container {
		background: rgba(255, 255, 255, 0.98);
		border: 2px solid rgba(114, 47, 55, 0.12);
		box-shadow: 0 2px 8px rgba(114, 47, 55, 0.08);
	}

	.divinho-social-list--hero {
		justify-content: center;
		width: 100%;
	}

	.footer-inner {
		flex-direction: column;
		text-align: center;
	}
}

@media (max-width: 480px) {
	.header-inner { padding: var(--spacing-sm) 0; }
	.branding, .language-selector, .header-actions { margin-bottom: var(--spacing-sm); }
	
	.container, .container-wide { padding: 0 12px; }
	.site-content { padding: var(--gap-lg) 0 40px; }
	
	.footer-bottom, .footer-info {
		flex-direction: column;
		text-align: center;
	}
}

/* -------------------------------------------------------------------------
   Accessibility
   ------------------------------------------------------------------------- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	-webkit-clip-path: inset(50%);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--bg-secondary);
	border-radius: var(--border-radius-sm);
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	-webkit-clip-path: none;
	clip-path: none;
	color: var(--text);
	display: block;
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-bold);
	height: auto;
	left: 6px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 7px;
	width: auto;
	z-index: 100000;
}

.skip-link { left: -9999px; position: absolute; top: 6px; }
.skip-link:focus { left: 6px; }

*:focus {
	outline: 2px solid var(--wine-primary);
	outline-offset: 2px;
}

button:focus, input:focus, select:focus, textarea:focus {
	outline: 2px solid var(--wine-primary);
	outline-offset: 0;
	box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.1);
}

@media (prefers-contrast: high) {
	:root {
		--card-shadow: 0 0 0 2px var(--wine-primary);
		--card-shadow-hover: 0 0 0 3px var(--wine-primary);
	}
}

@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;
	}
}