/* =============================================================================
   Midas Mini Cart — Stylesheet
   Mirrors the WooCommerce mini-cart UX: badge counter, fly-out panel, overlay.
   ============================================================================= */

/* ── Reset / scoping ─────────────────────────────────────────────────────── */
.tmc-wrap *,
.tmc-wrap *::before,
.tmc-wrap *::after {
	box-sizing: border-box;
}

/* ── CSS Custom Properties ───────────────────────────────────────────────── */
:root {
	--tmc-accent:        #9f7953;
	--tmc-accent-hover:  #846343;
	--tmc-danger:        #e53935;
	--tmc-text:          #1a1a2e;
	--tmc-text-muted:    #6b7280;
	--tmc-bg:            #ffffff;
	--tmc-border:        #e5e7eb;
	--tmc-overlay-bg:    #000000;
	--tmc-overlay-opacity: .35;
	--tmc-button-text:   #ffffff;
	--tmc-trigger-radius: 8px;
	--tmc-button-radius: 8px;
	--tmc-trigger-icon-size: 22px;
	--tmc-radius:        12px;
	--tmc-panel-width:   360px;
	--tmc-shadow:        0 20px 60px rgba(0, 0, 0, .15);
	--tmc-transition-ms: 250ms;
	--tmc-transition:    var(--tmc-transition-ms) cubic-bezier(.4, 0, .2, 1);
	--tmc-z-overlay:     9998;
	--tmc-z-panel:       9999;
}

.tmc-wrap {
	position: relative;
	display: inline-flex;
}

/* ── Trigger button ──────────────────────────────────────────────────────── */
.tmc-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px 10px;
	border-radius: var(--tmc-trigger-radius);
	color: inherit;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	transition: background var(--tmc-transition), border-color var(--tmc-transition), box-shadow var(--tmc-transition), color var(--tmc-transition);
	position: relative;
	line-height: 1;
}

.tmc-trigger:hover,
.tmc-trigger:focus-visible {
	background: rgba(159, 121, 83, .08);
	color: var(--tmc-accent);
	outline: none;
}

.tmc-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background var(--tmc-transition), border-color var(--tmc-transition), color var(--tmc-transition);
	line-height: 1;
}

.tmc-icon svg {
	width: var(--tmc-trigger-icon-size);
	height: var(--tmc-trigger-icon-size);
}

.tmc-icon i,
.tmc-icon .eicon,
.tmc-icon [class*=" fa-"],
.tmc-icon [class^="fa-"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.tmc-label {
	white-space: nowrap;
	transition: background var(--tmc-transition), color var(--tmc-transition);
}

.tmc-price {
	white-space: nowrap;
	transition: background var(--tmc-transition), color var(--tmc-transition);
}

/* ── Count badge ─────────────────────────────────────────────────────────── */
.tmc-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 50px;
	background: var(--tmc-border);
	color: var(--tmc-text-muted);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	transition: background var(--tmc-transition), color var(--tmc-transition), transform var(--tmc-transition);
}

.tmc-count--has-items {
	background: var(--tmc-accent);
	color: #fff;
}

/* Pulse animation when count changes */
@keyframes tmc-badge-pop {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.45); }
	100% { transform: scale(1); }
}

.tmc-count--pop {
	animation: tmc-badge-pop .35s ease-out forwards;
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.tmc-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: var(--tmc-overlay-bg);
	backdrop-filter: blur(2px);
	z-index: var(--tmc-z-overlay);
	opacity: 0;
	transition: opacity var(--tmc-transition);
}

.tmc-overlay--visible {
	display: block;
}

.tmc-overlay--active {
	opacity: var(--tmc-overlay-opacity);
}

/* ── Panel ───────────────────────────────────────────────────────────────── */
.tmc-panel {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    width: var(--tmc-panel-width);
    /*max-width: 100vw;*/
    background: var(--tmc-bg);
    box-shadow: var(--tmc-shadow);
    z-index: var(--tmc-z-panel);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--tmc-transition);
    overflow: visible;
    z-index: 999999;
    transition: transform var(--tmc-transition), opacity var(--tmc-transition);
    border-radius: var(--tmc-radius) 0 0 var(--tmc-radius);
    padding: 15px;
    max-width: 95%;
}

.tmc-panel--left {
	left: 0;
	right: auto;
	transform: translateX(-100%);
	border-radius: 0 var(--tmc-radius) var(--tmc-radius) 0;
}

.tmc-panel--open {
	transform: translateX(0);
}

.tmc-panel--animate-fade {
	opacity: 0;
	transform: translateX(0);
	pointer-events: none;
}

.tmc-panel--animate-fade.tmc-panel--open {
	opacity: 1;
	pointer-events: auto;
}

.tmc-panel--animate-none,
.tmc-panel--animate-none.tmc-panel--open {
	transition: none;
}

.tmc-panel__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* ── Loading state ───────────────────────────────────────────────────────── */
.tmc-panel__loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .85);
	z-index: 10;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--tmc-transition);
}

.tmc-panel__loading--active {
	opacity: 1;
	pointer-events: auto;
}

.tmc-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid var(--tmc-border);
	border-top-color: var(--tmc-accent);
	border-radius: 50%;
	animation: tmc-spin .65s linear infinite;
}

@keyframes tmc-spin {
	to { transform: rotate(360deg); }
}

/* ── Panel content area ──────────────────────────────────────────────────── */
.tmc-panel__content {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.tmc-panel__header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 0px 10px;
    flex-shrink: 0;
}

.tmc-panel__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--tmc-text);
	display: flex;
	align-items: center;
	gap: 6px;
}

.tmc-panel__item-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--tmc-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

.tmc-close {
	position: absolute;
	top: 50%;
	left: -18px;
	z-index: 12;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #fff;
	border: none;
	cursor: pointer;
	color: var(--tmc-accent);
	box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
	opacity: 0;
	pointer-events: none;
	transition: background var(--tmc-transition), color var(--tmc-transition), opacity var(--tmc-transition);
	flex-shrink: 0;
	transform: translateY(-50%);
}

.tmc-panel--open .tmc-close {
	opacity: 1;
	pointer-events: auto;
}

.tmc-close:hover,
.tmc-close:focus-visible {
	background: #f3f4f6;
	color: var(--tmc-text);
	outline: none;
}

.tmc-panel--right .tmc-close {
	left: -18px;
	right: auto;
}

.tmc-panel--left .tmc-close {
	left: auto;
	right: -18px;
	transform: translateY(-50%) rotate(180deg);
}

@media(min-width:768px){
   .tmc-panel--right .tmc-close {
  	  left: -45px;
   } 
  .tmc-panel--left .tmc-close {
	  right: -45px;
  }
}

.tmc-side-arrow {
	position: fixed;
	top: 50%;
	right: 18px;
	z-index: 999998;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--tmc-accent);
	box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
	cursor: pointer;
	transform: translateY(-50%);
	transition: color var(--tmc-transition), box-shadow var(--tmc-transition), opacity var(--tmc-transition);
}

.tmc-side-arrow:hover,
.tmc-side-arrow:focus-visible {
	color: var(--tmc-accent-hover);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
	outline: none;
}

.tmc-panel--open ~ .tmc-side-arrow {
	opacity: 0;
	pointer-events: none;
}

/* ── Body: scrollable item list ──────────────────────────────────────────── */
.tmc-panel__body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--tmc-border) transparent;
}

.tmc-panel__body::-webkit-scrollbar        { width: 4px; }
.tmc-panel__body::-webkit-scrollbar-track  { background: transparent; }
.tmc-panel__body::-webkit-scrollbar-thumb  { background: var(--tmc-border); border-radius: 4px; }

/* ── Empty / not-logged-in state ─────────────────────────────────────────── */
.tmc-panel__body--empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 48px 24px;
	text-align: center;
}

.tmc-empty-icon {
	color: var(--tmc-border);
}

.tmc-panel__body--empty p {
	margin: 0;
	font-size: 15px;
	color: var(--tmc-text-muted);
}

/* ── Items list ──────────────────────────────────────────────────────────── */
.tmc-items {
	list-style: none;
	margin: 0;
	padding: 8px 0;
}

.tmc-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--tmc-border)!important;
    transition: background var(--tmc-transition);
    position: relative;
    margin-bottom: 10px;
}

/*.tmc-item:last-child {
	border-bottom: none;
}*/

.tmc-item:hover {
	background: #fafafa;
}

/* Removing state */
.tmc-item--removing {
	opacity: .4;
	pointer-events: none;
	transition: opacity var(--tmc-transition);
}

/* ── Thumbnail ───────────────────────────────────────────────────────────── */
.tmc-item__thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: var(--tmc-radius);
    overflow: hidden;
    display: block;
    background: #f3f4f6;
    border-radius: 0px;
}

.tmc-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tmc-item__thumb-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--tmc-border);
}

/* ── Item details ────────────────────────────────────────────────────────── */
.tmc-item__details {
	flex: 1;
	min-width: 0;
}

.tmc-item__name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--tmc-text);
    text-decoration: none;
    line-height: 1.2;
    margin-bottom: 4px;
    transition: color var(--tmc-transition);
}
.tmc-item__name:hover {
	color: var(--tmc-text);
	text-decoration: none;
}

.tmc-item__specializations {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 4px;
}

.tmc-item__meta {
	display: flex;
	align-items: center;
	gap: 6px;
}

.tmc-item__quantity {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 7px;
	font-size: 12px;
	color: var(--tmc-text-muted);
}

.tmc-item__quantity input {
	width: 50px;
	height: 28px;
	border: 1px solid var(--tmc-border);
	border-radius: 6px;
	text-align: center;
	background: #f9fafb;
	color: var(--tmc-text);
	font-size: 12px;
}

.tmc-item__price {
    font-size: 13px;
    font-weight: 500;
    color: var(--tmc-text);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tmc-item__price--original {
	color: var(--tmc-text-muted);
	text-decoration: line-through;
	font-weight: 400;
}

.tmc-item__price--sale {
	color: var(--tmc-danger);
}

.tmc-item__price--free {
	color: #16a34a;
	font-weight: 600;
}

/* ── Remove button ───────────────────────────────────────────────────────── */
.tmc-item__remove {
	flex-shrink: 0;
	display: flex;
/*	align-items: center;*/
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--tmc-text-muted);
	transition: background var(--tmc-transition), color var(--tmc-transition);
	opacity: 1;
}
.mini-cart-action {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.tmc-item .course-specializations img {
    max-width: 20px;
}
.tmc-item .course-specializations{
	font-size: 12px;
	gap:6px;
}
.tmc-item:hover .tmc-item__remove,
.tmc-item__remove:focus-visible {
	opacity: 1;
}

.tmc-item__remove:hover {
	background: #fee2e2;
	color: var(--tmc-danger);
	outline: none;
}

.tmc-item__remove:focus-visible {
	outline: 2px solid var(--tmc-accent);
	outline-offset: 2px;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.tmc-panel__footer {
    border-top: 1px solid var(--tmc-border);
    padding-top: 15px;
    background: var(--tmc-bg);
    flex-shrink: 0;
}

.tmc-coupon {
	margin-bottom: 14px;
}

.tmc-coupon__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--tmc-border);
    border-radius: var(--tmc-button-radius);
    background: #fff;
    color: var(--tmc-text);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding-bottom: 15px;
}

.tmc-coupon__toggle span {
	transition: transform var(--tmc-transition);
}

.tmc-coupon--open .tmc-coupon__toggle span {
	transform: rotate(180deg);
}

.tmc-coupon__panel {
	margin-top: 9px;
}

.tmc-coupon--collapsed .tmc-coupon__panel {
	display: none;
}

.tmc-coupon__form {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
}

.tmc-coupon__input {
	width: 100%;
	min-width: 0;
	border: 1px solid var(--tmc-border);
	border-radius: var(--tmc-button-radius);
	padding: 10px 11px;
	font: inherit;
	color: var(--tmc-text);
	background: #fff;
}

.tmc-coupon__input:focus {
	border-color: var(--tmc-accent);
	outline: none;
	box-shadow: 0 0 0 2px rgba(159, 121, 83, .12);
}

.tmc-coupon__apply,
.tmc-coupon__remove {
	border: 0;
	cursor: pointer;
	font: inherit;
}

.tmc-coupon__apply {
    border-radius: var(--tmc-button-radius);
    background: var(--tmc-accent);
    color: var(--tmc-button-text);
    padding: 10px 25px;
    font-size: 13px;
    font-weight: 700;
    clip-path: polygon(var(--tvzp-cut) 0%, 100% 0%, 100% calc(100% - var(--tvzp-cut)), calc(100% - var(--tvzp-cut)) 100%, 0% 100%, 0% var(--tvzp-cut));
    border-radius: 0;
    border-radius: 0;
}
.tmc-coupon__message {
	min-height: 18px;
	margin-top: 6px;
	font-size: 12px;
	color: var(--tmc-text-muted);
}

.tmc-coupon__message--error {
	color: var(--tmc-danger);
}

.tmc-coupon__applied {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	border: 1px dashed var(--tmc-border);
	border-radius: var(--tmc-button-radius);
	padding: 10px 12px;
	background: rgba(159, 121, 83, .08);
}

.tmc-coupon__label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--tmc-text-muted);
	margin-bottom: 2px;
}

.tmc-coupon__amount {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	color: var(--tmc-danger);
	white-space: nowrap;
}

.tmc-coupon__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	color: var(--tmc-danger);
	line-height: 1;
}

.tmc-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 14px;
}


.tmc-subtotal__amount , .tmc-subtotal__label {
	font-size: 16px;
	font-weight: 600;
	color: var(--tmc-text);
}

.tmc-grand-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: -7px;
	margin-bottom: 14px;
	font-size: 13px;
	color: var(--tmc-text-muted);
}

.tmc-grand-total strong {
	color: var(--tmc-text);
}

.tmc-footer-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.tmc-footer-actions--cart_only,
.tmc-footer-actions--checkout_only,
.tmc-footer-actions--dropdown {
	grid-template-columns: 1fr;
}

.tmc-action-dropdown {
	position: relative;
}

.tmc-action-dropdown__toggle {
	width: 100%;
	gap: 8px;
}

.tmc-action-dropdown__menu {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(100% + 8px);
	background: var(--tmc-bg);
	border: 1px solid var(--tmc-border);
	border-radius: var(--tmc-button-radius);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
	overflow: hidden;
	z-index: 2;
}

.tmc-action-dropdown--open .tmc-action-dropdown__menu {
	display: block;
}

.tmc-action-dropdown__item {
	display: block;
	padding: 11px 13px;
	color: var(--tmc-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
}

.tmc-action-dropdown__item:hover,
.tmc-action-dropdown__item:focus {
	background: rgba(159, 121, 83, .1);
	color: var(--tmc-accent);
	outline: none;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.tmc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 16px;
	border-radius: var(--tmc-button-radius);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: 2px solid transparent;
	transition: background var(--tmc-transition), color var(--tmc-transition),
	            border-color var(--tmc-transition), transform var(--tmc-transition);
	line-height: 1;
	white-space: nowrap;
}

.tmc-btn:active {
	transform: scale(.97);
}

.tmc-btn--primary {
	background: var(--tmc-accent);
	color: var(--tmc-button-text);
	border-color: var(--tmc-accent);
}

.tmc-btn--primary:hover , 
.wmi-ccbtn-shell.wmi-flat:hover,
.tmc-btn--primary:focus-visible , 
.wmi-ccbtn-shell.wmi-flat:focus-visible,
.tmc-coupon__apply:hover,
.tmc-coupon__apply:focus-visible {
	background: var(--tmc-accent-hover);
	border-color: var(--tmc-accent-hover);
	color: var(--tmc-button-text);
	outline: none;
}

.tmc-btn--outline {
	background: transparent;
	color: var(--tmc-accent);
	border-color: var(--tmc-accent);
}

.tmc-btn--outline:hover,
.tmc-btn--outline:focus-visible {
	background: var(--tmc-accent);
	color: #fff;
	outline: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.tmc-panel {
		--tmc-panel-width: 100vw;
	}

	.tmc-footer-actions {
		grid-template-columns: 1fr;
	}
}

/* ── Guest note ─────────────────────────────────────────────────────── */
.tmc-guest-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--tmc-text-muted, #888);
  text-align: center;
  line-height: 1.5;
}
.tmc-guest-note a {
  color: var(--tmc-accent, #1e40af);
  text-decoration: none;
}

.tmc-panel a,
.tmc-panel a:hover,
.tmc-panel a:focus,
.tmc-panel a:visited,
.tmc-panel button,
.tmc-panel button:hover,
.tmc-panel button:focus,
.tmc-wrap a,
.tmc-wrap a:hover,
.tmc-wrap a:focus,
.tmc-wrap a:visited,
.tmc-wrap button,
.tmc-wrap button:hover,
.tmc-wrap button:focus {
	text-decoration: none !important;
}

/* ── Buy Now button — in-cart / already-added state ──────────────────────── */
/*
 * Applied by JS (markButtonAdded) to Midas LMS buy-now <a> or <button> elements
 * when the course is already in the mini cart.  Visually communicates the
 * "added" state without hiding the button or removing it from the DOM.
 */
.tmc-btn--added,
.tmc-btn--added:hover,
.tmc-btn--added:focus,
.tmc-btn--added:active {
	opacity: 0.65;
	cursor: default !important;
	pointer-events: none;
	filter: saturate(0.4);
}
