/* Asmen COD Form — RTL order form
   Selectors are kept specific and a few declarations are forced, because
   WooCommerce themes style bare input/select elements aggressively. */

.asmen-wrap {
	--asmen-primary: #16b9f0;
	--asmen-accent: #8f86d8;
	--asmen-ink: #1f2330;
	--asmen-muted: #9aa0b4;
	--asmen-line: #e8e8f0;
	--asmen-card-line: #e4e0fb;
	--asmen-soft: #f7f7fb;
	--asmen-chip-bg: #e9f8ff;
	--asmen-h: 54px;

	direction: rtl;
	text-align: right;
	max-width: 620px;
	margin: 0 auto 28px;
	color: var(--asmen-ink);
	font-family: "Tajawal", "Cairo", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.asmen-wrap *,
.asmen-wrap *::before,
.asmen-wrap *::after { box-sizing: border-box; }

.asmen-wrap .asmen-svg { width: 19px; height: 19px; display: block; flex: none; }

/* ── Heading ─────────────────────────────────────────────── */
.asmen-wrap .asmen-title {
	margin: 0 0 4px;
	font-size: 1.55rem;
	font-weight: 800;
	text-align: center;
	color: var(--asmen-ink);
}

.asmen-wrap .asmen-subtitle {
	margin: 0 0 14px;
	text-align: center;
	color: #5f6478;
	font-size: 1rem;
}

.asmen-wrap .asmen-pricerow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.asmen-wrap .asmen-prices { display: inline-flex; align-items: baseline; gap: 10px; }

.asmen-wrap .asmen-price-now {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--asmen-primary);
	text-decoration: none;
	background: none;
}

.asmen-wrap .asmen-pricerow del { color: var(--asmen-muted); font-size: 1.05rem; font-weight: 700; }
.asmen-wrap .asmen-rating { display: inline-flex; align-items: center; gap: 6px; }
.asmen-wrap .asmen-stars { color: #f6b81c; letter-spacing: 3px; font-size: 1.05rem; }
.asmen-wrap .asmen-rating-num { color: var(--asmen-muted); font-size: .82rem; }

/* ── Card ────────────────────────────────────────────────── */
.asmen-wrap .asmen-card {
	background: #fff;
	border: 1px solid var(--asmen-card-line);
	border-radius: 18px;
	padding: 16px;
	box-shadow: 0 10px 30px rgba(67, 62, 120, .06);
}

.asmen-wrap .asmen-warn {
	background: #fff4e5;
	border: 1px solid #ffd9a3;
	color: #8a5a00;
	border-radius: 12px;
	padding: 10px 12px;
	font-size: .88rem;
	margin: 0 0 12px;
}

.asmen-wrap .asmen-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 12px;
}

/* ── Fields ──────────────────────────────────────────────── */
.asmen-wrap .asmen-field {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 10px;
	background: #fff;
	border: 1px solid var(--asmen-line);
	border-radius: 14px;
	padding: 0 14px;
	overflow: visible;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.asmen-wrap .asmen-field:focus-within {
	border-color: var(--asmen-primary);
	box-shadow: 0 0 0 3px rgba(22, 185, 240, .14);
}

.asmen-wrap .asmen-field-full { margin-bottom: 12px; }
.asmen-wrap .asmen-ico { color: var(--asmen-muted); display: flex; align-items: center; }

/* The forced declarations below stop theme stylesheets from re-sizing the
   controls, which is what clipped the text in the first build. */
.asmen-wrap .asmen-field input,
.asmen-wrap .asmen-field select,
.asmen-wrap .asmen-qty-input {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	height: var(--asmen-h) !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	outline: 0 !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	line-height: normal !important;
	color: var(--asmen-ink) !important;
	text-align: right !important;
	vertical-align: middle;
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	text-overflow: ellipsis;
}

.asmen-wrap .asmen-field input::placeholder { color: var(--asmen-muted); opacity: 1; }
.asmen-wrap .asmen-field select { cursor: pointer; padding-inline-start: 24px !important; }
.asmen-wrap .asmen-field select option { color: #1f2330; background: #fff; }

/* select caret, pinned to the left edge in RTL */
.asmen-wrap .asmen-select::after {
	content: "";
	position: absolute;
	inset-inline-start: 15px;
	top: 50%;
	width: 9px;
	height: 9px;
	margin-top: -6px;
	border-left: 2px solid #b0b5c6;
	border-bottom: 2px solid #b0b5c6;
	transform: rotate(-45deg);
	pointer-events: none;
}

.asmen-wrap .asmen-field.asmen-invalid {
	border-color: #ef4d68;
	box-shadow: 0 0 0 3px rgba(239, 77, 104, .12);
}

/* ── Shipping mode ───────────────────────────────────────── */
.asmen-wrap .asmen-shipmode { display: flex; gap: 10px; margin-bottom: 12px; }

.asmen-wrap .asmen-shipopt {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	border: 1px solid var(--asmen-line);
	border-radius: 14px;
	padding: 13px 8px;
	font-size: .95rem;
	cursor: pointer;
	background: #fff;
	text-align: center;
}

.asmen-wrap .asmen-shipopt input {
	accent-color: var(--asmen-primary);
	width: 16px; height: 16px;
	margin: 0 !important;
	flex: none;
}

.asmen-wrap .asmen-shipopt:has(input:checked) {
	border-color: var(--asmen-primary);
	background: var(--asmen-chip-bg);
	color: #0b7fa8;
	font-weight: 700;
}

/* ── Label / value rows ──────────────────────────────────── */
.asmen-wrap .asmen-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 2px;
}

.asmen-wrap .asmen-row-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: .96rem;
}

.asmen-wrap .asmen-row-label .asmen-svg { color: var(--asmen-primary); }

.asmen-wrap .asmen-chip {
	background: var(--asmen-primary);
	color: #fff;
	border-radius: 9px;
	padding: 7px 13px;
	font-size: .83rem;
	font-weight: 700;
	white-space: nowrap;
}

.asmen-wrap .asmen-chip-soft { background: var(--asmen-chip-bg); color: var(--asmen-primary); }

/* ── Options block ───────────────────────────────────────── */
.asmen-wrap .asmen-options {
	border: 1px solid var(--asmen-line);
	border-radius: 16px;
	overflow: hidden;
	margin: 6px 0 16px;
	background: #fff;
}

.asmen-wrap .asmen-options-head,
.asmen-wrap .asmen-summary-head {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	border: 0;
	border-bottom: 1px solid var(--asmen-line);
	padding: 12px 14px;
	margin: 0;
	font-family: inherit;
	font-size: 1rem;
	color: inherit;
	cursor: pointer;
	text-align: right;
	box-shadow: none;
}

.asmen-wrap .asmen-head-title { flex: 1; font-weight: 700; }

.asmen-wrap .asmen-circle {
	width: 36px; height: 36px; flex: none;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--asmen-chip-bg);
	color: var(--asmen-primary);
	border-radius: 50%;
}

.asmen-wrap .asmen-square {
	width: 40px; height: 40px; flex: none;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--asmen-line);
	border-radius: 12px;
	color: var(--asmen-accent);
}

.asmen-wrap .asmen-badge {
	background: var(--asmen-accent);
	color: #fff;
	border-radius: 10px;
	padding: 6px 14px;
	font-size: .85rem;
	font-weight: 700;
	white-space: nowrap;
}

.asmen-wrap .asmen-caret {
	width: 36px; height: 36px; flex: none;
	display: inline-flex; align-items: center; justify-content: center;
	background: #f2f0fd;
	border-radius: 10px;
}

.asmen-wrap .asmen-caret::after {
	content: "";
	width: 8px; height: 8px;
	border-left: 2px solid #6f6a9a;
	border-top: 2px solid #6f6a9a;
	transform: rotate(45deg) translate(1px, 1px);
	transition: transform .2s ease;
}

.asmen-wrap [data-open="0"] .asmen-caret::after { transform: rotate(-135deg) translate(-1px, -1px); }

.asmen-wrap .asmen-options-body { padding: 12px; background: var(--asmen-soft); }
.asmen-wrap [data-open="0"] .asmen-options-body,
.asmen-wrap [data-open="0"] .asmen-summary-body { display: none; }

/* one card per piece, with its own header */
.asmen-wrap .asmen-item {
	background: #fff;
	border: 1px solid #e9e7f4;
	border-radius: 14px;
	padding: 12px;
	margin-bottom: 10px;
}

.asmen-wrap .asmen-item:last-child { margin-bottom: 0; }

.asmen-wrap .asmen-item-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px dashed #e9e7f4;
}

.asmen-wrap .asmen-item-num { background: #efedfb; color: #5f5a8c; padding: 4px 12px; }
.asmen-wrap .asmen-item-label { font-size: .9rem; font-weight: 700; color: #6f6a9a; }
.asmen-wrap .asmen-item-selects { display: grid; gap: 10px; }
.asmen-wrap .asmen-item-selects .asmen-field { background: #fcfcfe; border-color: #eeedf5; }

/* ── Quantity + buy ──────────────────────────────────────── */
.asmen-wrap .asmen-buyrow {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
}

.asmen-wrap .asmen-qty {
	display: inline-flex;
	align-items: center;
	background: #fff;
	border: 1px solid var(--asmen-line);
	border-radius: 14px;
	overflow: hidden;
	flex: none;
}

.asmen-wrap .asmen-qty button {
	width: 44px;
	height: var(--asmen-h);
	border: 0;
	background: #fff;
	font-size: 1.3rem;
	line-height: 1;
	color: #3b3f52;
	cursor: pointer;
	padding: 0;
	box-shadow: none;
	border-radius: 0;
}

.asmen-wrap .asmen-qty button:hover { background: #f4f4fa; }

.asmen-wrap .asmen-qty-input {
	width: 44px !important;
	text-align: center !important;
	font-weight: 800 !important;
}

.asmen-wrap .asmen-buy {
	position: relative;
	flex: 1 1 auto;
	border: 0;
	border-radius: 14px;
	background: var(--asmen-primary);
	color: #fff;
	font-family: inherit;
	font-size: 1.1rem;
	font-weight: 800;
	padding: 17px 16px;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(22, 185, 240, .35);
	transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}

.asmen-wrap .asmen-buy:hover { box-shadow: 0 12px 30px rgba(22, 185, 240, .45); }
.asmen-wrap .asmen-buy:active { transform: translateY(1px); }
.asmen-wrap .asmen-buy[disabled] { opacity: .65; cursor: progress; }

.asmen-wrap .asmen-buy-badge {
	position: absolute;
	top: -12px;
	inset-inline-end: 12px;
	background: #fff;
	color: var(--asmen-ink);
	border-radius: 10px;
	padding: 5px 14px;
	font-size: .9rem;
	font-weight: 800;
	box-shadow: 0 4px 12px rgba(31, 35, 48, .14);
}

/* ── Messages ────────────────────────────────────────────── */
.asmen-wrap .asmen-message { margin-top: 12px; font-weight: 700; font-size: .93rem; }
.asmen-wrap .asmen-message:empty { margin: 0; }
.asmen-wrap .asmen-message.is-error { color: #d9304f; }
.asmen-wrap .asmen-message.is-ok { color: #159a5c; }

/* ── Order summary ───────────────────────────────────────── */
.asmen-wrap .asmen-summary { margin-top: 16px; border-top: 1px solid var(--asmen-line); }
.asmen-wrap .asmen-summary-head { border-bottom: 0; padding: 14px 2px; }
.asmen-wrap .asmen-summary-titles { flex: 1; display: flex; flex-direction: column; }
.asmen-wrap .asmen-summary-title { color: var(--asmen-accent); font-weight: 700; }
.asmen-wrap .asmen-summary-sub { color: var(--asmen-muted); font-size: .84rem; }
.asmen-wrap .asmen-summary-body { background: #fff; }

.asmen-wrap .asmen-line {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 2px;
	border-top: 1px solid var(--asmen-line);
}

.asmen-wrap .asmen-line img { width: 58px; height: 58px; object-fit: cover; border-radius: 10px; flex: none; }
.asmen-wrap .asmen-line-name { flex: 1; font-weight: 700; font-size: .95rem; }
.asmen-wrap .asmen-line-meta { display: block; font-weight: 500; font-size: .8rem; color: var(--asmen-muted); }

.asmen-wrap .asmen-line-qty {
	background: var(--asmen-primary);
	color: #fff;
	border-radius: 8px;
	padding: 3px 9px;
	font-size: .78rem;
	font-weight: 700;
}

.asmen-wrap .asmen-line-price { font-weight: 700; white-space: nowrap; }
.asmen-wrap .asmen-summary-row { border-top: 1px solid var(--asmen-line); }

/* ── Small screens ───────────────────────────────────────── */
@media (max-width: 520px) {
	.asmen-wrap { font-size: 15px; }
	.asmen-wrap .asmen-grid { grid-template-columns: 1fr; }
	.asmen-wrap .asmen-title { font-size: 1.25rem; }
	.asmen-wrap .asmen-card { padding: 12px; border-radius: 16px; }
	.asmen-wrap .asmen-buy { font-size: 1rem; padding: 16px 10px; }
	.asmen-wrap .asmen-shipmode { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	.asmen-wrap * { transition: none !important; }
}
