/*
 * Stacks above Social Chat's "How can I help you?" pill.
 * That pill is 40px tall with a 24px bottom margin and 20px right margin
 * (wp-whatsapp-chat/build/frontend/css/style.css), so its top edge sits
 * 64px up. 76px leaves a 12px gap.
 *
 * z-index is one below Social Chat's container (9999999) so its chat box,
 * when open, still covers this button.
 */
.ashok-rb {
	--ashok-rb-brand: #4a0404;
	--ashok-rb-cream: #ffffe3;
	position: fixed;
	right: 20px;
	bottom: 76px;
	z-index: 9999998;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	font-family: inherit;
}

/* Theme CSS often sets display on buttons/links, which would beat [hidden]. */
.ashok-rb [hidden] {
	display: none !important;
}

.ashok-rb-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	margin: 0;
	padding: 0 18px;
	border: 0;
	border-radius: 50px;
	background: var(--ashok-rb-brand);
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 1px 6px 0 rgba(0, 0, 0, .06), 0 2px 32px 0 rgba(0, 0, 0, .16);
}

.ashok-rb-toggle:hover,
.ashok-rb-toggle:focus-visible {
	background: #6a0a0a;
	color: #fff;
}

.ashok-rb-toggle:focus-visible,
.ashok-rb-close:focus-visible,
.ashok-rb-send:focus-visible,
.ashok-rb-clear:focus-visible {
	outline: 2px solid var(--ashok-rb-brand);
	outline-offset: 2px;
}

.ashok-rb-icon {
	flex: none;
}

.ashok-rb-panel {
	width: 320px;
	max-width: calc(100vw - 40px);
	max-height: calc(100vh - 160px);
	overflow-y: auto;
	box-sizing: border-box;
	padding: 16px;
	border-radius: 10px;
	background: #fff;
	color: #222;
	box-shadow: 0 8px 40px rgba(0, 0, 0, .22);
}

.ashok-rb-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: -16px -16px 12px;
	padding: 12px 16px;
	border-radius: 10px 10px 0 0;
	background: var(--ashok-rb-brand);
	color: var(--ashok-rb-cream);
}

.ashok-rb-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: inherit;
}

.ashok-rb-close {
	margin: 0;
	padding: 0 4px;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.ashok-rb-form {
	margin: 0;
}

.ashok-rb-label {
	display: block;
	margin: 10px 0 4px;
	font-size: 13px;
	font-weight: 500;
	color: #444;
}

.ashok-rb-label:first-child {
	margin-top: 0;
}

.ashok-rb .ashok-rb-input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 8px 10px;
	border: 1px solid #d6d6d6;
	border-radius: 6px;
	background: #fff;
	color: #222;
	font: inherit;
	font-size: 14px;
}

.ashok-rb textarea.ashok-rb-input {
	resize: vertical;
	min-height: 80px;
}

.ashok-rb .ashok-rb-input:focus {
	border-color: var(--ashok-rb-brand);
	outline: none;
	box-shadow: 0 0 0 2px rgba(74, 4, 4, .15);
}

/* Attachments: drop zone + thumbnails */
.ashok-rb-drop {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 18px 12px;
	border: 2px dashed #cfc3c3;
	border-radius: 10px;
	background: #fbf8f8;
	color: #555;
	text-align: center;
	transition: border-color .15s ease, background .15s ease;
}

.ashok-rb-drop.is-over {
	border-color: var(--ashok-rb-brand);
	background: #f3e9e9;
}

.ashok-rb-drop.is-busy {
	opacity: .6;
	pointer-events: none;
}

/* The file input is invisible and covers the box, so the focus ring goes here. */
.ashok-rb-drop:focus-within {
	outline: 2px solid var(--ashok-rb-brand);
	outline-offset: 2px;
}

.ashok-rb-drop-icon {
	color: var(--ashok-rb-brand);
}

.ashok-rb-drop-text {
	margin: 4px 0 0;
	font-size: 13px;
	color: #444;
}

.ashok-rb-drop-sub {
	margin: 0;
	font-size: 12px;
	color: #777;
}

.ashok-rb-drop-link {
	color: var(--ashok-rb-brand);
	text-decoration: underline;
}

.ashok-rb .ashok-rb-file {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	cursor: pointer;
}

.ashok-rb-hint {
	margin: 4px 0 0;
	font-size: 12px;
	color: #777;
}

.ashok-rb-thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	gap: 8px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.ashok-rb-thumb {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 6px 4px 4px;
	border: 1px solid #e3dada;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}

.ashok-rb-thumb-img {
	width: 100%;
	height: 54px;
	border-radius: 4px;
	object-fit: cover;
}

.ashok-rb-thumb-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 54px;
	border-radius: 4px;
	background: #f0e7e7;
	color: var(--ashok-rb-brand);
	font-size: 12px;
	font-weight: 700;
}

.ashok-rb-thumb-name {
	width: 100%;
	margin-top: 4px;
	overflow: hidden;
	font-size: 11px;
	line-height: 1.3;
	color: #333;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ashok-rb-thumb-size {
	font-size: 10px;
	color: #888;
}

.ashok-rb-thumb-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 20px;
	height: 20px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 14px;
	line-height: 18px;
	cursor: pointer;
}

.ashok-rb-thumb-remove:hover,
.ashok-rb-thumb-remove:focus-visible {
	background: rgba(0, 0, 0, .78);
	color: #fff;
}

/* Spam trap: kept out of sight and out of the tab order, but not display:none
   (some bots skip fields they can tell are hidden). */
.ashok-rb-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ashok-rb-error {
	margin: 6px 0 0;
	font-size: 13px;
	color: #b3261e;
}

.ashok-rb-status {
	margin: 6px 0 0;
	font-size: 13px;
	color: #1a7f37;
}

.ashok-rb-error:empty,
.ashok-rb-status:empty {
	display: none;
}

.ashok-rb .ashok-rb-send {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin: 12px 0 0;
	padding: 10px;
	border: 0;
	border-radius: 50px;
	background: #25d366;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.ashok-rb .ashok-rb-send:hover,
.ashok-rb .ashok-rb-send:focus {
	background: #1ebe5b;
	color: #fff;
}

.ashok-rb .ashok-rb-send:disabled {
	opacity: .7;
	cursor: progress;
}

.ashok-rb-note {
	margin: 8px 0 0;
	font-size: 12px;
	text-align: center;
	color: #777;
}

@media (max-width: 480px) {
	.ashok-rb-toggle {
		font-size: 14px;
		padding: 0 14px;
	}
}
