/* Delivery & Gift Experience — Frontend Styles
   RTL / Arabic-first, FNP-inspired card & popup UI. */

.dge-cards-wrap,
.dge-cart-sections {
	direction: rtl;
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 20px 0;
	font-family: inherit;
}

/* ---------- Cards ---------- */
.dge-card {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--dge-bg, #fff);
	border: 1px solid var(--dge-border, #e8e8e8);
	border-radius: var(--dge-radius, 14px);
	padding: 14px 16px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	cursor: pointer;
}

.dge-card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	transform: translateY(-1px);
}

.dge-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-width: 40px;
	border-radius: 50%;
	background: rgba(217, 79, 67, 0.08);
	color: var(--dge-primary, #d94f43);
}

.dge-card-icon .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.dge-card-body {
	flex: 1;
	min-width: 0;
}

.dge-card-title {
	font-weight: 700;
	font-size: 15px;
	color: #222;
}

.dge-card-subtitle {
	font-size: 13px;
	color: #8a8a8a;
	margin-top: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dge-card-subtitle.dge-card-value {
	color: var(--dge-primary, #d94f43);
	font-weight: 600;
}

.dge-card-btn {
	background: transparent;
	border: 1.5px solid var(--dge-primary, #d94f43);
	color: var(--dge-primary, #d94f43);
	border-radius: 999px;
	padding: 8px 18px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.dge-card-btn:hover {
	background: var(--dge-primary, #d94f43);
	color: #fff;
}

/* ---------- Cart / panels ---------- */
.dge-panel {
	background: var(--dge-bg, #fff);
	border: 1px solid var(--dge-border, #e8e8e8);
	border-radius: var(--dge-radius, 14px);
	padding: 16px;
}

.dge-panel-title {
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 12px;
	color: #222;
}

/* ---------- Chips ---------- */
.dge-chip-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.dge-chip {
	background: #f7f4ef;
	border: 1px solid var(--dge-border, #e8e8e8);
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 13px;
	color: #444;
	cursor: pointer;
	transition: all 0.15s ease;
}

.dge-chip:hover {
	border-color: var(--dge-primary, #d94f43);
}

.dge-chip.is-selected {
	background: var(--dge-primary, #d94f43);
	border-color: var(--dge-primary, #d94f43);
	color: #fff;
}

/* ---------- Popup overlay ---------- */
.dge-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 20, 20, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease;
	padding: 16px;
	direction: rtl;
}

.dge-popup-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.dge-popup {
	background: var(--dge-bg, #fff);
	border-radius: var(--dge-radius, 14px);
	width: 100%;
	max-width: 560px;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	transform: translateY(16px) scale(0.98);
	transition: transform 0.25s ease;
}

.dge-popup-overlay.is-open .dge-popup {
	transform: translateY(0) scale(1);
}

.dge-popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid var(--dge-border, #e8e8e8);
}

.dge-popup-header h2 {
	margin: 0;
	font-size: 17px;
	font-weight: 800;
}

.dge-popup-close {
	background: #f5f5f5;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #666;
}

.dge-popup-close:hover {
	background: #ebebeb;
}

.dge-popup-body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}

.dge-popup-section + .dge-popup-section {
	margin-top: 22px;
}

.dge-section-title {
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 12px;
	color: #222;
}

.dge-popup-footer {
	padding: 16px 20px;
	border-top: 1px solid var(--dge-border, #e8e8e8);
}

/* ---------- Date scroller ---------- */
.dge-date-scroller {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 4px;
	scroll-snap-type: x proximity;
}

.dge-date-card {
	flex: 0 0 auto;
	scroll-snap-align: start;
	min-width: 76px;
	background: #fff;
	border: 1.5px solid var(--dge-border, #e8e8e8);
	border-radius: 12px;
	padding: 10px 8px;
	text-align: center;
	cursor: pointer;
	transition: all 0.15s ease;
}

.dge-date-card:hover {
	border-color: var(--dge-primary, #d94f43);
}

.dge-date-card.is-selected {
	background: var(--dge-primary, #d94f43);
	border-color: var(--dge-primary, #d94f43);
	color: #fff;
}

.dge-date-label {
	display: block;
	font-weight: 700;
	font-size: 13px;
}

.dge-date-sub {
	display: block;
	font-size: 11px;
	opacity: 0.8;
	margin-top: 2px;
}

/* ---------- Slot grid ---------- */
.dge-slot-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.dge-slot-card {
	background: #fff;
	border: 1.5px solid var(--dge-border, #e8e8e8);
	border-radius: 12px;
	padding: 12px 10px;
	text-align: center;
	cursor: pointer;
	transition: all 0.15s ease;
}

.dge-slot-card:hover {
	border-color: var(--dge-primary, #d94f43);
}

.dge-slot-card.is-selected {
	background: rgba(217, 79, 67, 0.08);
	border-color: var(--dge-primary, #d94f43);
}

.dge-slot-time {
	display: block;
	font-weight: 700;
	font-size: 13px;
	color: #222;
}

.dge-slot-fee {
	display: block;
	font-size: 12px;
	color: var(--dge-primary, #d94f43);
	margin-top: 4px;
}

/* ---------- Textarea / select ---------- */
.dge-textarea {
	width: 100%;
	min-height: 90px;
	border: 1.5px solid var(--dge-border, #e8e8e8);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	resize: vertical;
	font-family: inherit;
}

.dge-textarea:focus,
.dge-select:focus {
	outline: none;
	border-color: var(--dge-primary, #d94f43);
}

.dge-char-counter {
	text-align: left;
	font-size: 12px;
	color: #999;
	margin-top: 4px;
}

.dge-select {
	width: 100%;
	border: 1.5px solid var(--dge-border, #e8e8e8);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	background: #fff;
	font-family: inherit;
}

/* ---------- Design grid ---------- */
.dge-design-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.dge-design-card {
	background: #fff;
	border: 1.5px solid var(--dge-border, #e8e8e8);
	border-radius: 12px;
	padding: 8px;
	cursor: pointer;
	text-align: center;
	transition: all 0.15s ease;
}

.dge-design-card:hover {
	border-color: var(--dge-primary, #d94f43);
}

.dge-design-card.is-selected {
	border-color: var(--dge-primary, #d94f43);
	box-shadow: 0 0 0 2px rgba(217, 79, 67, 0.2);
}

.dge-design-image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1;
	background: #f7f4ef;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 6px;
}

.dge-design-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dge-design-name {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #222;
}

.dge-design-price {
	display: block;
	font-size: 11px;
	color: var(--dge-primary, #d94f43);
	margin-top: 2px;
}

/* ---------- Buttons ---------- */
.dge-btn-primary {
	background: var(--dge-primary, #d94f43);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 13px 24px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.dge-btn-primary:hover {
	opacity: 0.92;
}

.dge-btn-primary:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.dge-btn-block {
	width: 100%;
}

.dge-link-btn {
	background: none;
	border: none;
	color: var(--dge-primary, #d94f43);
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	padding: 0;
	margin-top: 6px;
}

/* ---------- Checkout ---------- */
.dge-checkout-block {
	margin-bottom: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.dge-checkout-section {
	background: var(--dge-bg, #fff);
	border: 1px solid var(--dge-border, #e8e8e8);
	border-radius: var(--dge-radius, 14px);
	padding: 14px 16px;
}

.dge-checkout-heading {
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 8px;
}

.dge-checkout-row {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	padding: 4px 0;
}

.dge-checkout-label {
	color: #888;
}

.dge-checkout-value {
	font-weight: 600;
	color: #222;
}

.dge-checkout-empty {
	font-size: 13px;
	color: #999;
	margin: 0 0 8px;
}

/* ---------- Order meta (admin & my account) ---------- */
.dge-admin-order-meta,
.dge-account-order-meta {
	margin-top: 20px;
	border: 1px solid var(--dge-border, #e8e8e8);
	border-radius: 10px;
	padding: 14px 16px;
}

.dge-admin-order-meta h3,
.dge-account-order-meta h3 {
	margin-top: 0;
	font-size: 14px;
}

.dge-admin-order-meta ul,
.dge-account-order-meta ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dge-admin-order-meta li,
.dge-account-order-meta li {
	padding: 4px 0;
	font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
	.dge-slot-grid,
	.dge-design-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.dge-popup {
		max-height: 92vh;
	}
}

body.rtl .dge-cards-wrap,
body:not(.rtl) .dge-cards-wrap {
	direction: rtl;
}
