/**
 * Sacola — painel dropdown (mesmo sistema do header).
 * Não é gaveta lateral nem full-height.
 */

/* Overlay desativado: não escurece a página (mobile nem desktop).
 * Fechar ao tocar fora: handler de clique no document (header.js). */
.ep-side-cart-overlay,
body.ep-side-cart-open .ep-side-cart-overlay,
body.ep-side-cart-open .ep-side-cart-overlay:not([hidden]) {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	background: transparent !important;
}

/* Painel — herda --esmeralda-panel-* e .ashe-wc-dd; posição via JS */
.ep-side-cart,
body.ashe-woocommerce-child #ep-side-cart {
	position: fixed;
	z-index: var(--esmeralda-panel-z, 1300);
	display: none;
	flex-direction: column;
	width: min(360px, calc(100vw - 24px));
	max-height: min(72vh, 560px);
	height: auto;
	top: auto;
	right: auto;
	left: auto;
	bottom: auto;
	margin: 0;
	padding: 0;
	background: var(--esmeralda-panel-bg, #fff);
	border: 1px solid var(--esmeralda-panel-border, #e5e1db);
	border-radius: var(--esmeralda-panel-radius, 0 0 12px 12px);
	border-top: 0;
	box-shadow: var(--esmeralda-panel-shadow);
	transform: none;
	color: var(--esmeralda-panel-text, #2a2a2a);
	font-family: var(--ashe-wc-font-sans, "Open Sans", system-ui, sans-serif);
	overflow: hidden;
	transition: opacity 0.16s ease, transform 0.16s ease;
	transform-origin: top center;
}

.ep-side-cart[hidden] {
	display: none !important;
}

body.ep-side-cart-open .ep-side-cart,
.ep-side-cart.is-open,
.ep-side-cart.ashe-wc-dd--open {
	display: flex !important;
}

/* Não trava scroll da página no desktop */
@media screen and (min-width: 980px) {
	body.ep-side-cart-open {
		overflow: auto;
	}
}

@media screen and (max-width: 979px) {
	body.ep-side-cart-open {
		overflow: hidden;
	}

	.ep-side-cart,
	body.ashe-woocommerce-child #ep-side-cart {
		border-radius: 0 0 14px 14px;
		width: min(100vw - 24px, 400px);
		max-height: min(75vh, 560px);
	}
}

.ep-side-cart__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.65rem 0.5rem 0.55rem 1rem;
	min-height: 48px;
	border-bottom: 1px solid var(--esmeralda-panel-border, #ebe8e4);
	background: var(--esmeralda-panel-bg-head, #faf9f7);
	flex: 0 0 auto;
}

.ep-side-cart__title-wrap {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
}

.ep-side-cart__title {
	margin: 0;
	font-family: var(--ashe-wc-font-sans, "Open Sans", sans-serif);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--esmeralda-panel-muted, #6a6e6c);
}

.ep-side-cart__title-link {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.ep-side-cart__title-link:hover,
.ep-side-cart__title-link:focus-visible {
	color: var(--ashe-wc-moss-deep, #2c3a34);
	border-bottom-color: var(--ashe-wc-gold, #a88c60);
	outline: none;
}

.ep-side-cart__count-label {
	font-size: 0.78rem;
	color: var(--esmeralda-panel-muted, #7a7a7a);
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
}

.ep-side-cart__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #555;
	cursor: pointer;
	border-radius: 50%;
}

.ep-side-cart__close:hover {
	background: #ebe8e4;
	color: #2f4840;
}

.ep-side-cart__close svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.5;
}

.ep-side-cart__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.15rem 0 0.5rem;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	background: var(--esmeralda-panel-bg, #fff);
}

.ep-side-cart__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ep-side-cart__item {
	display: grid;
	grid-template-columns: 56px 1fr auto;
	gap: 0.7rem;
	padding: 0.85rem 1.1rem;
	border-bottom: 1px solid #f2f0ec;
	align-items: start;
}

.ep-side-cart__item-thumb {
	display: block;
	width: 56px;
	height: 56px;
	overflow: hidden;
	background: var(--esmeralda-panel-bg-head, #faf9f7);
	border: 1px solid var(--esmeralda-panel-border, #ebe8e4);
	border-radius: 6px;
}

.ep-side-cart__item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ep-side-cart__item-name {
	display: block;
	margin: 0 0 0.2rem;
	font-family: var(--ashe-wc-font-serif, "Playfair Display", Georgia, serif);
	font-size: 0.95rem;
	font-weight: 400;
	color: var(--esmeralda-panel-text, #2a2a2a);
	text-decoration: none;
	line-height: 1.35;
}

.ep-side-cart__item-name:hover {
	color: #3d5c52;
}

.ep-side-cart__item-meta {
	font-size: 0.72rem;
	color: #7a7a7a;
	margin-bottom: 0.35rem;
}

.ep-side-cart__item-price {
	display: block;
	margin-top: 0.3rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: #2f4840;
}

.ep-side-cart__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #999;
	cursor: pointer;
	border-radius: 6px;
}

.ep-side-cart__remove:hover {
	color: #a00;
	background: #faf0f0;
}

.ep-side-cart__remove svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.5;
}

.ep-side-cart__qty {
	display: inline-flex;
	border: 1px solid #ebe8e4;
	border-radius: 6px;
	overflow: hidden;
}

.ep-side-cart__qty-btn {
	width: 28px;
	border: 0;
	background: #faf9f7;
	color: #2f4840;
	cursor: pointer;
	font-size: 0.95rem;
	line-height: 1;
}

.ep-side-cart__qty-btn:hover {
	background: #e8f0ed;
}

.ep-side-cart__qty-input {
	width: 2.1rem !important;
	border: 0 !important;
	text-align: center;
	font-size: 0.8rem;
	padding: 0.3rem 0 !important;
	background: var(--esmeralda-panel-bg, #fff) !important;
	color: var(--esmeralda-panel-text, #1a1a1a) !important;
	box-shadow: none !important;
	-moz-appearance: textfield;
}

.ep-side-cart__qty-input::-webkit-outer-spin-button,
.ep-side-cart__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ep-side-cart__empty {
	text-align: center;
	padding: 1.75rem 1.25rem 1.5rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 0;
}

.ep-side-cart__empty-ornament {
	width: 28px;
	height: 1px;
	margin: 0 auto 1rem;
	background: #3d5c52;
	opacity: 0.45;
}

.ep-side-cart__empty-title {
	margin: 0 0 0.45rem;
	font-family: var(--ashe-wc-font-serif, "Playfair Display", Georgia, serif);
	font-size: 1.1rem;
	font-weight: 400;
	color: var(--esmeralda-panel-text, #2a2a2a);
}

.ep-side-cart__empty-text {
	margin: 0 0 1.15rem;
	font-size: 0.88rem;
	color: var(--esmeralda-panel-muted, #7a7a7a);
	line-height: 1.5;
}

.ep-side-cart__empty .button {
	background: var(--ashe-wc-accent-deep, #2f4840) !important;
	border-color: var(--ashe-wc-accent-deep, #2f4840) !important;
	color: #fff !important;
	border-radius: 6px !important;
}

body.ashe-woocommerce-child.ashe-dark-mode .ep-side-cart__empty .button {
	background: var(--ashe-dm-accent-deep, #a99174) !important;
	border-color: var(--ashe-dm-accent-deep, #a99174) !important;
	color: #0f1211 !important;
}

body.ashe-woocommerce-child.ashe-dark-mode .ep-side-cart__empty .button:hover {
	background: var(--ashe-dm-accent, #cbb79c) !important;
	border-color: var(--ashe-dm-accent, #cbb79c) !important;
	color: #0f1211 !important;
}

.ep-side-cart__footer {
	flex: 0 0 auto;
	padding: 0.9rem 1.1rem 1.1rem;
	border-top: 1px solid var(--esmeralda-panel-border, #ebe8e4);
	background: var(--esmeralda-panel-bg-head, #faf9f7);
}

.ep-side-cart__subtotal {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.75rem;
}

.ep-side-cart__subtotal-label {
	font-size: 0.75rem;
	color: #7a7a7a;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.ep-side-cart__subtotal-value {
	font-family: "Playfair Display", Georgia, serif;
	font-size: 1.15rem;
	color: #2f4840;
}

.ep-side-cart__view-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin: 0 0 0.55rem;
	padding: 0.7rem 1rem;
	border: 1.5px solid var(--ashe-wc-moss-deep, #2c3a34);
	border-radius: 999px;
	background: transparent;
	color: var(--ashe-wc-moss-deep, #2c3a34) !important;
	font-size: 0.92rem;
	font-weight: 600;
	text-decoration: none !important;
	text-align: center;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	box-sizing: border-box;
}

.ep-side-cart__view-cart:hover,
.ep-side-cart__view-cart:focus-visible {
	background: var(--ashe-wc-moss-soft, #eef2ef);
	color: var(--ashe-wc-moss-deep, #2c3a34) !important;
	border-color: var(--ashe-wc-moss, #455a51);
	outline: none;
}

body.ashe-dark-mode .ep-side-cart__view-cart {
	border-color: rgba(255, 255, 255, 0.45);
	color: #f0ebe3 !important;
}

body.ashe-dark-mode .ep-side-cart__view-cart:hover,
body.ashe-dark-mode .ep-side-cart__view-cart:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.65);
	color: #fff !important;
}

.ep-side-cart__checkout {
	display: block !important;
	width: 100%;
	text-align: center;
	margin-bottom: 0.4rem !important;
	box-sizing: border-box;
	min-height: 44px !important;
	background: #2f4840 !important;
	border: 1px solid #2f4840 !important;
	color: #fff !important;
	border-radius: 6px !important;
	font-weight: 600 !important;
	letter-spacing: 0.04em;
}

.ep-side-cart__checkout:hover {
	background: #3d5c52 !important;
	border-color: #3d5c52 !important;
}

.ep-side-cart__continue {
	display: block;
	width: 100%;
	padding: 0.45rem;
	border: 0;
	background: transparent;
	color: #7a7a7a;
	font-size: 0.82rem;
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.ep-side-cart__continue:hover {
	color: #2f4840;
}

.ep-side-cart__note {
	margin: 0.55rem 0 0;
	font-size: 0.7rem;
	color: #999;
	text-align: center;
	line-height: 1.4;
}

.ep-side-cart.is-loading .ep-side-cart__body {
	opacity: 0.5;
	pointer-events: none;
}

/* Dark */
body.ashe-dark-mode .ep-side-cart {
	background: #1c1f24;
	border-color: #2e3238;
	color: #f3f0ec;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

body.ashe-dark-mode .ep-side-cart__header,
body.ashe-dark-mode .ep-side-cart__footer {
	background: #181a1d;
	border-color: #2e3238;
}

body.ashe-dark-mode .ep-side-cart__title,
body.ashe-dark-mode .ep-side-cart__item-name {
	color: #f3f0ec;
}

body.ashe-dark-mode .ep-side-cart__item {
	border-bottom-color: #2e3238;
}

body.ashe-dark-mode .ep-side-cart__body {
	background: #1c1f24;
}
