/* ==========================================================================
   eSIM Wallet Store — frontend styles
   ========================================================================== */

.ews-notice {
	background: #f6f7f7;
	border-left: 4px solid #6c5ce7;
	padding: 12px 16px;
	margin: 12px 0;
	border-radius: 8px;
}
.ews-notice.ews-error {
	border-left-color: #d63638;
	background: #fcf0f1;
	color: #8a1f1f;
}
.ews-fade-in {
	animation: ews-fade-in 0.35s ease;
}
@keyframes ews-fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Buttons ---------------------------------------------------------------- */

.ews-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: linear-gradient(135deg, #6c5ce7, #4834d4);
	color: #fff !important;
	padding: 10px 20px;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
	box-shadow: 0 2px 8px rgba(108, 92, 231, 0.35);
}
.ews-btn::after {
	content: "";
	position: absolute;
	top: 0;
	left: -60%;
	width: 40%;
	height: 100%;
	background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
	transform: skewX(-20deg);
	transition: left 0.5s ease;
}
.ews-btn:hover::after {
	left: 120%;
}
.ews-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(108, 92, 231, 0.5);
	color: #fff;
}
.ews-btn:active {
	transform: translateY(0);
}
.ews-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}
.ews-btn-secondary {
	background: #f0f0f4;
	color: #2d2d3a !important;
	box-shadow: none;
}
.ews-btn-secondary:hover {
	background: #e2e2ea;
	color: #2d2d3a !important;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Wallet balance (plain text, no background/icon) -------------------------*/

.ews-wallet-pill {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	background: none;
	color: #fff;
	padding: 0;
	border-radius: 0;
	font-size: 19.5px;
	line-height: 1.4;
	margin-bottom: 14px;
	box-shadow: none;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 1px 6px rgba(0, 0, 0, 0.45);
}
.ews-wallet-label {
	opacity: 0.9;
	font-weight: 500;
	color: #fff;
}
.ews-wallet-amount {
	font-weight: 800;
	color: #fff;
}

/* Plan grid ---------------------------------------------------------------*/

.ews-plans-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 24px;
	padding: 18px 20px;
	background: linear-gradient(135deg, #f7f6fd, #fdf6fb);
	border: 1px solid #eeeaf9;
	border-radius: 14px;
}
.ews-filter-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 220px;
	flex: 1;
}
.ews-filter-group label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b6b7c;
}
.ews-input, .ews-select {
	width: 100%;
	padding: 11px 16px;
	border: 1px solid #dcdce6;
	border-radius: 999px;
	font-size: 14px;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ews-select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236c5ce7' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	padding-right: 36px;
	cursor: pointer;
}
.ews-input:focus, .ews-select:focus {
	outline: none;
	border-color: #6c5ce7;
	box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}
.ews-plans-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 18px;
}
.ews-plan-card {
	position: relative;
	overflow: hidden;
	border: 1px solid #ececf3;
	border-radius: 16px;
	padding: 20px 18px 18px;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-shadow: 0 1px 3px rgba(20, 20, 43, 0.06);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	animation: ews-fade-in 0.45s ease both;
}
.ews-plan-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #6c5ce7, #ff6ec7, #4834d4);
	background-size: 200% 100%;
	opacity: 0;
	transition: opacity 0.25s ease;
}
.ews-plan-card:hover {
	transform: translateY(-6px) scale(1.01);
	box-shadow: 0 16px 34px rgba(20, 20, 43, 0.16);
	border-color: #d8d4f7;
}
.ews-plan-card:hover::before {
	opacity: 1;
	animation: ews-accent-slide 1.6s linear infinite;
}
@keyframes ews-accent-slide {
	from { background-position: 0% 0; }
	to   { background-position: 200% 0; }
}
.ews-plans-grid .ews-plan-card:nth-child(1) { animation-delay: 0.02s; }
.ews-plans-grid .ews-plan-card:nth-child(2) { animation-delay: 0.06s; }
.ews-plans-grid .ews-plan-card:nth-child(3) { animation-delay: 0.10s; }
.ews-plans-grid .ews-plan-card:nth-child(4) { animation-delay: 0.14s; }
.ews-plans-grid .ews-plan-card:nth-child(5) { animation-delay: 0.18s; }
.ews-plans-grid .ews-plan-card:nth-child(6) { animation-delay: 0.22s; }
.ews-plan-flags {
	min-height: 22px;
}
.ews-plan-name {
	font-weight: 700;
	font-size: 15px;
	color: #1d1d2b;
}
.ews-plan-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.ews-chip {
	background: #f3f2fb;
	color: #4834d4;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 11px;
	border-radius: 999px;
}
.ews-chip-data {
	background: #e9f9f1;
	color: #0f9d58;
}
.ews-chip-duration {
	background: #eef2fd;
	color: #2b5fd9;
}
.ews-plan-price {
	font-size: 24px;
	font-weight: 800;
	margin-top: auto;
	background: linear-gradient(135deg, #4834d4, #6c5ce7);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

/* Flags -------------------------------------------------------------------*/

.ews-flags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.ews-flag-chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #f6f6fa;
	border-radius: 999px;
	padding: 2px 8px 2px 2px;
	font-size: 11px;
	font-weight: 700;
	color: #4b4b5a;
	cursor: default;
}
.ews-flag-more {
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease;
}
.ews-flag-more:hover,
.ews-flag-more:focus {
	background: #e5e1fa;
	transform: translateY(-1px);
	outline: none;
}
.ews-tooltip {
	display: none;
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #1d1d2b;
	color: #fff;
	font-weight: 500;
	font-size: 11.5px;
	line-height: 1.5;
	padding: 8px 12px;
	border-radius: 8px;
	white-space: nowrap;
	z-index: 20;
	box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.ews-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #1d1d2b;
}
.ews-flag-chip:hover .ews-tooltip,
.ews-flag-chip:focus .ews-tooltip,
.ews-flag-chip:focus-within .ews-tooltip {
	display: block;
}
.ews-flag-img {
	width: 18px;
	height: 13px;
	object-fit: cover;
	border-radius: 3px;
	box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
	display: block;
}
.ews-flag-fallback {
	font-size: 13px;
	line-height: 1;
}
.ews-flag-code {
	letter-spacing: 0.02em;
}
.ews-flag-more {
	background: #ece9fb;
	color: #4834d4;
	padding: 2px 8px;
}

/* Purchase confirmation modal ---------------------------------------------*/

.ews-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 20, 43, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
}
.ews-modal-box {
	background: #fff;
	border-radius: 16px;
	padding: 28px 26px;
	max-width: 380px;
	width: calc(100% - 32px);
	text-align: center;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
	transform: scale(0.92);
	opacity: 0;
	animation: ews-modal-pop 0.2s ease forwards;
}
@keyframes ews-modal-pop {
	to { transform: scale(1); opacity: 1; }
}
.ews-modal-icon {
	font-size: 30px;
	margin-bottom: 6px;
}
.ews-modal-title {
	margin: 0 0 10px;
	font-size: 18px;
	color: #1d1d2b;
}
.ews-modal-plan-name {
	font-weight: 700;
	color: #4834d4;
	margin: 0 0 6px;
}
.ews-modal-amount {
	font-size: 16px;
	margin: 0 0 12px;
	color: #1d1d2b;
}
.ews-modal-warning {
	font-size: 12.5px;
	color: #8a1f1f;
	background: #fcf0f1;
	padding: 10px 12px;
	border-radius: 10px;
	margin: 0 0 18px;
	line-height: 1.5;
}
.ews-modal-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
}
.ews-modal-actions .ews-btn {
	flex: 1;
}

/* "+N countries" modal ------------------------------------------------------*/

.ews-country-modal-box {
	position: relative;
	max-width: 420px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	text-align: left;
	padding: 26px 24px 20px;
}
.ews-modal-close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	color: #8a8a99;
	cursor: pointer;
	padding: 4px;
	transition: color 0.15s ease;
}
.ews-modal-close:hover {
	color: #1d1d2b;
}
.ews-country-modal-box .ews-modal-title {
	text-align: center;
	margin-bottom: 14px;
}
.ews-country-list {
	overflow-y: auto;
	max-height: min(60vh, 420px);
	padding-right: 6px;
	border-top: 1px solid #f0f0f4;
}
.ews-country-group {
	margin-top: 12px;
}
.ews-country-letter {
	position: sticky;
	top: 0;
	background: #fff;
	color: #6c5ce7;
	font-weight: 800;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 6px 0;
	border-bottom: 1px solid #f0f0f4;
}
.ews-country-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 2px;
	font-size: 14px;
	color: #2d2d3a;
	border-bottom: 1px solid #f6f6fa;
}
.ews-country-item:last-child {
	border-bottom: none;
}
.ews-country-code {
	font-size: 11px;
	font-weight: 700;
	color: #8a8a99;
	background: #f6f6fa;
	padding: 2px 8px;
	border-radius: 999px;
}

/* Plans pagination -----------------------------------------------------------*/

.ews-plans-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
}
.ews-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-top: 28px;
}
.ews-page-indicator {
	font-size: 13px;
	font-weight: 700;
	color: #6b6b7c;
}

/* Top-up modal ----------------------------------------------------------------*/

.ews-topup-modal-box {
	max-width: 440px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	text-align: left;
	padding: 26px 24px 20px;
}
.ews-topup-modal-box .ews-modal-title {
	text-align: center;
	margin-bottom: 14px;
}
.ews-topup-list {
	overflow-y: auto;
	max-height: min(60vh, 420px);
	padding-right: 6px;
	border-top: 1px solid #f0f0f4;
}
.ews-topup-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 12px 2px;
	border-bottom: 1px solid #f6f6fa;
}
.ews-topup-option:last-child {
	border-bottom: none;
}
.ews-topup-option-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.ews-topup-option-name {
	font-weight: 700;
	font-size: 13.5px;
	color: #1d1d2b;
}
.ews-topup-option-meta {
	font-size: 11.5px;
	color: #8a8a99;
}
.ews-topup-option .ews-btn {
	flex-shrink: 0;
	padding: 8px 16px;
	font-size: 13px;
}

/* Purchase result -----------------------------------------------------------*/

.ews-purchase-result {
	margin-top: 22px;
}

/* Orders list ---------------------------------------------------------------*/

.ews-order-row {
	border: 1px solid #ececf3;
	border-radius: 14px;
	padding: 16px 20px;
	margin-bottom: 14px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(20, 20, 43, 0.05);
	transition: box-shadow 0.15s ease;
}
.ews-order-row:hover {
	box-shadow: 0 6px 18px rgba(20, 20, 43, 0.08);
}
.ews-order-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
	justify-content: space-between;
}
.ews-order-plan {
	font-weight: 700;
	color: #1d1d2b;
}
.ews-order-status {
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.ews-status-ready { background: #e8f9ee; color: #1a7f37; }
.ews-status-processing, .ews-status-pending { background: #fff6e0; color: #9a6700; }
.ews-status-failed, .ews-status-cancelled { background: #fcf0f1; color: #8a1f1f; }
.ews-order-details {
	margin-top: 16px;
	border-top: 1px solid #f0f0f4;
	padding-top: 16px;
}
.ews-qr-image {
	max-width: 170px;
	display: block;
	margin-bottom: 12px;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.ews-activation-code code, .ews-iccid code {
	display: block;
	background: #f6f6fa;
	padding: 9px 12px;
	border-radius: 8px;
	margin: 4px 0 12px;
	word-break: break-all;
	font-size: 12.5px;
}
.ews-usage-result {
	margin-top: 12px;
	font-size: 13px;
	color: #4b4b5a;
}

/* Misc ----------------------------------------------------------------------*/

.ews-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,0.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ews-spin 0.7s linear infinite;
	vertical-align: middle;
}
@keyframes ews-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
	.ews-plans-grid {
		grid-template-columns: 1fr;
	}
	.ews-order-summary {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
}
