/*!
Theme Name: wcellar
Theme URI: http://underscores.me/
Author: Underscores.me
Description: Custom Modern Minimalist European Cellar Theme.
Version: 1.0.1
Text Domain: wcellar
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
1.  Variables
2.  Reset & Global
3.  Layout & Header
4.  WooCommerce Shop (Grid & Layout)
5.  WooCommerce Single Product
6.  Sidebar & Widgets
7.  Mobile Responsiveness
--------------------------------------------------------------*/

:root {
	--color-bg: #FFFFFF;
	--color-text: #333333;
	--color-heading: #000000;
	--color-accent: #800020;
	/* Deep Burgundy */
	--color-border: #EEEEEE;
	--color-grey-light: #F5F5F5;
	--font-heading: 'Montserrat', sans-serif;
	--font-body: 'Noto Sans KR', sans-serif;
}

/*--------------------------------------------------------------
# 2. Reset & Global
--------------------------------------------------------------*/
html {
	box-sizing: border-box;
}

*,
*:before,
*:after {
	box-sizing: inherit;
}

body {
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: 15px;
	line-height: 1.7;
	margin: 0;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	margin-top: 0;
}

a {
	color: var(--color-text);
	text-decoration: none;
	transition: color 0.3s ease;
}

a:hover {
	color: var(--color-accent);
}

/* Buttons (Global) */
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button {
	background-color: #000;
	color: #fff;
	border: none;
	border-radius: 0;
	padding: 12px 24px;
	font-family: var(--font-heading);
	font-weight: 700;
	text-transform: uppercase;
	font-size: 12px;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

button:hover,
input[type="button"]:hover,
.button:hover {
	background-color: var(--color-accent);
	color: #fff;
}

/*--------------------------------------------------------------
# 3. Layout & Header
--------------------------------------------------------------*/
.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-content {
	flex: 1;
	padding: 3rem 20px;
	max-width: 1300px;
	/* 넓은 화면 */
	margin: 0 auto;
	width: 100%;
}

/* Utility Bar */
.utility-bar {
	background-color: #000;
	padding: 10px 40px;
}

.utility-bar-inner {
	max-width: 1300px;
	margin: 0 auto;
	display: flex;
	justify-content: flex-end;
}

.utility-menu {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 20px;
	align-items: center;
}

.utility-item {
	margin: 0;
	padding: 0;
	border: none;
}

.utility-link {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: none;
	border: none;
	padding: 5px;
	cursor: pointer;
	transition: color 0.2s ease;
	position: relative;
}

.utility-link:hover {
	color: var(--color-accent);
}

.utility-link svg {
	display: block;
}

.cart-count {
	position: absolute;
	top: -5px;
	right: -8px;
	background-color: var(--color-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	min-width: 16px;
	height: 16px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-heading);
}

/* Search Modal */
.search-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.95);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.search-modal-inner {
	width: 100%;
	max-width: 600px;
	padding: 20px;
	position: relative;
}

.search-modal-form {
	display: flex;
	border-bottom: 2px solid #fff;
}

.search-modal-input {
	flex: 1;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 24px;
	font-family: var(--font-body);
	padding: 15px 0;
	outline: none;
}

.search-modal-input::placeholder {
	color: rgba(255, 255, 255, 0.5);
}

.search-modal-submit {
	background: transparent;
	border: none;
	color: #fff;
	padding: 15px;
	cursor: pointer;
	transition: color 0.2s ease;
}

.search-modal-submit:hover {
	color: var(--color-accent);
}

.search-modal-close {
	position: absolute;
	top: -60px;
	right: 20px;
	background: transparent;
	border: none;
	color: #fff;
	padding: 10px;
	cursor: pointer;
	transition: color 0.2s ease;
}

.search-modal-close:hover {
	color: var(--color-accent);
}

/* Main Header */
.site-header {
	padding: 20px 40px;
	border-bottom: 1px solid var(--color-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.site-branding .site-title a {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 24px;
	color: #000;
	text-decoration: none;
}

/* Main Navigation */
.main-navigation {
	position: relative;
}

.main-navigation ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 30px;
}

.main-navigation li {
	position: relative;
}

.main-navigation a {
	font-family: var(--font-heading);
	font-size: 13px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 1px;
	padding: 10px 0;
	display: block;
}

/* Dropdown Submenu */
.main-navigation ul ul {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: row;
	gap: 0;
	background-color: #fff;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	padding: 15px 10px;
	min-width: max-content;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	z-index: 1000;
}

.main-navigation ul ul li {
	white-space: nowrap;
}

.main-navigation ul ul a {
	padding: 8px 15px;
	font-size: 12px;
	font-weight: 400;
	color: var(--color-text);
	transition: color 0.2s ease;
}

.main-navigation ul ul a:hover {
	color: var(--color-accent);
}

/* Show dropdown on hover */
.main-navigation li:hover > ul,
.main-navigation li.focus > ul {
	opacity: 1;
	visibility: visible;
}

/* Dropdown indicator arrow */
.main-navigation .menu-item-has-children > a::after {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 6px;
	vertical-align: middle;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 4px solid currentColor;
}

/* Hide menu toggle on desktop */
.main-navigation .menu-toggle {
	display: none;
}

/*--------------------------------------------------------------
# 4. WooCommerce Shop (Grid & Layout)
--------------------------------------------------------------*/
/* 2-Column Layout for Desktop (Sidebar Left / Grid Right) */
@media (min-width: 992px) {

	.woocommerce.archive .site-content,
	.tax-product_cat .site-content,
	.tax-product_tag .site-content {
		display: grid;
		grid-template-columns: 260px 1fr;
		/* Sidebar width fixed */
		gap: 50px;
	}

	.woocommerce.archive #secondary,
	.tax-product_cat #secondary,
	.tax-product_tag #secondary {
		grid-column: 1 / 2;
		grid-row: 1 / 2;
		display: block !important;
	}

	.woocommerce.archive #primary,
	.tax-product_cat #primary,
	.tax-product_tag #primary {
		grid-column: 2 / 3;
		width: 100%;
	}
}

/* Product Grid */
ul.products {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px;
	margin: 0;
}

ul.products li.product {
	text-align: center;
	list-style: none;
	width: 100% !important;
	/* Override Woo default */
	margin: 0 !important;
}

/* Product Card Design (Minimalist) */
ul.products li.product img {
	width: 100%;
	height: auto;
	object-fit: cover;
	/* 와인병 비율 유지 */
	margin-bottom: 20px;
}

ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--font-heading);
	font-size: 13px;
	padding-top: 5px;
	color: #000;
}

ul.products li.product .price {
	font-family: var(--font-heading);
	font-size: 14px;
	color: #666;
	display: block;
	margin-bottom: 10px;
	font-weight: 500;
}

/* 'Add to Cart' as Text Link Style */
ul.products li.product .button {
	background: transparent;
	color: #000;
	padding: 0 0 2px 0;
	border-bottom: 1px solid #000;
}

ul.products li.product .button:hover {
	background: transparent;
	color: var(--color-accent);
	border-bottom-color: var(--color-accent);
}

/*--------------------------------------------------------------
# 5. WooCommerce Single Product
--------------------------------------------------------------*/
.single-product div.product {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 60px;
}

.single-product .product_title {
	font-size: 32px;
	margin-bottom: 10px;
}

.single-product p.price {
	font-size: 20px;
	color: var(--color-text);
	margin-bottom: 30px;
	font-family: var(--font-heading);
}

/* Taste Graph Styling */
.wcellar-taste-graph {
	margin: 30px 0;
	padding: 20px;
	background-color: #fafafa;
	border-radius: 4px;
}

.taste-bar-wrapper {
	margin-bottom: 15px;
}

.taste-label {
	font-size: 12px;
	font-weight: 700;
	display: block;
	margin-bottom: 5px;
	font-family: var(--font-heading);
}

.taste-bar-container {
	height: 6px;
	background-color: #e0e0e0;
	width: 100%;
	border-radius: 3px;
}

.taste-bar-fill {
	height: 100%;
	background-color: var(--color-accent);
	border-radius: 3px;
}

/* Other Vintages Links */
.other-vintages-section .vintage-link {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #ddd;
	font-size: 12px;
	color: #333;
	transition: all 0.2s;
}

.other-vintages-section .vintage-link:hover {
	border-color: var(--color-accent);
	color: var(--color-accent);
}

/*--------------------------------------------------------------
# 6. Sidebar & Widgets
--------------------------------------------------------------*/
/* Hide sidebar on pages except Shop/Archive/Product Categories */
body:not(.woocommerce) #secondary,
body.single-product #secondary {
	display: none;
}

#secondary .widget {
	margin-bottom: 40px;
}

#secondary .widget-title {
	font-family: var(--font-heading);
	font-size: 14px;
	border-bottom: 2px solid #000;
	padding-bottom: 10px;
	margin-bottom: 20px;
}

#secondary ul li {
	padding: 8px 0;
	border-bottom: 1px solid var(--color-grey-light);
	display: flex;
	justify-content: space-between;
	font-size: 14px;
}

#secondary ul li a:hover {
	color: var(--color-accent);
}

/*--------------------------------------------------------------
# 7. WCellar ACF Filters
--------------------------------------------------------------*/
.wcellar-filter-form {
	padding: 0;
}

.wcellar-filter-section {
	margin-bottom: 30px;
}

.wcellar-filter-title {
	font-family: var(--font-heading);
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	border-bottom: 2px solid #333;
	padding-bottom: 10px;
	margin-bottom: 15px;
	margin-top: 0;
}

.wcellar-filter-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wcellar-filter-item {
	padding: 0;
	border-bottom: 1px solid var(--color-grey-light);
}

.wcellar-filter-label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	cursor: pointer;
	font-size: 14px;
	transition: color 0.2s ease;
}

.wcellar-filter-label:hover {
	color: var(--color-accent);
}

.wcellar-filter-label input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--color-accent);
	cursor: pointer;
	flex-shrink: 0;
}

.wcellar-filter-text {
	flex: 1;
}

/* Range Filter */
.wcellar-range-filter {
	padding: 5px 0;
}

.wcellar-range-inputs {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.wcellar-range-select {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid var(--color-border);
	background: #fff;
	font-family: var(--font-body);
	font-size: 14px;
	cursor: pointer;
}

.wcellar-range-select:focus {
	outline: none;
	border-color: var(--color-accent);
}

.wcellar-range-separator {
	color: #999;
	font-size: 12px;
}

.wcellar-range-labels {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: #999;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Filter Actions */
.wcellar-filter-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 25px;
	padding-top: 20px;
	border-top: 1px solid var(--color-border);
}

.wcellar-filter-submit {
	width: 100%;
	padding: 14px 20px;
	font-size: 12px;
}

.wcellar-filter-reset {
	display: block;
	text-align: center;
	font-family: var(--font-heading);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #999;
	padding: 8px;
}

.wcellar-filter-reset:hover {
	color: var(--color-accent);
}

/* Mobile Filter Toggle */
.wcellar-mobile-filter-toggle {
	display: none;
	width: 100%;
	padding: 14px 20px;
	margin-bottom: 20px;
	background: #000;
	color: #fff;
	border: none;
	font-family: var(--font-heading);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	cursor: pointer;
}

.wcellar-mobile-filter-toggle:hover {
	background: var(--color-accent);
}

/*--------------------------------------------------------------
# 8. Mobile Responsiveness
--------------------------------------------------------------*/
@media (max-width: 991px) {

	/* Mobile Utility Bar */
	.utility-bar {
		padding: 10px 20px;
	}

	/* Mobile Header */
	.site-header {
		flex-direction: column;
		gap: 15px;
		padding: 15px 20px;
	}

	/* Mobile Navigation */
	.main-navigation .menu-toggle {
		display: block;
		background: transparent;
		color: #000;
		padding: 8px 0;
		font-size: 14px;
	}

	.main-navigation ul {
		display: none;
		flex-direction: column;
		width: 100%;
		gap: 0;
		text-align: center;
	}

	.main-navigation.toggled ul {
		display: flex;
	}

	.main-navigation li {
		border-bottom: 1px solid var(--color-border);
	}

	.main-navigation a {
		padding: 12px 0;
	}

	/* Mobile Dropdown */
	.main-navigation ul ul {
		position: static;
		transform: none;
		box-shadow: none;
		background-color: var(--color-grey-light);
		padding: 0;
		opacity: 1;
		visibility: visible;
		flex-direction: column;
	}

	.main-navigation ul ul a {
		padding: 10px 20px;
	}

	.main-navigation .menu-item-has-children > a::after {
		display: none;
	}

	/* Mobile Shop Layout (Stack) */
	.woocommerce.archive .site-content,
	.tax-product_cat .site-content,
	.tax-product_tag .site-content {
		display: block;
	}

	/* Product Grid: 1 or 2 col on mobile */
	ul.products {
		grid-template-columns: 1fr 1fr;
		gap: 20px;
	}

	/* Sidebar logic for mobile */
	.woocommerce.archive #secondary,
	.tax-product_cat #secondary,
	.tax-product_tag #secondary {
		margin-bottom: 40px;
		border-bottom: 1px solid #eee;
		padding-bottom: 20px;
	}

	/* Mobile Filter Toggle */
	.wcellar-mobile-filter-toggle {
		display: block;
	}

	.wcellar-filter-form {
		display: none;
		padding-top: 20px;
	}

	.wcellar-filter-form.is-open {
		display: block;
	}

	/* Single Product Stack */
	.single-product div.product {
		grid-template-columns: 1fr;
	}
}