/* ============================================================
   Create / edit form
   ============================================================ */
.sqp-form { max-width: 660px; margin: 0 auto; }
.sqp-field { display: block; margin: 0 0 18px; }
.sqp-field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.sqp-field input[type="text"],
.sqp-field input[type="number"],
.sqp-field input[type="search"],
.sqp-field textarea,
.sqp-field select {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid #d8dadd;
	border-radius: 10px;
	font-size: 16px; /* avoids iOS zoom-on-focus */
	box-sizing: border-box;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.sqp-field input:focus,
.sqp-field textarea:focus,
.sqp-field select:focus {
	border-color: #111;
	outline: none;
	box-shadow: 0 0 0 3px rgba(0,0,0,.08);
}
.sqp-field small { display: block; color: #777; margin-top: 5px; font-size: 12.5px; }
.sqp-field.sqp-inline { display: flex; align-items: center; gap: 8px; }
.sqp-field.sqp-inline > span { margin: 0; font-weight: 400; }

.sqp-row { display: flex; gap: 14px; }
.sqp-row .sqp-field { flex: 1; }

.sqp-repeat { margin-top: 4px; }
.sqp-rep-row { display: flex; gap: 8px; margin: 0 0 8px; align-items: center; }
.sqp-rep-row input[type="text"],
.sqp-rep-row input[type="number"] { flex: 1; }
.sqp-rep-row input[type="color"] {
	width: 46px; height: 44px; padding: 2px; border: 1px solid #d8dadd;
	border-radius: 10px; background: #fff; cursor: pointer; flex: 0 0 auto;
}
.sqp-rep-remove {
	border: 1px solid #d8dadd; background: #fff; border-radius: 10px;
	width: 44px; height: 44px; cursor: pointer; font-size: 18px; line-height: 1; flex: 0 0 auto;
}
.sqp-rep-add { margin-top: 2px; }

.sqp-submit { width: 100%; padding: 15px; font-size: 17px; margin-top: 10px; border-radius: 10px; }

.sqp-box { padding: 13px 16px; border-radius: 10px; margin: 0 auto 16px; max-width: 660px; }
.sqp-success { background: #edfaef; border: 1px solid #46b450; }
.sqp-error { background: #fbeaea; border: 1px solid #dc3232; }

/* ============================================================
   Manage list
   ============================================================ */
.sqp-manage-top { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.sqp-search { display: flex; gap: 8px; }
.sqp-search input { padding: 9px 12px; border: 1px solid #d8dadd; border-radius: 10px; }
.sqp-list { list-style: none; margin: 0; padding: 0; }
.sqp-list-item {
	display: flex; align-items: center; gap: 14px;
	padding: 12px; border: 1px solid #eee; border-radius: 12px; margin-bottom: 10px; background: #fff;
}
.sqp-list-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
.sqp-list-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sqp-list-price { color: #111; }
.sqp-list-status { color: #888; font-size: 12px; }
.sqp-pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.sqp-page { padding: 6px 12px; border: 1px solid #d8dadd; border-radius: 8px; text-decoration: none; }
.sqp-page.current { background: #111; color: #fff; border-color: #111; }

/* ============================================================
   Storefront product page
   ============================================================ */
.sqp-fields { margin: 0 0 18px; }
.sqp-group { margin: 0 0 22px; }
.sqp-group-title { display: block; font-weight: 600; margin-bottom: 10px; font-size: 14px; letter-spacing: .2px; }
.sqp-req { color: #dc3232; }

/* Pills (sizes + single-choice add-ons) — refined, professional */
.sqp-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sqp-pill-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.sqp-pill {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; padding: 9px 16px;
	border: 1.5px solid #dcdcdc; border-radius: 8px;
	background: #fff; color: #222; cursor: pointer; user-select: none;
	font-size: 14px; line-height: 1.1; transition: border-color .15s, background .15s, color .15s;
}
.sqp-pill:hover { border-color: #111; }
.sqp-pill-input:checked + .sqp-pill { border-color: #111; background: #111; color: #fff; }
.sqp-pill-input:focus-visible + .sqp-pill { box-shadow: 0 0 0 3px rgba(0,0,0,.15); }

/* Color swatches (Shopify-style) */
.sqp-swatches { display: flex; flex-wrap: wrap; gap: 14px; }
.sqp-swatch-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.sqp-swatch { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.sqp-swatch-dot {
	width: 32px; height: 32px; border-radius: 50%;
	border: 1px solid rgba(0,0,0,.18); display: block;
	transition: box-shadow .15s;
}
.sqp-swatch-name { font-size: 12px; color: #555; }
.sqp-swatch:hover .sqp-swatch-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #bbb; }
.sqp-swatch-input:checked + .sqp-swatch .sqp-swatch-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111; }
.sqp-swatch-input:checked + .sqp-swatch .sqp-swatch-name { color: #111; font-weight: 600; }
.sqp-swatch-input:focus-visible + .sqp-swatch .sqp-swatch-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111; }

/* Measurement inputs — compact, pill-shaped (rounded ends) */
.sqp-measure-grid { display: flex; flex-wrap: wrap; gap: 14px 18px; }
.sqp-measure-item { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.sqp-measure-item label { font-size: 13px; color: #555; }
.sqp-measure-item input {
	width: 150px; max-width: 42vw; box-sizing: border-box;
	padding: 10px 16px; text-align: center;
	border: 1.5px solid #dcdcdc; border-radius: 999px; font-size: 15px; background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.sqp-measure-item input:focus { border-color: #111; outline: none; box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.sqp-measure-item input::-webkit-outer-spin-button,
.sqp-measure-item input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Description under the image */
.sqp-product-description { margin: 22px 0 0; line-height: 1.75; }
.sqp-product-description img { max-width: 100%; height: auto; }

@media (max-width: 480px) {
	.sqp-row { flex-direction: column; gap: 0; }
}

/* ============================================================
   Orders list
   ============================================================ */
.sqp-orders-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.sqp-orders-filters select,
.sqp-orders-filters input { padding: 9px 12px; border: 1px solid #d8dadd; border-radius: 10px; }
.sqp-orders-table { width: 100%; border-collapse: collapse; }
.sqp-orders-table th, .sqp-orders-table td { padding: 11px 10px; border-bottom: 1px solid #eee; text-align: start; vertical-align: middle; }
.sqp-orders-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #888; }
.sqp-orders-actions { white-space: nowrap; }
.sqp-orders-actions .button { margin-inline-start: 4px; }
.sqp-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: #eef1f4; color: #333; }
.sqp-status-processing { background: #c6e1c6; color: #2c4700; }
.sqp-status-completed { background: #c8d7e1; color: #2e4453; }
.sqp-status-on-hold { background: #f8dda7; color: #573b00; }
.sqp-status-pending, .sqp-status-cancelled, .sqp-status-failed { background: #eba3a3; color: #5b1313; }
.sqp-order-actions { margin-bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 600px) {
	.sqp-orders-table thead { display: none; }
	.sqp-orders-table, .sqp-orders-table tbody, .sqp-orders-table tr, .sqp-orders-table td { display: block; width: 100%; box-sizing: border-box; }
	.sqp-orders-table tr { border: 1px solid #eee; border-radius: 12px; margin-bottom: 12px; padding: 8px; }
	.sqp-orders-table td { border: 0; padding: 6px 8px; }
}

/* ============================================================
   Invoice (on-page + standalone print document)
   ============================================================ */
.sqp-invoice-page { background: #f2f3f5; margin: 0; padding: 24px; font-family: -apple-system, "Segoe UI", Tahoma, Arial, sans-serif; color: #222; }
.sqp-inv-toolbar { max-width: 820px; margin: 0 auto 14px; display: flex; gap: 8px; justify-content: flex-end; }
.sqp-inv-btn { background: #111; color: #fff; border: 0; padding: 10px 18px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.sqp-inv-btn-light { background: #fff; color: #333; border: 1px solid #d0d0d0; }

.sqp-invoice {
	max-width: 820px; margin: 0 auto; background: #fff; padding: 40px;
	border-radius: 14px; box-shadow: 0 4px 24px rgba(0,0,0,.06); line-height: 1.55;
}
.sqp-inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 24px; border-bottom: 2px solid #111; margin-bottom: 24px; flex-wrap: wrap; }
.sqp-inv-logo { max-height: 70px; max-width: 220px; height: auto; width: auto; }
.sqp-inv-store { font-size: 22px; font-weight: 700; }
.sqp-inv-store-addr { color: #666; font-size: 13px; margin-top: 8px; }
.sqp-inv-meta { text-align: end; font-size: 13px; }
.sqp-inv-meta h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: 2px; color: #111; }

.sqp-inv-parties { display: flex; gap: 40px; flex-wrap: wrap; margin-bottom: 26px; }
.sqp-inv-party { flex: 1; min-width: 200px; }
.sqp-inv-party h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: #999; }

.sqp-inv-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.sqp-inv-table thead th { background: #f6f7f8; padding: 10px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #777; }
.sqp-inv-table tbody td { padding: 12px; border-bottom: 1px solid #eee; vertical-align: middle; }
/* Per-column alignment (applies to both header and body) */
.sqp-inv-c-item { text-align: start; }
.sqp-inv-c-qty { text-align: center; white-space: nowrap; width: 70px; }
.sqp-inv-c-total { text-align: end; white-space: nowrap; width: 130px; }
.sqp-inv-itemcell { display: flex; gap: 12px; align-items: center; }
.sqp-inv-thumb img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; display: block; border: 1px solid #eee; }
.sqp-inv-itembody { min-width: 0; }
.sqp-inv-name { font-weight: 600; }
.sqp-inv-itemmeta { color: #666; font-size: 12.5px; margin-top: 4px; }
.sqp-inv-itemmeta p { margin: 2px 0; }

.sqp-inv-totals { display: flex; justify-content: flex-end; }
.sqp-inv-totals table { min-width: 280px; border-collapse: collapse; }
.sqp-inv-totals th { text-align: start; padding: 7px 12px; color: #555; font-weight: 500; }
.sqp-inv-totals td { text-align: end; padding: 7px 12px; }
.sqp-inv-totals .sqp-inv-total-order_total th,
.sqp-inv-totals .sqp-inv-total-order_total td { border-top: 2px solid #111; font-weight: 700; font-size: 16px; color: #111; }

.sqp-inv-note { margin-top: 22px; padding: 12px 14px; background: #f6f7f8; border-radius: 10px; font-size: 13px; }
.sqp-inv-footer { margin-top: 30px; padding-top: 16px; border-top: 1px solid #eee; text-align: center; color: #888; font-size: 13px; }

@media print {
	.no-print { display: none !important; }
	.sqp-invoice-page { background: #fff; padding: 0; }
	.sqp-invoice { box-shadow: none; border-radius: 0; max-width: none; padding: 0; }
	@page { margin: 16mm; }
}

/* ============================================================
   Checkout Field Editor (admin) — table + tabs + modal
   ============================================================ */
.sqp-cfe { max-width: 1100px; }
.sqp-cfe-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sqp-cfe-top h1 { margin: 0; }
.sqp-cfe-tabs { margin-top: 16px; border-bottom: 1px solid #dcdcde; }
.sqp-tab-panel { display: none; }
.sqp-tab-panel.active { display: block; }
.sqp-cfe-bar { margin: 14px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sqp-cfe-bar .sqp-bulk { display: flex; gap: 6px; }
.sqp-cfe-bar .sqp-add-field { background: #2271b1; color: #fff; border-color: #2271b1; }
.sqp-cfe-table .sqp-c-check { width: 34px; text-align: center; }

.sqp-cfe-table { background: #fff; border: 1px solid #e3e4e7; border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.sqp-cfe-table thead th { background: #f7f8fa; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #6b7280; padding: 12px 14px; border-bottom: 1px solid #e3e4e7; }
.sqp-cfe-table td { padding: 12px 14px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.sqp-cfe-table tbody tr:last-child td { border-bottom: 0; }
.sqp-cfe-table tbody tr:hover { background: #f9fbff; }
.sqp-cfe-table .sqp-c-drag { width: 34px; text-align: center; }
.sqp-cfe-table .sqp-c-req, .sqp-cfe-table .sqp-c-en { width: 84px; text-align: center; }
.sqp-cfe-table .sqp-c-edit { width: 110px; white-space: nowrap; }
.sqp-cfe-row.is-custom { background: #fbfdff; }
.sqp-drag { cursor: grab; color: #b3b8bf; font-size: 16px; user-select: none; }
.sqp-cell-name { background: #eef0f3; padding: 3px 9px; border-radius: 6px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #334155; }
.sqp-type-badge { display: inline-block; font-size: 11.5px; color: #3858e9; background: #eef1ff; padding: 3px 11px; border-radius: 999px; }
.sqp-mark { font-size: 15px; }
.sqp-cell-req .sqp-mark, .sqp-cell-en { color: #16a34a; }
.sqp-row-remove { color: #b32d2e; text-decoration: none; font-size: 17px; margin-inline-start: 8px; vertical-align: middle; }
.sqp-cfe-table .button.sqp-edit { border-radius: 7px; }
.ui-sortable-helper { display: table; box-shadow: 0 8px 24px rgba(0,0,0,.14); background: #fff; border-radius: 8px; }
.ui-sortable-placeholder { visibility: visible !important; background: #eef3fb; }
.ui-sortable-placeholder td { border-color: transparent !important; }

/* Modal */
.sqp-modal { display: none; position: fixed; inset: 0; z-index: 100000; }
.sqp-modal.open { display: block; }
.sqp-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.sqp-modal-box {
	position: relative; z-index: 1; width: 560px; max-width: calc(100% - 32px);
	margin: 5vh auto; background: #fff; border-radius: 12px; max-height: 90vh; display: flex; flex-direction: column;
	box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.sqp-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #eee; }
.sqp-modal-head h2 { margin: 0; font-size: 17px; }
.sqp-modal-x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: #777; }
.sqp-modal-body { padding: 18px 20px; overflow: auto; }
.sqp-m-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sqp-m-row > span { flex: 0 0 150px; text-align: end; color: #444; font-size: 13px; }
.sqp-m-row > span em { color: #d63638; font-style: normal; }
.sqp-m-row input[type="text"], .sqp-m-row select, .sqp-m-row textarea {
	flex: 1; padding: 9px 11px; border: 1px solid #d8dadd; border-radius: 8px; font-size: 14px;
}
.sqp-m-row[disabled] { opacity: .6; }
.sqp-m-checks { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding-inline-start: 162px; }
.sqp-m-checks label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sqp-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #eee; }

@media (max-width: 600px) {
	.sqp-m-row { flex-direction: column; align-items: stretch; gap: 4px; }
	.sqp-m-row > span { flex: none; text-align: start; }
	.sqp-m-checks { padding-inline-start: 0; }
	.sqp-cfe-table .sqp-c-ph, .sqp-cfe-table .sqp-c-val { display: none; }
}
