/**
 * Ravika Jewels Floating Trust Capsule Stylesheet
 * Brand: Ravika Jewels (https://www.ravikajewels.com)
 * Aesthetic: Modern, minimal, luxurious, and elegant.
 *
 * @package Ravika_Trust_Capsule
 */

/* ==========================================================================
   Outer Host Container
   Non-blocking: Pointer events pass through to underlying elements.
   ========================================================================== */
.ravika-capsule-host {
	position: fixed;
	z-index: 99990;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	max-width: 100vw;
	box-sizing: border-box;
	transition: bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1),
	            transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
	            opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
	will-change: transform, opacity, bottom;
}

/* Positioning Variants */
.ravika-capsule-host.ravika-pos-bottom-left {
	left: 20px;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.ravika-capsule-host.ravika-pos-bottom-right {
	right: 20px;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

/* ==========================================================================
   The Luxury Capsule Card
   ========================================================================== */
.ravika-capsule {
	pointer-events: auto;
	box-sizing: border-box;
	width: 360px;
	max-width: calc(100vw - 32px);
	background: #FCFBF7;
	background: linear-gradient(135deg, #FFFDFB 0%, #FAF7F2 100%);
	border: 1px solid rgba(212, 175, 55, 0.38);
	border-radius: 16px;
	box-shadow: 0 12px 32px -4px rgba(35, 27, 21, 0.09),
	            0 4px 12px -2px rgba(197, 168, 128, 0.18),
	            0 0 0 1px rgba(255, 255, 255, 0.8) inset;
	padding: 12px 14px 12px 14px;
	display: flex;
	align-items: center;
	gap: 12px;
	color: #1A1A1A;
	font-family: inherit;
	line-height: 1.35;
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1),
	            transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
	cursor: pointer;
	text-decoration: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	position: relative;
}

/* Subtle Champagne Gold Top Glow Accent Line */
.ravika-capsule::before {
	content: '';
	position: absolute;
	top: 0;
	left: 24px;
	right: 24px;
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.65) 50%, transparent 100%);
	pointer-events: none;
}

/* Hover & Focus State */
.ravika-capsule:hover {
	border-color: rgba(212, 175, 55, 0.7);
	box-shadow: 0 16px 36px -4px rgba(35, 27, 21, 0.12),
	            0 6px 16px -2px rgba(197, 168, 128, 0.24);
	transform: translateY(0) scale(1.005);
}

.ravika-capsule:focus-visible {
	outline: 2px solid #C5A880;
	outline-offset: 3px;
}

/* Visibility State */
.ravika-capsule-host.ravika-is-visible .ravika-capsule {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.ravika-capsule-host.ravika-is-hidden {
	opacity: 0;
	pointer-events: none !important;
	transform: translateY(14px) scale(0.97);
}

/* ==========================================================================
   Visual Icon / Thumbnail Element
   ========================================================================== */
.ravika-capsule-visual {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: #F5EFEB;
	border: 1px solid rgba(212, 175, 55, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	color: #9A7B38;
}

.ravika-capsule-visual img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ravika-capsule-icon-svg {
	width: 22px;
	height: 22px;
	stroke: #A88642;
	fill: none;
}

/* ==========================================================================
   Text & Message Content
   ========================================================================== */
.ravika-capsule-content {
	flex: 1;
	min-width: 0; /* Prevents overflow in flex layouts */
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ravika-capsule-header {
	display: flex;
	align-items: center;
	gap: 6px;
}

.ravika-capsule-heading {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9A7B38;
	margin: 0;
	padding: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ravika-capsule-dot {
	font-size: 9px;
	color: #D4AF37;
	opacity: 0.8;
}

.ravika-capsule-message {
	font-size: 13px;
	line-height: 1.35;
	color: #2D2825;
	margin: 0;
	padding: 0;
	font-weight: 400;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
}

.ravika-capsule-product-highlight {
	font-weight: 600;
	color: #1A1A1A;
}

/* ==========================================================================
   Close / Dismiss Button
   ========================================================================== */
.ravika-capsule-close {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: none;
	background: transparent;
	color: #9C958E;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0 -4px 0 0;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.ravika-capsule-close:hover {
	background-color: rgba(26, 26, 26, 0.06);
	color: #1A1A1A;
}

.ravika-capsule-close:focus-visible {
	outline: 2px solid #C5A880;
	outline-offset: 2px;
}

.ravika-capsule-close svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
	stroke-width: 2;
}

/* ==========================================================================
   Mobile & Responsive Adaptations (Narrow Screens 320px - 430px)
   ========================================================================== */
@media screen and (max-width: 480px) {
	.ravika-capsule-host {
		left: 12px !important;
		right: 12px !important;
		width: calc(100vw - 24px) !important;
		max-width: none !important;
		align-items: center;
	}

	.ravika-capsule {
		width: 100% !important;
		max-width: 100% !important;
		padding: 10px 12px;
		border-radius: 14px;
		gap: 10px;
	}

	.ravika-capsule-visual {
		width: 38px;
		height: 38px;
		border-radius: 10px;
	}

	.ravika-capsule-icon-svg {
		width: 18px;
		height: 18px;
	}

	.ravika-capsule-heading {
		font-size: 10px;
	}

	.ravika-capsule-message {
		font-size: 12px;
		line-height: 1.3;
	}

	.ravika-capsule-close {
		width: 26px;
		height: 26px;
	}
}

/* Ultra-compact screens <= 340px */
@media screen and (max-width: 340px) {
	.ravika-capsule-host {
		left: 8px !important;
		right: 8px !important;
		width: calc(100vw - 16px) !important;
	}

	.ravika-capsule {
		padding: 8px 10px;
		gap: 8px;
	}

	.ravika-capsule-visual {
		width: 32px;
		height: 32px;
	}

	.ravika-capsule-icon-svg {
		width: 16px;
		height: 16px;
	}
}

/* ==========================================================================
   Reduced Motion Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.ravika-capsule-host,
	.ravika-capsule {
		transition: none !important;
		animation: none !important;
		transform: none !important;
	}
}
