/* ─── EcoClean Cart Page + Checkout ──────────────────────────────
   File: assets/css/ec-cart.css
   Uses the same CSS custom properties defined in the theme's main
   stylesheet. Load AFTER the main theme stylesheet so the variables are
   in scope.

   July 2026: the old slide-out drawer is retired in favor of a dedicated
   /cart/ page (see class-ecz-cart-page.php + ec-cart.js). .ec-checkout-form
   and .ec-cart-empty are kept as-is below — they're shared with the auth
   pages (login/register/profile forms, empty orders/wishlist states) and
   are still very much in use there. */

.ec-cart-empty {
	color: var(--bronze-deep);
	font-size: 14px;
	font-weight: 300;
	text-align: center;
	margin-top: var(--s7);
}

.ec-checkout-form {
	display: flex;
	flex-direction: column;
	gap: var(--s4);
}
.ec-checkout-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-family: var(--fm);
	font-size: 10px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--bronze-deep);
}
.ec-checkout-form input,
.ec-checkout-form select,
.ec-checkout-form textarea {
	font-family: var(--fb);
	font-size: 14px;
	font-weight: 300;
	color: var(--bark);
	padding: 12px 14px;
	border: 1.5px solid var(--caramel-dk);
	border-radius: var(--r-md);
	background: #fff;
	outline: none;
	transition: border-color .2s, box-shadow .2s;
	resize: vertical;
}
.ec-checkout-form input:focus,
.ec-checkout-form select:focus,
.ec-checkout-form textarea:focus {
	border-color: var(--gold);
	box-shadow: 0 0 0 3px rgba(196,154,60,.12);
}
.ec-checkout-error {
	background: rgba(227,83,54,.1);
	border: 1px solid var(--ember);
	color: var(--bronze-deep);
	font-size: 13px;
	padding: var(--s3) var(--s4);
	border-radius: var(--r-md);
}

/* ─── Cart Page (noon-style two column) ──────────────────────── */

.ec-cart-page-section { padding: var(--s7) 0 var(--s9); }

.ec-cartpage-empty {
	text-align: center;
	padding: var(--s9) var(--s5);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--s5);
}
.ec-cartpage-empty p {
	font-family: var(--fd);
	font-size: 18px;
	font-style: italic;
	color: var(--bronze-deep);
}

.ec-cartpage-grid {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: var(--s6);
	align-items: start;
}

.ec-cartpage-items {
	background: var(--cream);
	border: 1px solid var(--caramel-dk);
	border-radius: var(--r-xl);
	padding: var(--s5);
}
.ec-cartpage-items-head {
	font-family: var(--fd);
	font-size: 18px;
	color: var(--bark-deep);
	padding-bottom: var(--s4);
	border-bottom: 1px solid var(--caramel);
	margin-bottom: var(--s4);
}

.ec-cartpage-freebar {
	background: rgba(255,165,125,.14);
	border: 1px solid var(--caramel-dk);
	border-radius: var(--r-md);
	padding: var(--s3) var(--s4);
	margin-bottom: var(--s4);
	font-family: var(--fm);
	font-size: 11px;
	letter-spacing: .03em;
	color: var(--bronze-deep);
}
.ec-cartpage-freebar--done {
	background: rgba(74,92,46,.1);
	color: var(--sage);
}
.ec-cartpage-freebar-track {
	height: 4px;
	background: var(--caramel);
	border-radius: var(--r-pill);
	margin-top: var(--s2);
	overflow: hidden;
}
.ec-cartpage-freebar-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--gold-deep), var(--gold-warm));
	transition: width .3s ease;
}

.ec-cartpage-line {
	display: grid;
	grid-template-columns: 72px 1fr auto auto auto;
	align-items: center;
	gap: var(--s4);
	padding: var(--s4) 0;
	border-bottom: 1px solid var(--caramel);
}
.ec-cartpage-line:last-child { border-bottom: none; padding-bottom: 0; }

.ec-cartpage-thumb {
	width: 72px; height: 72px;
	border-radius: var(--r-md);
	background: linear-gradient(160deg, var(--caramel-lt), var(--caramel));
	border: 1px solid var(--caramel-dk);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
}
.ec-cartpage-thumb-img { width: 100%; height: 100%; object-fit: cover; }
.ec-cartpage-thumb-icon { font-size: 30px; }

.ec-cartpage-line-name {
	font-family: var(--fd);
	font-size: 15px;
	color: var(--bark-deep);
	line-height: 1.3;
}
.ec-cartpage-line-sku {
	font-family: var(--fm);
	font-size: 10px;
	color: var(--sand);
	margin-top: 2px;
}
.ec-cartpage-line-price {
	font-family: var(--fb);
	font-size: 12px;
	font-weight: 300;
	color: var(--bronze-deep);
	margin-top: 4px;
}

/* Bigger, clearer qty stepper than the old drawer's 24px circles */
.ec-cartpage-line-qty {
	display: flex;
	align-items: center;
	border: 1.5px solid var(--caramel-dk);
	border-radius: var(--r-pill);
	overflow: hidden;
	flex-shrink: 0;
}
.ec-cartpage-line-qty button {
	width: 34px; height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	color: var(--bronze-deep);
	background: var(--caramel-lt);
	transition: all .2s;
}
.ec-cartpage-line-qty button:hover { background: var(--gold); color: var(--bark-deep); }
.ec-cartpage-line-qty span {
	width: 32px;
	text-align: center;
	font-family: var(--fm);
	font-size: 13px;
	color: var(--bark-deep);
}

.ec-cartpage-line-total {
	font-family: var(--fd);
	font-size: 16px;
	font-weight: 500;
	color: var(--bark-deep);
	min-width: 80px;
	text-align: right;
}

.ec-cartpage-remove {
	width: 32px; height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	color: var(--sand);
	transition: all .2s;
	flex-shrink: 0;
}
.ec-cartpage-remove:hover { color: #fff; background: var(--ember); }

/* Order summary panel */
.ec-cartpage-summary {
	background: var(--cream);
	border: 1px solid var(--caramel-dk);
	border-radius: var(--r-xl);
	padding: var(--s5);
	position: sticky;
	top: calc(64px + var(--s5));
}
.ec-summary-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s3);
	margin-bottom: var(--s4);
	padding-bottom: var(--s4);
	border-bottom: 1px solid var(--caramel);
}
.ec-cartpage-summary h3 {
	font-family: var(--fd);
	font-size: 18px;
	font-weight: 400;
	color: var(--bark-deep);
	margin: 0;
}
.ec-summary-account-link {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: var(--fm);
	font-size: 10px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--bronze-deep);
	transition: color .2s;
	flex-shrink: 0;
}
.ec-summary-account-link:hover { color: var(--gold-deep); }
.ec-summary-account-icon { font-size: 14px; line-height: 1; }
.ec-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: var(--s3);
}
.ec-summary-row span {
	font-family: var(--fb);
	font-size: 13px;
	font-weight: 300;
	color: var(--bronze-deep);
}
.ec-summary-row strong {
	font-family: var(--fm);
	font-size: 13px;
	font-weight: 400;
	color: var(--bark-deep);
}
.ec-summary-total {
	padding-top: var(--s3);
	margin-top: var(--s2);
	border-top: 1px solid var(--caramel-dk);
}
.ec-summary-total strong {
	font-family: var(--fd);
	font-size: 22px;
	font-weight: 500;
	background: linear-gradient(135deg, var(--gold-deep), var(--gold-warm));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

#ecCartPageAction { margin-top: var(--s5); }
.ec-cartpage-signin-note {
	font-size: 13px;
	font-weight: 300;
	color: var(--bronze-deep);
	line-height: 1.6;
	margin-bottom: var(--s4);
}

.ec-cartpage-placed { text-align: center; }
.ec-cartpage-placed-title {
	font-family: var(--fd);
	font-size: 18px;
	font-style: italic;
	color: var(--bark-deep);
	margin-bottom: var(--s2);
}
.ec-cartpage-placed-sub {
	font-size: 13px;
	font-weight: 300;
	color: var(--bronze-deep);
	line-height: 1.6;
	margin-bottom: var(--s4);
}

@media (max-width: 900px) {
	.ec-cartpage-grid { grid-template-columns: 1fr; }
	.ec-cartpage-summary { position: static; }
	.ec-cartpage-line {
		grid-template-columns: 56px 1fr auto;
		grid-template-areas:
			"thumb info remove"
			"thumb qty total";
		row-gap: var(--s3);
	}
	.ec-cartpage-thumb { grid-area: thumb; width: 56px; height: 56px; }
	.ec-cartpage-line-info { grid-area: info; }
	.ec-cartpage-remove { grid-area: remove; justify-self: end; }
	.ec-cartpage-line-qty { grid-area: qty; justify-self: start; }
	.ec-cartpage-line-total { grid-area: total; justify-self: end; }
}

/* ─── Account Dashboard (left sidebar) ───────────────────────── */

/* Own section class, deliberately not sharing anything with
   .ec-auth-section/.ec-auth-wrap (the narrow centered login/register form
   styling) — that's what was causing the sidebar to visibly shift position
   between tabs before. */
.ec-account-section { padding: var(--s7) 0 var(--s9); }

.ec-account-layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: var(--s6);
	align-items: start;
	width: 100%;
}

.ec-account-sidebar {
	background: var(--cream);
	border: 1px solid var(--caramel-dk);
	border-radius: var(--r-xl);
	padding: var(--s5);
	display: flex;
	flex-direction: column;
	gap: var(--s5);
	position: sticky;
	top: calc(64px + var(--s5));
}

.ec-account-sidebar-user {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: var(--s2);
	padding-bottom: var(--s5);
	border-bottom: 1px solid var(--caramel);
}
.ec-account-avatar {
	width: 56px; height: 56px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--gold-deep), var(--gold-warm));
	color: var(--bark-deep);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--fd);
	font-size: 22px;
	font-weight: 500;
}
.ec-account-sidebar-name {
	font-family: var(--fd);
	font-size: 15px;
	color: var(--bark-deep);
}
.ec-account-sidebar-email {
	font-family: var(--fm);
	font-size: 10px;
	color: var(--sand);
	word-break: break-all;
}

.ec-account-sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: var(--s2);
}
.ec-account-sidebar-nav a {
	display: flex;
	align-items: center;
	gap: var(--s3);
	padding: var(--s3) var(--s4);
	border-radius: var(--r-md);
	font-family: var(--fm);
	font-size: 11px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--bronze-deep);
	transition: all .2s;
}
.ec-account-sidebar-nav a:hover { background: rgba(196,154,60,.08); color: var(--gold-deep); }
.ec-account-sidebar-nav a.active {
	background: linear-gradient(135deg, var(--gold-deep), var(--gold-warm));
	color: var(--bark-deep);
}
.ec-account-nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.ec-account-logout { width: 100%; justify-content: center; }

.ec-account-content { min-width: 0; }
.ec-account-content .section-title { margin-bottom: var(--s5); }

/* Guest visitors on /cart/ have no sidebar (no account yet) — drop to a
   single column instead of leaving an empty 260px gap where it'd sit. */
.ec-account-layout--no-sidebar { grid-template-columns: 1fr; }

/* Smooth, jump-free switching between Orders/Wishlist/Profile/Security.
   The sidebar is never touched by this — only these panes animate. */
.ec-account-view[hidden] { display: none !important; }
.ec-account-view--in { animation: ecViewFadeIn .35s cubic-bezier(.16,1,.3,1); }
.ec-account-content[data-ec-account-content] { animation: ecViewFadeIn .4s cubic-bezier(.16,1,.3,1); }
@keyframes ecViewFadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
	.ec-account-view--in, .ec-account-content[data-ec-account-content] { animation: none; }
}

@media (max-width: 800px) {
	.ec-account-layout { grid-template-columns: 1fr; }
	.ec-account-sidebar { position: static; }
	.ec-account-sidebar-nav { flex-direction: row; flex-wrap: wrap; }
	.ec-account-sidebar-nav a { flex: 1 1 auto; justify-content: center; }
}
