/* Cake Order Tracker – delivery card + Celebration Extras. Replaces the old WPCode CSS. */

:root {
	--ps-brand: #2e2a85;        /* Dolphin indigo */
	--ps-brand-dark: #221f66;
	--ps-brand-soft: #efeefb;
	--ps-ink: #1f1d2b;
	--ps-muted: #6f6b7d;
	--ps-line: #e4ded5;
	--ps-card: #ffffff;
	--ps-ok: #1d7a4b;
	--ps-error: #b3261e;
	--ps-radius: 12px;
}

/* ===================== DELIVERY CARD ===================== */
.ps-card {
	box-sizing: border-box;
	width: 100%;
	background: var(--ps-card);
	border: 1px solid var(--ps-line);
	border-radius: 16px;
	padding: 6px 22px;
	margin: 22px 0 24px;
	max-width: 560px;
	box-shadow: 0 1px 2px rgba(31, 29, 43, .04), 0 6px 20px rgba(31, 29, 43, .04);
	color: var(--ps-ink);
	font-size: 15px;
	line-height: 1.45;
}
.ps-card *, .ps-card *::before, .ps-card *::after { box-sizing: border-box; }
.ps-card [hidden] { display: none !important; }

.ps-step { padding: 18px 0; }
.ps-step + .ps-step { border-top: 1px solid var(--ps-line); }

.ps-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ps-step-num {
	flex: 0 0 24px; height: 24px; border-radius: 50%;
	background: var(--ps-brand-soft); color: var(--ps-brand);
	font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.ps-step-title { font-size: 16px; font-weight: 600; margin: 0; color: var(--ps-ink); }
.ps-step-tag {
	margin-left: auto; font-size: 12px; color: var(--ps-muted);
	border: 1px solid var(--ps-line); border-radius: 999px; padding: 2px 10px;
}

/* ---------- Pincode ---------- */
.ps-pin-row {
	display: flex; align-items: stretch;
	border: 1.5px solid var(--ps-line); border-radius: var(--ps-radius); overflow: hidden; background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.ps-pin-row:focus-within { border-color: var(--ps-brand); box-shadow: 0 0 0 3px var(--ps-brand-soft); }
.ps-card .ps-delivery-pincode {
	flex: 1 1 auto; min-width: 0; border: 0 !important; outline: 0; box-shadow: none !important;
	padding: 12px 16px !important; margin: 0 !important; font-size: 16px; letter-spacing: .08em; background: transparent; color: var(--ps-ink);
}
.ps-card .ps-check-delivery {
	flex: 0 0 auto; border: 0; margin: 0; padding: 0 24px; min-height: 48px;
	background: var(--ps-brand); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; border-radius: 0;
	transition: background .15s;
}
.ps-card .ps-check-delivery:hover { background: var(--ps-brand-dark); }
.ps-card .ps-check-delivery:disabled { opacity: .6; cursor: default; }
.ps-pin-status { margin-top: 10px; font-size: 14px; min-height: 0; }
.ps-pin-status:empty { display: none; }

.ps-ok { color: var(--ps-ok); font-weight: 600; }
.ps-error { color: var(--ps-error); }
.ps-muted { color: var(--ps-muted); }
.ps-tick { font-weight: 700; }

/* ---------- Date cards ---------- */
.ps-dates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ps-card .ps-date-card {
	display: flex; flex-direction: column; align-items: center; gap: 1px;
	padding: 10px 4px; margin: 0; min-height: 0;
	border: 1.5px solid var(--ps-line); border-radius: var(--ps-radius); background: #fff; color: var(--ps-ink);
	cursor: pointer; font: inherit; line-height: 1.2; text-align: center;
	transition: border-color .15s, background .15s;
}
.ps-card .ps-date-card:hover { border-color: var(--ps-brand); }
.ps-date-dow { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ps-muted); }
.ps-date-day { font-size: 15px; font-weight: 700; white-space: nowrap; }
.ps-date-rel { font-size: 11px; color: var(--ps-brand); font-weight: 600; }
.ps-card .ps-date-card.active { border-color: var(--ps-brand); background: var(--ps-brand-soft); }
.ps-card .ps-date-other { border-style: dashed; }
.ps-card .ps-date-other .ps-date-day { font-size: 13px; }

.ps-future-date-input {
	position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.ps-future-date-input.ps-show {
	position: static; width: 100%; height: auto; opacity: 1; pointer-events: auto;
	margin-top: 10px; padding: 10px 12px; border: 1.5px solid var(--ps-line); border-radius: var(--ps-radius);
}

/* ---------- Time chips ---------- */
.ps-times-label { margin: 16px 0 8px; font-size: 13px; color: var(--ps-muted); font-weight: 600; }
.ps-times { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-card .ps-slot-btn {
	padding: 10px 18px; margin: 0; min-height: 0;
	border: 1.5px solid var(--ps-line); border-radius: 999px; background: #fff; color: var(--ps-ink);
	font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.2;
	transition: border-color .15s, background .15s, color .15s;
}
.ps-card .ps-slot-btn:hover { border-color: var(--ps-brand); }
.ps-card .ps-slot-btn.active { background: var(--ps-brand); border-color: var(--ps-brand); color: #fff; }

.ps-slot-summary {
	margin-top: 14px; padding: 10px 14px; border-radius: 10px;
	background: #edf7f1; color: var(--ps-ok); font-size: 14px;
}
.ps-slot-summary strong { color: inherit; }

/* ---------- Message on cake ---------- */
.ps-card .ps-msg-input {
	width: 100%; margin: 0 !important; padding: 12px 14px !important; font-size: 15px;
	border: 1.5px solid var(--ps-line) !important; border-radius: var(--ps-radius) !important; background: #fff; color: var(--ps-ink);
	box-shadow: none !important; outline: 0;
}
.ps-card .ps-msg-input:focus { border-color: var(--ps-brand) !important; box-shadow: 0 0 0 3px var(--ps-brand-soft) !important; }
.ps-msg-count { text-align: right; font-size: 12px; color: var(--ps-muted); margin-top: 6px; }

/* ===================== ADD-TO-CART FORM ON CAKE PAGES ===================== */
/* Hidden until a delivery slot is chosen */
body.ps-needs-slot:not(.ps-slot-ok) form.cart,
body.ps-needs-slot:not(.ps-slot-ok) .ps-extras-cta { display: none !important; }

/* Line the form up with the delivery card (left aligned, same width) */
body.ps-needs-slot form.cart { max-width: 560px; margin: 0 0 14px !important; text-align: left; }
body.ps-needs-slot form.cart table.variations { width: 100%; margin: 0 0 14px; border: 0; }
body.ps-needs-slot form.cart table.variations tr { display: flex; flex-direction: column; gap: 6px; }
body.ps-needs-slot form.cart table.variations th,
body.ps-needs-slot form.cart table.variations td { display: block; width: 100%; padding: 0; text-align: left; border: 0; background: none; }
body.ps-needs-slot form.cart table.variations label { font-weight: 600; font-size: 14px; color: var(--ps-ink); }
body.ps-needs-slot form.cart table.variations select {
	width: 100%; max-width: none; padding: 12px 14px; font-size: 15px;
	border: 1.5px solid var(--ps-line); border-radius: var(--ps-radius); background-color: #fff;
}
body.ps-needs-slot form.cart .reset_variations { display: inline-block; margin-top: 6px; font-size: 13px; }

body.ps-needs-slot form.cart .woocommerce-variation-add-to-cart,
body.ps-needs-slot form.cart:not(.variations_form) {
	display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; width: 100%;
}
body.ps-needs-slot form.cart .quantity { margin: 0 !important; float: none !important; }
body.ps-needs-slot form.cart .single_add_to_cart_button {
	flex: 1 1 200px; float: none !important; margin: 0 !important; min-height: 50px;
	background: var(--ps-brand) !important; border-color: var(--ps-brand) !important; color: #fff !important;
	border: 1.5px solid var(--ps-brand) !important; border-radius: var(--ps-radius) !important; box-shadow: none !important;
	font-size: 16px; font-weight: 600; white-space: nowrap; line-height: 1.2;
}
body.ps-needs-slot form.cart .single_add_to_cart_button:hover { background: var(--ps-brand-dark) !important; }
body.ps-needs-slot form.cart .single_add_to_cart_button.disabled { opacity: .45; }

/* ===================== CELEBRATION EXTRAS BUTTON ===================== */
.ps-extras-cta { max-width: 560px; margin: 0 0 24px; }
.ps-extras-open {
	display: flex; align-items: center; gap: 14px; width: 100%; margin: 0;
	padding: 12px 16px; text-align: left; cursor: pointer;
	border: 1.5px dashed #c9c3e8; border-radius: 14px; background: #faf9ff; color: var(--ps-ink);
	font: inherit; transition: border-color .15s, background .15s;
}
.ps-extras-open:hover { border-color: var(--ps-brand); background: var(--ps-brand-soft); }
.ps-extras-open-icon {
	flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--ps-brand); color: #fff;
	display: inline-flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1;
}
.ps-extras-open-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ps-extras-open-title { font-weight: 700; font-size: 15px; }
.ps-extras-open-sub { font-size: 13px; color: var(--ps-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-extras-open-arrow { font-size: 26px; color: var(--ps-brand); line-height: 1; }

/* ===================== CELEBRATION EXTRAS POPUP ===================== */
.ps-extras-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ps-extras-modal[hidden] { display: none; }
.ps-extras-backdrop { position: absolute; inset: 0; background: rgba(20, 18, 40, .55); }
.ps-extras-box {
	position: relative; display: flex; flex-direction: column;
	background: #fff; border-radius: 20px; width: 100%; max-width: 760px; max-height: calc(100vh - 32px);
	box-shadow: 0 24px 60px rgba(20, 18, 40, .3); color: var(--ps-ink); overflow: hidden;
}
body.ps-extras-open-body { overflow: hidden; }

.ps-extras-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 8px; }
.ps-extras-head h3 { margin: 0; font-size: 24px; line-height: 1.2; }
.ps-extras-lead { margin: 4px 0 0; color: var(--ps-muted); font-size: 14px; }
.ps-extras-x {
	flex: 0 0 36px; height: 36px; border-radius: 50%; border: 0; background: #f3f1ee; color: var(--ps-ink);
	font-size: 22px; line-height: 1; cursor: pointer; padding: 0;
}
.ps-extras-x:hover { background: #e9e5df; }

.ps-extras-slider { position: relative; display: flex; align-items: center; padding: 12px 8px 4px; }
.ps-extras-track {
	display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
	flex: 1; padding: 6px 12px 10px;
}
.ps-extras-track::-webkit-scrollbar { display: none; }
.ps-extras-arrow {
	flex: 0 0 34px; height: 34px; border-radius: 50%; border: 1px solid var(--ps-line); background: #fff;
	font-size: 22px; color: var(--ps-ink); cursor: pointer; line-height: 1; padding: 0;
}
.ps-extras-arrow:hover { border-color: var(--ps-brand); color: var(--ps-brand); }

.ps-extra {
	flex: 0 0 196px; scroll-snap-align: start; border: 1.5px solid var(--ps-line); border-radius: 14px;
	overflow: hidden; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.ps-extra.selected { border-color: var(--ps-brand); box-shadow: 0 0 0 3px var(--ps-brand-soft); }
.ps-extra-img img { width: 100%; height: 150px; object-fit: cover; display: block; margin: 0; }
.ps-extra-body { padding: 12px 14px 14px; }
.ps-extra-name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.ps-extra-price { margin-top: 2px; font-size: 14px; color: var(--ps-muted); }
.ps-extra-price del { opacity: .6; margin-right: 4px; }
.ps-extra-qty {
	display: flex; align-items: center; justify-content: space-between; margin-top: 12px;
	border: 1.5px solid var(--ps-line); border-radius: 999px; padding: 2px;
}
.ps-extra-qty button {
	width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--ps-brand);
	font-size: 18px; font-weight: 700; cursor: pointer; padding: 0; line-height: 1;
}
.ps-extra-qty button:hover { background: var(--ps-brand-soft); }
.ps-qty { font-weight: 700; min-width: 20px; text-align: center; }

.ps-extras-foot {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
	padding: 16px 26px 22px; border-top: 1px solid var(--ps-line); margin-top: 8px;
}
.ps-extras-note { font-size: 14px; }
.ps-extras-note a { color: var(--ps-brand); font-weight: 600; }
.ps-extras-buttons { display: flex; gap: 10px; margin-left: auto; }
.ps-extras-skip {
	padding: 12px 18px; border: 0; background: transparent; color: var(--ps-muted); font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px;
}
.ps-extras-skip:hover { background: #f3f1ee; color: var(--ps-ink); }
.ps-extras-add {
	padding: 12px 22px; border: 0; border-radius: 10px; background: var(--ps-brand); color: #fff;
	font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ps-extras-add:hover { background: var(--ps-brand-dark); }
.ps-extras-add:disabled { background: #e7e4f3; color: #9a96b5; cursor: default; }

/* ===================== MOBILE ===================== */
@media (max-width: 600px) {
	.ps-card { padding: 4px 16px; border-radius: 14px; }
	.ps-dates { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
	.ps-dates::-webkit-scrollbar { display: none; }
	.ps-card .ps-date-card { flex: 0 0 86px; scroll-snap-align: start; }
	.ps-extras-modal { padding: 0; align-items: flex-end; }
	.ps-extras-box { border-radius: 20px 20px 0 0; max-height: 92vh; }
	.ps-extras-head { padding: 20px 18px 6px; }
	.ps-extras-head h3 { font-size: 20px; }
	.ps-extras-arrow { display: none; }
	.ps-extra { flex-basis: 160px; }
	.ps-extra-img img { height: 120px; }
	.ps-extras-foot { padding: 14px 18px 18px; }
	.ps-extras-buttons { width: 100%; }
	.ps-extras-add { flex: 1; }
}
