/* =============================================================
   The Chemist Chat Widget  |  v1.0.0
   Brand: Fira Sans · Crimson Red #dc143c · Black · White
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;500;600;700&display=swap');

/* ---------------------------------------------------------------
   Bubble (toggle button)
--------------------------------------------------------------- */
#tcc-bubble {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 58px;
	height: 58px;
	background-color: #dc143c;
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 99998;
	box-shadow: 0 4px 18px rgba(220, 20, 60, 0.45);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	font-family: 'Fira Sans', sans-serif;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

#tcc-bubble:hover {
	transform: scale(1.07);
	box-shadow: 0 6px 24px rgba(220, 20, 60, 0.55);
}

#tcc-bubble:focus-visible {
	outline: 3px solid #000;
	outline-offset: 3px;
}

/* ---------------------------------------------------------------
   Widget container
--------------------------------------------------------------- */
#tcc-widget {
	position: fixed;
	bottom: 96px;
	right: 24px;
	width: 360px;
	max-height: 580px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 10px 48px rgba(0, 0, 0, 0.18);
	font-family: 'Fira Sans', sans-serif;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	overflow: hidden;

	/* Hidden state */
	opacity: 0;
	transform: translateY(14px) scale(0.97);
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

#tcc-widget.tcc-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: all;
}

/* ---------------------------------------------------------------
   Header
--------------------------------------------------------------- */
#tcc-header {
	background: #dc143c;
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	gap: 8px;
}

#tcc-header-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

#tcc-header-title {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.2;
}

#tcc-header-sub {
	font-size: 12px;
	opacity: 0.82;
}

#tcc-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
	font-family: 'Fira Sans', sans-serif;
	opacity: 0.88;
	transition: opacity 0.15s;
	flex-shrink: 0;
}

#tcc-close:hover {
	opacity: 1;
}

#tcc-close:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.7);
	border-radius: 4px;
}

/* ---------------------------------------------------------------
   Scrollable body
--------------------------------------------------------------- */
#tcc-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
}

#tcc-body::-webkit-scrollbar {
	width: 5px;
}
#tcc-body::-webkit-scrollbar-track {
	background: #f5f5f5;
}
#tcc-body::-webkit-scrollbar-thumb {
	background: #ddd;
	border-radius: 3px;
}

/* ---------------------------------------------------------------
   Greeting
--------------------------------------------------------------- */
.tcc-greeting {
	margin-bottom: 14px;
}

.tcc-greeting p {
	margin: 0 0 7px;
	font-size: 14px;
	color: #333;
	line-height: 1.55;
}

.tcc-greeting strong {
	color: #dc143c;
}

/* ---------------------------------------------------------------
   View title / breadcrumb
--------------------------------------------------------------- */
.tcc-view-title {
	font-size: 15px;
	font-weight: 700;
	color: #111;
	margin: 6px 0 14px;
	line-height: 1.35;
}

.tcc-section-label {
	font-size: 12px;
	font-weight: 600;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin: 14px 0 6px;
}

.tcc-sub-text {
	font-size: 13px;
	color: #666;
	margin: 0 0 12px;
	line-height: 1.5;
}

/* ---------------------------------------------------------------
   Button list wrapper
--------------------------------------------------------------- */
.tcc-btn-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 6px;
}

.tcc-btn-list--cats {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 8px;
}

.tcc-btn-list--cats .tcc-btn-cat {
	width: auto;
	text-align: center;
}

/* ---------------------------------------------------------------
   Buttons (base)
--------------------------------------------------------------- */
.tcc-btn {
	display: block;
	width: 100%;
	padding: 10px 14px;
	font-family: 'Fira Sans', sans-serif;
	font-size: 14px;
	font-weight: 500;
	border: none;
	border-radius: 9px;
	cursor: pointer;
	text-align: left;
	line-height: 1.4;
	transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
	-webkit-tap-highlight-color: transparent;
}

.tcc-btn:focus-visible {
	outline: 2px solid #dc143c;
	outline-offset: 2px;
}

/* Category buttons */
.tcc-btn-cat {
	background: #dc143c;
	color: #fff;
}
.tcc-btn-cat:hover {
	background: #b8102e;
}

/* Subcategory buttons */
.tcc-btn-sub {
	background: #fdf0f2;
	color: #b8102e;
	border: 1.5px solid #f5cdd3;
}
.tcc-btn-sub:hover {
	background: #fce3e8;
	border-color: #e8a0ac;
}

/* Question buttons */
.tcc-btn-q {
	background: #f7f7f7;
	color: #222;
	border: 1.5px solid #e8e8e8;
}
.tcc-btn-q:hover {
	background: #efefef;
	border-color: #d8d8d8;
}

/* Back button */
.tcc-btn-back {
	background: none;
	color: #777;
	font-size: 13px;
	padding: 2px 0 6px;
	margin-bottom: 2px;
	width: auto;
	text-align: left;
	border-radius: 0;
}
.tcc-btn-back:hover {
	color: #dc143c;
}
.tcc-btn-back:focus-visible {
	outline: 2px solid #dc143c;
	border-radius: 3px;
}

/* Fallback / type question button */
.tcc-btn-fallback {
	background: none;
	color: #dc143c;
	font-size: 13px;
	font-weight: 600;
	border: 1.5px solid #dc143c;
	border-radius: 9px;
	padding: 9px 14px;
	margin-top: 12px;
	text-align: center;
}
.tcc-btn-fallback:hover {
	background: #fdf0f2;
}

/* Submit button */
.tcc-btn-submit {
	background: #dc143c;
	color: #fff;
	border-radius: 9px;
	padding: 11px 20px;
	font-size: 15px;
	font-weight: 700;
	margin-top: 10px;
	text-align: center;
	width: 100%;
}
.tcc-btn-submit:hover:not(:disabled) {
	background: #b8102e;
}
.tcc-btn-submit:disabled {
	background: #ccc;
	cursor: not-allowed;
}

/* Yes / No buttons */
.tcc-btn-yes,
.tcc-btn-no {
	display: inline-block;
	width: auto;
	padding: 8px 18px;
	border-radius: 20px;
	font-size: 13px;
	margin: 0 6px 0 0;
}
.tcc-btn-yes {
	background: #27ae60;
	color: #fff;
}
.tcc-btn-yes:hover {
	background: #219a52;
}
.tcc-btn-no {
	background: #f5f5f5;
	color: #333;
	border: 1.5px solid #ddd;
}
.tcc-btn-no:hover {
	background: #ebebeb;
}

/* ---------------------------------------------------------------
   Answer block
--------------------------------------------------------------- */
.tcc-answer {
	font-size: 14px;
	color: #333;
	line-height: 1.65;
	margin-bottom: 16px;
	padding: 12px 14px;
	background: #fafafa;
	border-radius: 9px;
	border-left: 3px solid #dc143c;
}

.tcc-answer p {
	margin: 0 0 8px;
}
.tcc-answer p:last-child {
	margin-bottom: 0;
}
.tcc-answer a {
	color: #dc143c;
	text-decoration: underline;
}
.tcc-answer ul,
.tcc-answer ol {
	margin: 6px 0;
	padding-left: 20px;
}
.tcc-answer li {
	margin-bottom: 4px;
}

/* ---------------------------------------------------------------
   Helpful section
--------------------------------------------------------------- */
.tcc-helpful {
	margin-top: 12px;
}
.tcc-helpful > p {
	font-size: 13px;
	color: #555;
	margin: 0 0 8px;
}
.tcc-helpful-btns {
	display: flex;
	gap: 0;
}
.tcc-thanks {
	color: #27ae60;
	font-weight: 600;
	font-size: 14px;
	margin: 0;
}

/* ---------------------------------------------------------------
   Contact form
--------------------------------------------------------------- */
.tcc-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tcc-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.tcc-field label {
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

.tcc-field input[type="text"],
.tcc-field input[type="email"],
.tcc-field input[type="tel"],
.tcc-field textarea {
	width: 100%;
	padding: 9px 12px;
	border: 1.5px solid #ddd;
	border-radius: 8px;
	font-family: 'Fira Sans', sans-serif;
	font-size: 14px;
	color: #222;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
	-webkit-appearance: none;
}

.tcc-field input:focus,
.tcc-field textarea:focus {
	outline: none;
	border-color: #dc143c;
	box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.tcc-field textarea {
	resize: vertical;
	min-height: 72px;
}

/* Radio group */
.tcc-radio-group {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}

.tcc-radio-label {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	font-weight: 400;
	color: #333;
	cursor: pointer;
}

.tcc-radio-label input[type="radio"] {
	width: 17px;
	height: 17px;
	accent-color: #dc143c;
	cursor: pointer;
	flex-shrink: 0;
}

/* ---------------------------------------------------------------
   Error message
--------------------------------------------------------------- */
.tcc-error {
	background: #fdf0f2;
	color: #b8102e;
	padding: 9px 12px;
	border-radius: 8px;
	font-size: 13px;
	border: 1px solid #f5cdd3;
	line-height: 1.45;
}

/* ---------------------------------------------------------------
   Sent confirmation
--------------------------------------------------------------- */
.tcc-sent {
	text-align: center;
	padding: 24px 8px 16px;
}
.tcc-sent-icon {
	font-size: 42px;
	margin-bottom: 12px;
	line-height: 1;
}
.tcc-sent h3 {
	font-size: 17px;
	font-weight: 700;
	color: #111;
	margin: 0 0 10px;
}
.tcc-sent p {
	font-size: 14px;
	color: #555;
	line-height: 1.6;
	margin: 0 0 18px;
}

/* ---------------------------------------------------------------
   Empty state
--------------------------------------------------------------- */
.tcc-empty {
	font-size: 13px;
	color: #999;
	padding: 6px 0 10px;
	font-style: italic;
}

/* ---------------------------------------------------------------
   Mobile  (≤ 480px)
--------------------------------------------------------------- */
@media (max-width: 480px) {
	#tcc-widget {
		width: calc(100vw - 16px);
		right: 8px;
		bottom: 84px;
		max-height: 72vh;
		border-radius: 14px;
	}

	#tcc-bubble {
		right: 14px;
		bottom: 14px;
		width: 54px;
		height: 54px;
	}
}

/* PWA safe-area support (iOS notch / home indicator) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
	#tcc-bubble {
		bottom: calc(24px + env(safe-area-inset-bottom));
	}
	#tcc-widget {
		bottom: calc(96px + env(safe-area-inset-bottom));
	}

	@media (max-width: 480px) {
		#tcc-bubble {
			bottom: calc(14px + env(safe-area-inset-bottom));
		}
		#tcc-widget {
			bottom: calc(84px + env(safe-area-inset-bottom));
		}
	}
}
