/* OC SMS Login: the phone popup, the inline sign-in, and the theme's header login drawer. */
:root {
	--ocsl-brand: #1f2937;
	--ocsl-btn-ink: #fff;
	--ocsl-ink: #1f2937;
	--ocsl-muted: #6b7280;
	--ocsl-line: #d1d5db;
	--ocsl-bg: #fff;
	--ocsl-field-bg: #f6f6f7;
	--ocsl-field-ink: #1f2937; /* the fields stay white, so their text stays dark whatever the popup's text colour is */
	--ocsl-err: #b42318;
	--ocsl-radius: 16px;
	--ocsl-btn-radius: 10px;
	--ocsl-field-radius: 10px;
	--ocsl-overlay: .55;
}

html.ocsl-open { overflow: hidden; }

.ocsl-modal[hidden], .ocsl-step[hidden], .ocsl-err[hidden], .ocsl-test[hidden], [data-ocsl-resend][hidden] { display: none !important; }
/* A theme that sets display on spans, paragraphs or buttons would otherwise show what the script hid. */
.ocsl-modal [hidden], .ocsl-inline [hidden] { display: none !important; }

/* One box model inside our blocks, whatever the theme's is. */
.ocsl-modal, .ocsl-modal *, .ocsl-inline, .ocsl-inline * { box-sizing: border-box; }

/* ---------------- the popup ---------------- */

/* The highest z-index there is: themes put their side cart there too (OC Theme's .drawer-panel), and
   the popup opens from inside it. On a tie the later element wins, so the JS moves the popup to the end of <body>. */
.ocsl-modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2147483647; display: flex; align-items: center; justify-content: center; margin: 0; padding: 16px; direction: rtl; }
.ocsl-backdrop { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(17, 24, 39, var(--ocsl-overlay)); }
.ocsl-dialog { position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-x: hidden; overflow-y: auto; background: var(--ocsl-bg); color: var(--ocsl-ink); border-radius: var(--ocsl-radius); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); padding: 30px 28px 26px; box-sizing: border-box; animation: ocsl-in .18s ease-out; text-align: right; }
@keyframes ocsl-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ocsl-dialog { animation: none; } }

/* The close button: a round, outlined button in the corner. Themes style every <button>, hence the !important. */
.ocsl-dialog button.ocsl-x {
	position: absolute !important; top: 16px !important; left: 16px !important; right: auto !important;
	width: 36px !important; height: 36px !important; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important;
	display: flex !important; align-items: center; justify-content: center;
	border: 1px solid var(--ocsl-line) !important; border-radius: 50% !important; background: var(--ocsl-bg) !important; box-shadow: none !important;
	color: var(--ocsl-ink) !important; font-size: 0 !important; line-height: 1 !important; cursor: pointer; transition: background-color .15s, border-color .15s;
}
/* The x is drawn with two lines, not a glyph: some themes give buttons an icon font without one. */
.ocsl-dialog button.ocsl-x::before, .ocsl-dialog button.ocsl-x::after {
	content: "" !important; display: block !important; position: absolute !important; top: 50% !important; left: 50% !important; right: auto !important; bottom: auto !important;
	width: 16px !important; height: 1.6px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 2px !important;
	background: currentColor !important; opacity: 1 !important; transform: translate(-50%, -50%) rotate(45deg) !important; transition: none !important; z-index: 1 !important;
	transform-origin: 50% 50% !important; clip-path: none !important; max-width: none !important; min-width: 0 !important; animation: none !important; filter: none !important;
}
.ocsl-dialog button.ocsl-x::after { transform: translate(-50%, -50%) rotate(-45deg) !important; }
.ocsl-dialog button.ocsl-x:hover, .ocsl-dialog button.ocsl-x:focus-visible { background: var(--ocsl-field-bg) !important; border-color: var(--ocsl-ink) !important; }

/* ---------------- the steps (popup, inline, drawer) ---------------- */

.ocsl-steps { direction: rtl; text-align: right; color: var(--ocsl-ink); }
/* Themes size h2 for page titles: keep ours a dialog heading wherever it lands. */
.ocsl-steps .ocsl-h { margin: 0 0 6px !important; padding: 0 !important; font-size: 21px !important; line-height: 1.3 !important; font-weight: 700 !important; color: var(--ocsl-ink) !important; text-align: right; letter-spacing: normal !important; text-transform: none !important; }
.ocsl-dialog .ocsl-steps .ocsl-h { padding-left: 48px !important; } /* clear of the round close button */
/* Themes decorate headings with a line or an icon drawn in ::before/::after: not on ours. */
.ocsl-steps .ocsl-h::before, .ocsl-steps .ocsl-h::after { content: none !important; display: none !important; }
.ocsl-sub { margin: 0 0 18px !important; font-size: 14.5px; line-height: 1.5; color: var(--ocsl-muted); }
.ocsl-steps .ocsl-label { display: block !important; float: none !important; width: auto !important; margin: 0 0 6px !important; padding: 0 !important; font-size: 13.5px !important; font-weight: 600 !important; line-height: 1.4 !important; color: var(--ocsl-ink) !important; text-align: right; text-transform: none !important; letter-spacing: normal !important; }
.ocsl-steps p { margin: 0 0 12px; padding: 0; }
/* Themes and WooCommerce frame their forms (border, padding, a width, a float): ours are plain. */
.ocsl-steps form.ocsl-step { float: none !important; width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; }

/* Fields and buttons: one height, one box model, whatever the theme says about inputs and buttons. */
.ocsl-steps .ocsl-input {
	display: block; width: 100% !important; max-width: none !important; height: 48px !important; min-height: 0 !important; box-sizing: border-box !important;
	margin: 0 !important; padding: 0 14px !important; font: inherit; font-size: 16px !important; line-height: normal !important;
	color: var(--ocsl-field-ink) !important; background: #fff !important; border: 1.5px solid var(--ocsl-line) !important; border-radius: var(--ocsl-field-radius) !important;
	box-shadow: none !important; outline: none; -webkit-appearance: none; appearance: none; float: none !important; text-transform: none !important; text-indent: 0 !important;
}
.ocsl-steps .ocsl-input::placeholder { color: #9ca3af !important; opacity: 1 !important; }
.ocsl-steps .ocsl-input:focus { border-color: var(--ocsl-brand) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ocsl-brand) 18%, transparent) !important; }
.ocsl-steps .ocsl-tel { letter-spacing: .5px; text-align: left !important; direction: ltr !important; }

.ocsl-row { display: flex !important; align-items: stretch !important; gap: 8px; margin: 0; }
.ocsl-row .ocsl-input { flex: 1 1 auto; min-width: 0; }
.ocsl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

.ocsl-steps .ocsl-btn {
	flex: 0 0 auto; display: inline-flex !important; align-items: center !important; justify-content: center !important;
	height: 48px !important; min-height: 0 !important; width: auto !important; min-width: 0 !important; max-width: none !important; float: none !important; box-sizing: border-box !important; margin: 0 !important; padding: 0 22px !important;
	border: 0 !important; border-radius: var(--ocsl-btn-radius) !important; background: var(--ocsl-brand) !important; color: var(--ocsl-btn-ink) !important;
	font: inherit; font-size: 16px !important; font-weight: 700 !important; line-height: 1 !important; letter-spacing: normal !important; text-transform: none !important;
	box-shadow: none !important; cursor: pointer; white-space: nowrap; transition: filter .15s;
}
.ocsl-steps .ocsl-btn:hover { filter: brightness(1.08); }
.ocsl-steps .ocsl-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--ocsl-brand) 40%, transparent); outline-offset: 2px; }
.ocsl-steps .ocsl-btn[disabled] { opacity: .65; cursor: progress; }
.ocsl-steps .ocsl-btn-wide { display: flex !important; width: 100% !important; margin-top: 6px !important; }

.ocsl-steps button.ocsl-link, .ocsl-dialog button.ocsl-link {
	border: 0 !important; background: transparent !important; box-shadow: none !important; min-width: 0 !important; min-height: 0 !important; height: auto !important; width: auto !important;
	padding: 0 !important; margin: 0; color: var(--ocsl-brand) !important; font: inherit; font-size: 14px !important; font-weight: 400 !important; line-height: inherit !important;
	text-transform: none !important; letter-spacing: normal !important; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; border-radius: 0;
}
.ocsl-sub .ocsl-link { margin-inline-start: 6px !important; }
.ocsl-pretty { font-weight: 700; color: var(--ocsl-ink); }

.ocsl-err { margin: 10px 0 0 !important; padding: 10px 12px; border-radius: 8px; background: #fef3f2; color: var(--ocsl-err); font-size: 14px; line-height: 1.45; }
.ocsl-test { padding: 8px 12px; border-radius: 8px; background: #fffbeb; border: 1px dashed #d97706; color: #92400e; font-size: 14px; font-weight: 700; }

.ocsl-boxes { display: flex; gap: 8px; justify-content: center; margin: 4px 0 16px; direction: ltr; }
.ocsl-steps .ocsl-box {
	width: 48px !important; height: 56px !important; min-height: 0 !important; box-sizing: border-box !important; margin: 0 !important; padding: 0 !important;
	min-width: 0 !important; float: none !important; max-width: none !important; text-align: center !important; font: inherit; font-size: 24px !important; font-weight: 700; line-height: normal !important; text-transform: none !important; color: var(--ocsl-field-ink) !important; background: #fff !important; -webkit-appearance: none; appearance: none;
	border: 1.5px solid var(--ocsl-line) !important; border-radius: min(var(--ocsl-field-radius), 12px) !important; outline: none; box-shadow: none !important;
}
.ocsl-steps .ocsl-box:focus { border-color: var(--ocsl-brand) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ocsl-brand) 18%, transparent) !important; }

.ocsl-resend { text-align: center; font-size: 13.5px; color: var(--ocsl-muted); margin: 14px 0 0 !important; }
.ocsl-back, .ocsl-guest { text-align: center; margin: 14px 0 0 !important; }

.ocsl-steps .ocsl-consent { display: flex !important; gap: 8px; align-items: flex-start; float: none !important; width: auto !important; margin: 4px 0 12px !important; padding: 0 !important; font-size: 13.5px !important; font-weight: 400 !important; line-height: 1.45 !important; color: var(--ocsl-muted) !important; text-transform: none !important; letter-spacing: normal !important; cursor: pointer; }
/* Themes that draw their own checkbox hide the real one: ours is the browser's, always visible. */
.ocsl-steps .ocsl-consent input[type="checkbox"] {
	position: static !important; display: inline-block !important; flex: 0 0 auto; width: 18px !important; height: 18px !important; min-width: 0 !important; min-height: 0 !important;
	margin: 3px 0 0 !important; padding: 0 !important; opacity: 1 !important; visibility: visible !important; clip: auto !important; clip-path: none !important; transform: none !important;
	-webkit-appearance: checkbox !important; appearance: auto !important; accent-color: var(--ocsl-brand);
}
.ocsl-steps .ocsl-consent input[type="checkbox"] + span::before, .ocsl-steps .ocsl-consent input[type="checkbox"] + span::after { content: none !important; display: none !important; }
.ocsl-steps .ocsl-consent span { padding: 0 !important; margin: 0 !important; }
.ocsl-consent a { color: var(--ocsl-brand); }
.ocsl-consent a, .ocsl-steps .ocsl-consent a { color: var(--ocsl-brand) !important; text-decoration: underline !important; }
/* The honeypot: out of sight in place. Pushed far to the side it gave the right-to-left popup a sideways scrollbar. */
.ocsl-steps .ocsl-hp { position: absolute !important; left: auto !important; right: auto !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; opacity: 0 !important; pointer-events: none !important; }
.ocsl-steps .ocsl-hp input { width: 1px !important; height: 1px !important; min-width: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; float: none !important; }

.ocsl-done { text-align: center; padding: 24px 0 8px; }
.ocsl-done .ocsl-h { padding: 0 !important; margin-top: 14px !important; text-align: center !important; }
.ocsl-spin { display: inline-block; width: 36px; height: 36px; border: 3px solid #e5e7eb; border-top-color: var(--ocsl-brand); border-radius: 50%; animation: ocsl-spin .8s linear infinite; }
@keyframes ocsl-spin { to { transform: rotate(360deg); } }

/* ---------------- inline (My Account, the shortcode) ---------------- */

.ocsl-inline { max-width: 460px; margin: 0 0 28px; padding: 24px; border: 1px solid #e5e7eb; border-radius: var(--ocsl-radius); background: var(--ocsl-bg); box-sizing: border-box; }
.ocsl-inline .ocsl-steps .ocsl-h { font-size: 19px !important; }
.ocsl-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 0 !important; color: var(--ocsl-muted); font-size: 13.5px; }
.ocsl-or::before, .ocsl-or::after { content: ""; flex: 1 1 auto; height: 1px; background: #e5e7eb; }

/* ---------------- the theme's header login drawer ("שלום, אורח") ----------------
   The script marks the drawer .ocsl-drawer and dresses our block like OC Theme's: a header line, a
   centred title, a full-width field and button, "או" and an email/password door, and the sign-up
   at the bottom. The theme's own email form and sign-up stay, opened from those doors. */

/* The drawer keeps 90px on top for its close button: our header line sits beside it instead. */
#auth-panel.ocsl-drawer:not(.ocsl-reg-open) { padding-top: 20px !important; }
.ocsl-drawer .ocsl-inline { max-width: none; margin: 0; padding: 0 30px; border: 0; border-radius: 0; background: transparent; }
.ocsl-dhead { margin: 0 0 26px; padding: 2px 0 14px 40px; border-bottom: 1px solid #e5e2dd; font-size: 18px; font-weight: 700; color: var(--ocsl-ink); text-align: right; line-height: 1.3; }
/* Themes lay a coloured ::before/::after over their buttons: none on ours. */
.ocsl-drawer button.ocsl-door::before, .ocsl-drawer button.ocsl-door::after,
.ocsl-steps button::before, .ocsl-steps button::after { content: none !important; display: none !important; }
.ocsl-drawer .ocsl-steps [data-ocsl-step="phone"] .ocsl-h { text-align: center !important; font-size: 22px !important; margin: 4px 0 18px !important; }
.ocsl-drawer .ocsl-steps [data-ocsl-step="phone"] .ocsl-sub,
.ocsl-drawer .ocsl-steps [data-ocsl-step="phone"] .ocsl-label { display: none !important; }
.ocsl-drawer .ocsl-row { flex-direction: column; gap: 14px; }
.ocsl-drawer .ocsl-steps .ocsl-input { background: var(--ocsl-field-bg) !important; border-color: #e5e2dd !important; }
.ocsl-drawer .ocsl-steps .ocsl-tel { text-align: center !important; }
.ocsl-drawer .ocsl-steps .ocsl-btn { width: 100% !important; }
.ocsl-alt { margin: 26px 0 0; }
.ocsl-alt .ocsl-or { margin: 0 0 14px !important; }
.ocsl-drawer button.ocsl-door {
	display: flex !important; align-items: center; justify-content: center; gap: 10px; width: 100% !important; height: 48px !important; min-height: 0 !important;
	box-sizing: border-box !important; margin: 0 !important; padding: 0 22px !important; border: 1px solid #d9d6d0 !important; border-radius: var(--ocsl-btn-radius) !important;
	background: transparent !important; color: var(--ocsl-ink) !important; font: inherit; font-size: 15.5px !important; font-weight: 500 !important; line-height: 1 !important;
	text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important; cursor: pointer; transition: border-color .15s;
}
.ocsl-drawer button.ocsl-door:hover { border-color: var(--ocsl-ink) !important; }
.ocsl-door svg { flex: 0 0 auto; }
.ocsl-dfoot { margin: 34px 30px 24px; padding: 22px 0 0; border-top: 1px solid #e5e2dd; text-align: center; }
.ocsl-dfoot-t { margin: 0 0 6px !important; font-size: 17px; font-weight: 700; color: var(--ocsl-ink); }
.ocsl-dfoot-s { margin: 0 0 16px !important; font-size: 14px; line-height: 1.5; color: var(--ocsl-muted); }
#auth-panel.ocsl-drawer button.ocsl-dback {
	display: block !important; width: auto !important; height: auto !important; min-height: 0 !important; margin: 0 auto 18px !important; padding: 0 !important;
	border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--ocsl-brand) !important;
	font: inherit; font-size: 14px !important; font-weight: 400 !important; line-height: 1.4 !important; text-transform: none !important; letter-spacing: normal !important;
	text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
#auth-panel.ocsl-drawer button.ocsl-dback::before, #auth-panel.ocsl-drawer button.ocsl-dback::after { content: none !important; display: none !important; }
/* Our header line already says "התחברות": the theme's big title in the email form steps aside. */
.ocsl-drawer.ocsl-email-open:not(.ocsl-reg-open) #customer_login .u-column1 > h2 { display: none !important; }

/* The theme's email/password form: closed until asked for; its own "או / הרשמה" give way to ours.
   Its register column (it slides in from the side) keeps its height even unseen: out until asked for. */
.ocsl-drawer:not(.ocsl-email-open):not(.ocsl-reg-open) #customer_login { display: none !important; }
/* Only where our footer has a door to the sign-up (.ocsl-has-join): a theme without one keeps its sign-up in sight. */
.ocsl-drawer.ocsl-has-join.ocsl-email-open:not(.ocsl-reg-open) #customer_login .u-column2 { display: none !important; }
.ocsl-drawer.ocsl-email-open #customer_login { height: auto !important; min-height: 0 !important; }
.ocsl-drawer #customer_login .u-column1 .myaccount-link-or-container,
.ocsl-drawer #customer_login .u-column1 .register-form-link { display: none !important; }
.ocsl-drawer.ocsl-email-open .ocsl-inline .ocsl-steps,
.ocsl-drawer.ocsl-email-open .ocsl-alt { display: none !important; }
.ocsl-drawer:not(.ocsl-email-open) .ocsl-dback { display: none !important; }
/* Signing up (the theme's register view): our block and footer step aside. */
.ocsl-drawer.ocsl-reg-open .ocsl-inline,
.ocsl-drawer.ocsl-reg-open .ocsl-dfoot { display: none !important; }

/* ---------------- the checkout behind the gate ---------------- */

/* The classic checkout form, and the checkout block. */
body.ocsl-gated-required form.checkout,
body.ocsl-gated-required .wp-block-woocommerce-checkout,
body.ocsl-gated-required .wc-block-checkout { filter: blur(2px); pointer-events: none; user-select: none; }

/* ---------------- phones: the popup is a sheet from the bottom ---------------- */

@media (max-width: 600px) {
	.ocsl-modal { align-items: flex-end; padding: 0; }
	.ocsl-modal .ocsl-dialog { max-width: none; border-radius: var(--ocsl-radius) var(--ocsl-radius) 0 0; padding: 28px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; animation-name: ocsl-up; }
	@keyframes ocsl-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
	.ocsl-dialog button.ocsl-x { top: 14px !important; left: 14px !important; }
	.ocsl-row { flex-direction: column; }
	.ocsl-steps .ocsl-btn { width: 100% !important; }
	.ocsl-steps .ocsl-box { width: 44px !important; height: 52px !important; font-size: 22px !important; }
	.ocsl-grid { grid-template-columns: 1fr; }
}

/* ---------------- the preview in the settings ---------------- */

.ocsl-preview { position: relative; display: flex; align-items: center; justify-content: center; padding: 28px; border-radius: 12px; background: rgba(17, 24, 39, var(--ocsl-overlay)); direction: rtl; }
.ocsl-preview .ocsl-dialog { animation: none; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); max-height: none; }

/* The theme's sign-up form, sent in place: its errors sit above its button. */
.ocsl-err.ocsl-reg-err { margin: 0 0 12px !important; }
