/**
 * Module: Quick-Select Variation Popup Styles
 * Description: Lightweight, mobile-first Bottom-Sheet & Desktop Centered Modal
 *              for on-demand variation selection on catalog loops and carousels.
 * Author: Arovi Engineering
 * Version: 1.0.0
 */

/* ==========================================================================
   1. MODAL WRAPPER & BACKDROP
   ========================================================================== */
.ast-quick-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100vw;
	height: 100vh;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	box-sizing: border-box;
}

.ast-quick-modal.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Prevent body scrolling when modal is open */
html.ast-quick-modal-open,
html.ast-quick-modal-open body {
	overflow: hidden !important;
}

/* Backdrop Overlay (Glass Blur Effect) */
.ast-quick-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	cursor: pointer;
}

/* ==========================================================================
   2. MODAL DIALOG CONTAINER
   ========================================================================== */
.ast-quick-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: 90vh;
	background: var(--ast-global-color-5, #ffffff);
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.08);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	z-index: 2;
	padding: 24px 22px;
	transform: scale(0.94) translateY(10px);
	transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
	will-change: transform;
	box-sizing: border-box;
}

.ast-quick-modal.is-active .ast-quick-modal-dialog {
	transform: scale(1) translateY(0);
}

/* Close Button (Circular Glass Pill) */
.ast-quick-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	color: #64748b;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
	z-index: 3;
}

.ast-quick-modal-close:hover {
	background: #e2e8f0;
	color: #0f172a;
	transform: rotate(90deg);
}

/* ==========================================================================
   3. LOADING SKELETON
   ========================================================================== */
.ast-quick-loading-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 44px 0;
	text-align: center;
}

.ast-quick-loading-wrap .ast-child-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: var(--ast-global-color-0, #8f2b8c);
	border-radius: 50%;
	animation: astChildSpin 0.7s linear infinite;
}

.ast-quick-loading-text {
	margin-top: 14px;
	font-size: 13.5px;
	font-weight: 500;
	color: #64748b;
}

/* ==========================================================================
   4. MODAL CONTENT: HEADER (IMAGE + TITLE + PRICE)
   ========================================================================== */
.ast-quick-modal-header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-right: 32px;
}

.ast-quick-modal-thumb {
	width: 68px;
	height: 68px;
	min-width: 68px;
	border-radius: 10px;
	overflow: hidden;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ast-quick-modal-thumb a {
	display: block;
	width: 100%;
	height: 100%;
}

.ast-quick-modal-thumb img,
.ast-quick-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ast-quick-modal-info {
	flex: 1;
	min-width: 0;
}

.ast-quick-modal-title {
	font-size: 15.5px;
	font-weight: 700;
	color: var(--ast-global-color-2, #0f172a);
	margin: 0 0 4px 0;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ast-quick-modal-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.ast-quick-modal-title a:hover {
	color: var(--ast-global-color-0, #8f2b8c);
}

.ast-quick-modal-price {
	font-size: 17px;
	font-weight: 800;
	color: var(--ast-global-color-0, #8f2b8c);
	margin-bottom: 3px;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.ast-quick-modal-price del {
	font-size: 13.5px;
	font-weight: 500;
	color: #94a3b8;
}

.ast-quick-modal-price ins {
	text-decoration: none;
	color: var(--ast-global-color-0, #8f2b8c);
}

.ast-quick-modal-stock {
	font-size: 12.5px !important;
	font-weight: 600 !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
}

.ast-quick-modal-stock .ast-stock-in {
	color: #15803d !important;
	background: #dcfce7 !important;
	padding: 2.5px 9px !important;
	border-radius: 4px !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 5px !important;
	line-height: 1.2 !important;
}

.ast-quick-modal-stock .ast-stock-in::before {
	content: '' !important;
	display: inline-block !important;
	width: 6px !important;
	height: 6px !important;
	border-radius: 50% !important;
	background-color: #16a34a !important;
}

.ast-quick-modal-stock .ast-stock-out {
	color: #b91c1c !important;
	background: #fee2e2 !important;
	padding: 2.5px 9px !important;
	border-radius: 4px !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 5px !important;
	line-height: 1.2 !important;
}

.ast-quick-modal-stock .ast-stock-out::before {
	content: '' !important;
	display: inline-block !important;
	width: 6px !important;
	height: 6px !important;
	border-radius: 50% !important;
	background-color: #dc2626 !important;
}

.ast-quick-modal-stock .ast-stock-prompt {
	color: #64748b !important;
	font-size: 12.5px !important;
}

.ast-quick-modal-divider {
	height: 1px;
	background: #f1f5f9;
	margin: 16px 0;
}

/* ==========================================================================
   5. ATTRIBUTES & SWATCH BUTTONS
   ========================================================================== */
.ast-quick-attr-group {
	margin-bottom: 16px;
}

.ast-quick-attr-header {
	font-size: 13px;
	font-weight: 600;
	color: var(--ast-global-color-2, #334155);
	margin-bottom: 8px;
}

.ast-quick-selected-label {
	color: var(--ast-global-color-0, #8f2b8c);
	font-weight: 700;
	margin-left: 4px;
}

.ast-quick-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ast-quick-swatch-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 38px;
	padding: 0 16px;
	background: var(--ast-global-color-5, #ffffff);
	border: 1.5px solid var(--ast-border-color, #cfd5dc);
	border-radius: 6px;
	color: var(--ast-global-color-2, #1e293b);
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	outline: none;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: all 0.18s cubic-bezier(0.25, 1, 0.5, 1);
	box-sizing: border-box;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.ast-quick-swatch-btn:hover:not(.is-disabled) {
	border-color: var(--ast-global-color-0, #8f2b8c);
	color: var(--ast-global-color-0, #8f2b8c);
	background: var(--ast-global-color-4, #faf5fa);
	transform: translateY(-1px);
}

.ast-quick-swatch-btn.is-selected {
	background: var(--ast-global-color-0, #8f2b8c);
	border-color: var(--ast-global-color-0, #8f2b8c);
	color: #ffffff;
	box-shadow: 0 2px 8px var(--ast-btn-shadow-color, rgba(0, 0, 0, 0.12));
	transform: translateY(-1px);
}

.ast-quick-swatch-btn.is-disabled {
	opacity: 0.4;
	cursor: not-allowed;
	text-decoration: line-through;
	background: #f8fafc;
	border-color: #e2e8f0;
	color: #94a3b8;
	box-shadow: none;
	transform: none;
}

/* ==========================================================================
   6. QUANTITY SELECTOR ROW
   ========================================================================== */
.ast-quick-qty-row {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	padding: 14px 0 16px 0 !important;
	border-top: 1px dashed #e2e8f0 !important;
	margin-top: 4px !important;
}

.ast-quick-qty-label {
	font-size: 13.5px !important;
	font-weight: 600 !important;
	color: var(--ast-global-color-2, #334155) !important;
	letter-spacing: 0.2px !important;
}

.ast-quick-qty-box {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	border: 1.5px solid var(--ast-border-color, #cbd5e1) !important;
	border-radius: 8px !important;
	overflow: hidden !important;
	background: #ffffff !important;
	height: 38px !important;
	box-sizing: border-box !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.ast-quick-modal .ast-quick-qty-box .ast-quick-qty-btn,
.ast-quick-qty-box .ast-quick-qty-btn {
	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	max-width: 38px !important;
	background: #f8fafc !important;
	border: none !important;
	color: var(--ast-global-color-2, #334155) !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: background 0.15s ease, color 0.15s ease !important;
	user-select: none !important;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 1 !important;
	outline: none !important;
	box-shadow: none !important;
}

.ast-quick-modal .ast-quick-qty-box .ast-quick-qty-btn:hover,
.ast-quick-qty-box .ast-quick-qty-btn:hover {
	background: #e2e8f0 !important;
	color: var(--ast-global-color-0, #8f2b8c) !important;
}

.ast-quick-modal .ast-quick-qty-box .ast-quick-qty-btn:active,
.ast-quick-qty-box .ast-quick-qty-btn:active {
	background: #cbd5e1 !important;
}

.ast-quick-modal .ast-quick-qty-box input.ast-quick-qty-input,
.ast-quick-qty-box input.ast-quick-qty-input,
.ast-quick-qty-box .ast-quick-qty-input {
	width: 48px !important;
	min-width: 48px !important;
	max-width: 48px !important;
	height: 38px !important;
	border: none !important;
	border-left: 1px solid var(--ast-border-color, #e2e8f0) !important;
	border-right: 1px solid var(--ast-border-color, #e2e8f0) !important;
	text-align: center !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	color: var(--ast-global-color-2, #0f172a) !important;
	padding: 0 !important;
	margin: 0 !important;
	background: #ffffff !important;
	box-shadow: none !important;
	outline: none !important;
	border-radius: 0 !important;
	pointer-events: none !important;
	-moz-appearance: textfield !important;
	appearance: textfield !important;
}

.ast-quick-modal .ast-quick-qty-box input.ast-quick-qty-input::-webkit-outer-spin-button,
.ast-quick-modal .ast-quick-qty-box input.ast-quick-qty-input::-webkit-inner-spin-button,
.ast-quick-qty-box input.ast-quick-qty-input::-webkit-outer-spin-button,
.ast-quick-qty-box input.ast-quick-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	appearance: none !important;
	margin: 0 !important;
	display: none !important;
}

/* ==========================================================================
   7. MODAL ACTION BUTTONS (DUAL BUTTONS)
   ========================================================================== */
.ast-quick-modal-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 14px;
}

.ast-quick-btn {
	height: 44px;
	border-radius: var(--ast-btn-radius, 8px);
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	outline: none;
	border: none;
	text-decoration: none;
	box-sizing: border-box;
	user-select: none;
}

/* Secondary CTA: "কার্টে রাখুন" */
.ast-quick-btn-cart {
	background: var(--ast-btn-secondary-bg, var(--ast-global-color-4, #ffffff));
	color: var(--ast-btn-secondary-color, var(--ast-btn-primary-bg, var(--ast-global-color-0, #8f2b8c)));
	border: 2px solid var(--ast-btn-secondary-border, var(--ast-btn-primary-bg, var(--ast-global-color-0, #8f2b8c)));
	border-radius: var(--ast-btn-secondary-radius, var(--ast-btn-radius, 8px));
	box-shadow: 0 2px 6px var(--ast-btn-shadow-color, rgba(0, 0, 0, 0.08));
}

.ast-quick-btn-cart:hover:not(.disabled) {
	background: var(--ast-btn-secondary-h-bg, var(--ast-global-color-5, #f0f5fa));
	border-color: var(--ast-btn-secondary-border, var(--ast-btn-primary-bg, var(--ast-global-color-0, #8f2b8c)));
	color: var(--ast-btn-secondary-h-color, var(--ast-btn-primary-bg, var(--ast-global-color-0, #8f2b8c)));
	transform: translateY(-1.5px);
	box-shadow: 0 4px 12px var(--ast-btn-shadow-hover, rgba(0, 0, 0, 0.14));
}

/* Primary CTA: "অর্ডার করুন" */
.ast-quick-btn-order {
	background: var(--ast-btn-primary-bg, var(--ast-global-color-0, #8f2b8c));
	color: var(--ast-btn-primary-color, #ffffff);
	border: 1.5px solid var(--ast-btn-primary-bg, var(--ast-global-color-0, #8f2b8c));
	border-radius: var(--ast-btn-radius, 8px);
	box-shadow: 0 3px 10px var(--ast-btn-shadow-color, rgba(0, 0, 0, 0.12));
}

.ast-quick-btn-order:hover:not(.disabled) {
	background: var(--ast-btn-primary-h-bg, var(--ast-global-color-1, #f48736));
	border-color: var(--ast-btn-primary-h-bg, var(--ast-global-color-1, #f48736));
	color: var(--ast-btn-primary-h-color, #ffffff);
	transform: translateY(-1.5px);
	box-shadow: 0 5px 15px var(--ast-btn-shadow-hover, rgba(0, 0, 0, 0.18));
}

/* Disabled State */
.ast-quick-btn.disabled,
.ast-quick-btn:disabled {
	background: #f1f5f9;
	border: 1.5px solid #cbd5e1;
	color: #94a3b8;
	cursor: not-allowed;
	opacity: 0.65;
	transform: none;
	box-shadow: none;
	pointer-events: none;
}

/* Loading State */
.ast-quick-btn.loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}

.ast-quick-btn.loading::after {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	border: 2.5px solid rgba(0, 0, 0, 0.12);
	border-top-color: var(--ast-btn-primary-bg, var(--ast-global-color-0, #8f2b8c));
	border-radius: 50%;
	animation: astChildSpin 0.65s linear infinite;
}

.ast-quick-btn-order.loading::after {
	border-color: rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
}

/* ==========================================================================
   8. VIEW FULL DETAILS LINK (SIMPLE TEXT LINK - NO BUTTON)
   ========================================================================== */
.ast-quick-details-link-wrap {
	text-align: center;
	margin-top: 13px;
	padding-top: 2px;
}

.ast-quick-details-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 500;
	color: #64748b;
	text-decoration: none;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	padding: 2px 6px !important;
	margin: 0 auto !important;
	line-height: 1.4;
	transition: color 0.15s ease;
	cursor: pointer;
}

.ast-quick-details-link:hover {
	color: var(--ast-global-color-0, #8f2b8c) !important;
	text-decoration: underline;
	background: none !important;
}

/* ==========================================================================
   9. MOBILE RESPONSIVENESS (BOTTOM-SHEET DRAWER STYLE)
   ========================================================================== */
@media (max-width: 540px) {
	.ast-quick-modal {
		align-items: flex-end;
	}

	.ast-quick-modal-dialog {
		max-width: 100%;
		border-radius: 20px 20px 0 0;
		padding: 22px 18px 24px 18px;
		max-height: 84vh;
		transform: translateY(100%);
		transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
	}

	.ast-quick-modal.is-active .ast-quick-modal-dialog {
		transform: translateY(0);
	}

	.ast-quick-modal-actions {
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}

	.ast-quick-btn {
		font-size: 13.5px;
		height: 42px;
	}
}
