/**
 * Custom Order Page – /paraggelia/
 *
 * All styles scoped under .ce-order-page to avoid
 * collisions with Woodmart's own stylesheets.
 *
 * Color palette derived from Woodmart's warm tones:
 *   --ce-accent:   #c8851e  (warm amber / CTA)
 *   --ce-accent-h: #b5750f  (hover shade)
 *   --ce-bg:       #faf8f5  (warm off-white page bg)
 *   --ce-card-bg:  #ffffff
 *   --ce-border:   #e8e2d9  (warm grey border)
 *   --ce-text:     #333333
 *   --ce-muted:    #888888
 *
 * Breakpoints:
 *   1024px  — desktop → tablet  (sidebar stacks below)
 *    768px  — tablet → mobile   (grid 2-col)
 *    480px  — small mobile      (grid 1-col)
 *
 * @package woodmart-child
 */

/* ═══════════════════════════════════════════════════════════
   CSS Custom Properties
   ═══════════════════════════════════════════════════════════ */
.ce-order-page {
	--ce-accent:   #c8851e;
	--ce-accent-h: #b5750f;
	--ce-accent-10: rgba(200, 133, 30, 0.10);
	--ce-accent-15: rgba(200, 133, 30, 0.15);
	--ce-bg:       #faf8f5;
	--ce-card-bg:  #ffffff;
	--ce-border:   #e8e2d9;
	--ce-text:     #333333;
	--ce-muted:    #888888;
	--ce-danger:   #d04040;
	--ce-success:  #2e8b57;
	--ce-radius:   8px;
	--ce-radius-sm: 6px;
	--ce-shadow:   0 2px 8px rgba(0,0,0,.06);
	--ce-shadow-lg: 0 4px 20px rgba(0,0,0,.10);
	--ce-transition: 0.2s ease;
}


/* ═══════════════════════════════════════════════════════════
   Page container
   ═══════════════════════════════════════════════════════════ */
.ce-order-page {
	min-height: 60vh;
	padding-bottom: 3rem;
	color: var(--ce-text);
}

/* Remove Woodmart page title spacing if needed */
.ce-content-area {
	width: 100%;
}


/* ═══════════════════════════════════════════════════════════
   Section 1: Instructions banner
   ═══════════════════════════════════════════════════════════ */
.ce-instructions {
	background: var(--ce-accent-10);
	border-left: 4px solid var(--ce-accent);
	border-radius: var(--ce-radius-sm);
	padding: 0.875rem 1.25rem;
	margin-bottom: 1.75rem;
}

.ce-instructions p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--ce-text);
}


/* ═══════════════════════════════════════════════════════════
   Section 2: Category cards
   ═══════════════════════════════════════════════════════════ */
.ce-categories {
	display: flex;
	gap: 0.75rem;
	padding: 0 0 1.25rem;
	margin-bottom: 1rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--ce-border) transparent;
}

/* Hide scrollbar on WebKit but keep functionality */
.ce-categories::-webkit-scrollbar {
	height: 4px;
}
.ce-categories::-webkit-scrollbar-thumb {
	background: var(--ce-border);
	border-radius: 2px;
}

.ce-cat-card {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	min-width: 110px;
	padding: 0.875rem 1rem;
	background: var(--ce-card-bg);
	border: 2px solid var(--ce-border);
	border-radius: var(--ce-radius);
	cursor: pointer;
	transition: border-color var(--ce-transition),
	            box-shadow var(--ce-transition),
	            transform var(--ce-transition);
	text-align: center;
	-webkit-appearance: none;
	appearance: none;
	font-family: inherit;
}

.ce-cat-card:hover {
	border-color: var(--ce-accent);
	box-shadow: var(--ce-shadow);
	transform: translateY(-1px);
}

.ce-cat-card.ce-active {
	border-color: var(--ce-accent);
	background: var(--ce-accent-10);
	box-shadow: 0 0 0 1px var(--ce-accent), var(--ce-shadow);
}

.ce-cat-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	overflow: hidden;
	background: #f5f0eb;
}

.ce-cat-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ce-cat-card__name {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--ce-text);
	line-height: 1.25;
	max-width: 110px;
	word-wrap: break-word;
}


/* ═══════════════════════════════════════════════════════════
   Section 3: Service tabs
   ═══════════════════════════════════════════════════════════ */
.ce-services {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.ce-service-tab {
	padding: 0.5rem 1.25rem;
	border: 2px solid var(--ce-border);
	border-radius: 100px;          /* pill shape */
	background: var(--ce-card-bg);
	color: var(--ce-text);
	font-size: 0.85rem;
	font-weight: 600;
	font-family: inherit;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	cursor: pointer;
	transition: all var(--ce-transition);
	-webkit-appearance: none;
	appearance: none;
}

.ce-service-tab:hover {
	border-color: var(--ce-accent);
	color: var(--ce-accent);
}

.ce-service-tab.ce-active {
	background: var(--ce-accent);
	border-color: var(--ce-accent);
	color: #ffffff;
}


/* ═══════════════════════════════════════════════════════════
   Section 4: Main layout — products + cart sidebar
   ═══════════════════════════════════════════════════════════ */
.ce-main {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 2rem;
	align-items: start;
}


/* ─── Product area ──────────────────────────────────────── */
.ce-products {
	min-height: 200px;
}

.ce-products__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	transition: opacity 0.2s ease;
}

/* Loading spinner */
.ce-products__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 3rem 0;
}

.ce-products__loading[hidden] {
	display: none;
}

.ce-products__loading-text {
	font-size: 0.88rem;
	color: var(--ce-muted);
	font-weight: 500;
}

.ce-spinner {
	display: inline-block;
	width: 32px;
	height: 32px;
	border: 3px solid var(--ce-border);
	border-top-color: var(--ce-accent);
	border-radius: 50%;
	animation: ce-spin 0.7s linear infinite;
}

@keyframes ce-spin {
	to { transform: rotate(360deg); }
}

.ce-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Empty state */
.ce-products__empty,
.ce-products__empty-text {
	text-align: center;
	padding: 2.5rem 1rem;
	color: var(--ce-muted);
	font-size: 0.95rem;
}

.ce-products__empty[hidden] {
	display: none;
}

.ce-products__empty p,
.ce-products__empty-text {
	margin: 0;
}

.ce-products__empty::before {
	content: '';
	display: block;
	width: 48px;
	height: 48px;
	margin: 0 auto 0.75rem;
	background: var(--ce-border);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") center / contain no-repeat;
	opacity: 0.5;
}

.ce-empty-notice {
	color: var(--ce-muted);
	font-size: 0.9rem;
}


/* ═══════════════════════════════════════════════════════════
   Product cards
   ═══════════════════════════════════════════════════════════ */
.ce-product-card {
	display: flex;
	flex-direction: column;
	background: var(--ce-card-bg);
	border: 1px solid var(--ce-border);
	border-radius: var(--ce-radius);
	overflow: hidden;
	transition: box-shadow var(--ce-transition);
}

.ce-product-card:hover {
	box-shadow: var(--ce-shadow);
}

.ce-product-card__name {
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--ce-text);
	padding: 0.75rem 0.75rem 0.25rem;
	margin: 0;
	line-height: 1.3;
	min-height: 2.2em;
}

.ce-product-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem;
	background: #faf8f5;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.ce-product-card__image img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;   /* removes white bg on product photos */
}

/* ─── Quantity controls ─────────────────────────────────── */
.ce-product-card__quantity {
	display: flex;
	align-items: center;
	gap: 0;
	padding: 0 0.75rem;
	margin: 0.25rem 0;
}

.ce-product-card__qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 1px solid var(--ce-border);
	background: var(--ce-card-bg);
	border-radius: var(--ce-radius-sm);
	font-size: 1rem;
	font-weight: 600;
	color: var(--ce-text);
	cursor: pointer;
	transition: all var(--ce-transition);
	-webkit-appearance: none;
	appearance: none;
	font-family: inherit;
	line-height: 1;
	padding: 0;
}

.ce-product-card__qty-btn:hover {
	border-color: var(--ce-accent);
	color: var(--ce-accent);
	background: var(--ce-accent-10);
}

.ce-product-card__qty-btn:active {
	transform: scale(0.92);
}

.ce-product-card__qty-input {
	width: 38px;
	height: 30px;
	text-align: center;
	border: 1px solid var(--ce-border);
	border-left: none;
	border-right: none;
	font-size: 0.85rem;
	font-weight: 600;
	font-family: inherit;
	color: var(--ce-text);
	background: transparent;
	-moz-appearance: textfield;
	outline: none;
}

.ce-product-card__qty-input::-webkit-outer-spin-button,
.ce-product-card__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ce-product-card__qty-input:focus {
	border-color: var(--ce-accent);
}

/* ─── Footer: price + add button ────────────────────────── */
.ce-product-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0.75rem 0.75rem;
	margin-top: auto;
}

.ce-product-card__price {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--ce-accent);
}

.ce-product-card__price del {
	color: var(--ce-muted);
	font-weight: 400;
	font-size: 0.8rem;
}

.ce-product-card__price ins {
	text-decoration: none;
}

.ce-product-card__add-btn {
	padding: 0.45rem 0.9rem;
	background: var(--ce-accent);
	color: #ffffff;
	border: 2px solid var(--ce-accent);
	border-radius: var(--ce-radius-sm);
	font-size: 0.78rem;
	font-weight: 700;
	font-family: inherit;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	cursor: pointer;
	transition: all var(--ce-transition);
	-webkit-appearance: none;
	appearance: none;
	white-space: nowrap;
}

.ce-product-card__add-btn:hover {
	background: var(--ce-accent-h);
	border-color: var(--ce-accent-h);
}

.ce-product-card__add-btn:active {
	transform: scale(0.96);
}

/* Loading state — inline spinner */
.ce-product-card__add-btn.ce-btn-loading {
	pointer-events: none;
	position: relative;
	color: transparent;
}

.ce-product-card__add-btn.ce-btn-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba(255,255,255,0.35);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: ce-spin 0.6s linear infinite;
}

/* Success flash */
.ce-product-card__add-btn.ce-btn-success {
	background: var(--ce-success);
	border-color: var(--ce-success);
	animation: ce-pop 0.3s ease;
}

@keyframes ce-pop {
	0%   { transform: scale(0.95); }
	50%  { transform: scale(1.05); }
	100% { transform: scale(1); }
}


/* ═══════════════════════════════════════════════════════════
   Cart sidebar
   ═══════════════════════════════════════════════════════════ */
.ce-cart-sidebar {
	position: sticky;
	top: 100px;              /* below Woodmart sticky header */
	background: var(--ce-card-bg);
	border: 1px solid var(--ce-border);
	border-radius: var(--ce-radius);
	box-shadow: var(--ce-shadow);
	overflow: hidden;
}

.ce-cart-sidebar__title {
	margin: 0;
	padding: 1rem 1.25rem;
	font-size: 0.9rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #ffffff;
	background: var(--ce-accent);
}

.ce-cart-sidebar__content {
	padding: 0;
}

/* ─── Cart items list ───────────────────────────────────── */
.ce-cart-sidebar__items {
	padding: 0.75rem 1.25rem;
	max-height: 280px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--ce-border) transparent;
}

.ce-cart-sidebar__items::-webkit-scrollbar {
	width: 4px;
}
.ce-cart-sidebar__items::-webkit-scrollbar-thumb {
	background: var(--ce-border);
	border-radius: 2px;
}

.ce-cart-sidebar__empty-msg {
	color: var(--ce-muted);
	font-size: 0.88rem;
	text-align: center;
	padding: 1.5rem 0 1rem;
	margin: 0;
}

.ce-cart-sidebar__empty-msg::before {
	content: '';
	display: block;
	width: 40px;
	height: 40px;
	margin: 0 auto 0.5rem;
	background: var(--ce-border);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z'/%3E%3C/svg%3E") center / contain no-repeat;
	opacity: 0.45;
}

.ce-cart-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--ce-border);
	gap: 0.5rem;
	transition: opacity 0.2s ease;
}

/* ─── Remove button ────────────────────────────────────── */
.ce-cart-item__remove {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	padding: 0;
	border: none;
	background: var(--ce-border);
	color: var(--ce-muted);
	border-radius: 50%;
	font-size: 0.7rem;
	line-height: 18px;
	text-align: center;
	cursor: pointer;
	transition: all var(--ce-transition);
	-webkit-appearance: none;
	appearance: none;
}

.ce-cart-item__remove:hover {
	background: var(--ce-danger);
	color: #ffffff;
}

.ce-cart-item:last-child {
	border-bottom: none;
}

.ce-cart-item__name {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--ce-text);
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ce-cart-item__meta {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-shrink: 0;
}

.ce-cart-item__qty {
	font-size: 0.78rem;
	color: var(--ce-muted);
	font-weight: 500;
}

.ce-cart-item__price {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--ce-accent);
}

/* ─── Totals ────────────────────────────────────────────── */
.ce-cart-sidebar__totals {
	padding: 0.75rem 1.25rem;
	border-top: 2px solid var(--ce-border);
}

.ce-cart-sidebar__total-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ce-cart-sidebar__total-label {
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ce-text);
}

.ce-cart-sidebar__total-amount {
	font-size: 1rem;
	font-weight: 700;
	color: var(--ce-accent);
}

/* ─── Minimum order notice ──────────────────────────────── */
.ce-cart-sidebar__min-order {
	padding: 0.5rem 1.25rem;
	margin: 0;
	font-size: 0.82rem;
}

.ce-cart-sidebar__min-order p {
	margin: 0;
}

.ce-cart-sidebar__min-order.ce-min-unmet {
	background: #fff3e6;
	color: #c8651e;
	font-weight: 600;
}

.ce-cart-sidebar__min-order.ce-min-met {
	background: #eef8f2;
	color: var(--ce-success);
	font-weight: 500;
}

/* ─── Action buttons ────────────────────────────────────── */
.ce-cart-sidebar__actions {
	padding: 1rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ce-cart-sidebar__continue-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.75rem 1rem;
	background: var(--ce-accent);
	color: #ffffff;
	border: none;
	border-radius: var(--ce-radius-sm);
	font-size: 0.9rem;
	font-weight: 700;
	font-family: inherit;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-decoration: none;
	cursor: pointer;
	transition: all var(--ce-transition);
	text-align: center;
	box-sizing: border-box;
}

.ce-cart-sidebar__continue-btn:hover {
	background: var(--ce-accent-h);
	color: #ffffff;
	text-decoration: none;
}

.ce-cart-sidebar__continue-btn:active {
	transform: scale(0.98);
}

.ce-cart-sidebar__continue-btn.ce-btn-disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: auto;  /* keep clickable so JS can preventDefault */
}

.ce-cart-sidebar__continue-btn.ce-btn-disabled:hover {
	background: var(--ce-accent);
}

.ce-cart-sidebar__continue-arrow {
	font-size: 1.1rem;
}

.ce-cart-sidebar__clear-btn {
	width: 100%;
	padding: 0.5rem 1rem;
	background: transparent;
	color: var(--ce-muted);
	border: 1px solid var(--ce-border);
	border-radius: var(--ce-radius-sm);
	font-size: 0.8rem;
	font-weight: 600;
	font-family: inherit;
	text-transform: none;
	cursor: pointer;
	transition: all var(--ce-transition);
	-webkit-appearance: none;
	appearance: none;
}

.ce-cart-sidebar__clear-btn:hover:not(:disabled):not(.ce-btn-loading) {
	border-color: var(--ce-danger);
	color: var(--ce-danger);
}

.ce-cart-sidebar__clear-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Clear cart loading state */
.ce-cart-sidebar__clear-btn.ce-btn-loading {
	position: relative;
	color: transparent;
	pointer-events: none;
}

.ce-cart-sidebar__clear-btn.ce-btn-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 2px solid var(--ce-border);
	border-top-color: var(--ce-muted);
	border-radius: 50%;
	animation: ce-spin 0.6s linear infinite;
}


/* ═══════════════════════════════════════════════════════════
   Responsive: Tablet (≤ 1024px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
	.ce-main {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.ce-cart-sidebar {
		position: static;
		order: -1;            /* cart summary at top on smaller screens */
	}

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


/* ═══════════════════════════════════════════════════════════
   Responsive: Tablet portrait (≤ 768px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
	.ce-products__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.75rem;
	}

	.ce-cat-card {
		min-width: 95px;
		padding: 0.65rem 0.75rem;
	}

	.ce-cat-card__image {
		width: 56px;
		height: 56px;
	}

	.ce-cat-card__name {
		font-size: 0.7rem;
	}

	.ce-service-tab {
		padding: 0.4rem 0.9rem;
		font-size: 0.78rem;
	}

	.ce-instructions {
		padding: 0.65rem 1rem;
	}

	.ce-instructions p {
		font-size: 0.85rem;
	}
}


/* ═══════════════════════════════════════════════════════════
   Responsive: Small mobile (≤ 480px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
	.ce-products__grid {
		grid-template-columns: 1fr;
	}

	.ce-product-card {
		flex-direction: row;
		align-items: center;
		gap: 0;
	}

	.ce-product-card__image {
		width: 80px;
		min-width: 80px;
		height: 80px;
		aspect-ratio: auto;
		padding: 0.35rem;
	}

	.ce-product-card__name {
		padding: 0.5rem 0.5rem 0.15rem;
		font-size: 0.78rem;
		min-height: auto;
	}

	.ce-product-card__quantity {
		padding: 0 0.5rem;
	}

	.ce-product-card__footer {
		padding: 0.35rem 0.5rem 0.5rem;
	}

	.ce-product-card__add-btn {
		padding: 0.35rem 0.7rem;
		font-size: 0.72rem;
	}

	/* Stack card content vertically in the remaining space */
	.ce-product-card {
		display: grid;
		grid-template-columns: 80px 1fr;
		grid-template-rows: auto auto auto;
	}

	.ce-product-card__image {
		grid-row: 1 / -1;
		grid-column: 1;
	}

	.ce-product-card__name {
		grid-column: 2;
	}

	.ce-product-card__quantity {
		grid-column: 2;
	}

	.ce-product-card__footer {
		grid-column: 2;
	}

	.ce-cart-sidebar__items {
		max-height: 200px;
	}
}
