/* CartKite – popup and side cart. Colors, radius, width and font size come from the settings (CSS variables). */
.ctk, .ctk-bubble {
	--ctk-accent: #2563eb;
	--ctk-accent-text: #fff;
	--ctk-bg: #fff;
	--ctk-text: #111827;
	--ctk-radius: 12px;
	--ctk-width: 420px;
	--ctk-font: 15px;
	--ctk-line: color-mix(in srgb, var(--ctk-text) 12%, transparent);
	--ctk-soft: color-mix(in srgb, var(--ctk-text) 5%, transparent);
	--ctk-muted: color-mix(in srgb, var(--ctk-text) 62%, transparent);
}
.ctk-lock, .ctk-lock body { overflow: hidden; }
.ctk { position: fixed; inset: 0; z-index: 999999; font-size: var(--ctk-font); line-height: 1.45; color: var(--ctk-text); }
.ctk[hidden] { display: none; }
.ctk *, .ctk *::before, .ctk *::after { box-sizing: border-box; }
.ctk-overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); opacity: 0; transition: opacity .25s ease; }
.ctk:not(.ctk--overlay) .ctk-overlay { background: transparent; }
.ctk.is-open .ctk-overlay { opacity: 1; }
.ctk-panel { position: absolute; display: flex; flex-direction: column; background: var(--ctk-bg); color: var(--ctk-text); box-shadow: 0 24px 60px rgba(15, 23, 42, .25); outline: none; transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; overflow: hidden; }

/* Side cart. */
.ctk--side .ctk-panel { top: 0; bottom: 0; width: min(var(--ctk-width), 100vw); }
.ctk--side.ctk--right .ctk-panel { right: 0; transform: translateX(100%); border-radius: var(--ctk-radius) 0 0 var(--ctk-radius); }
.ctk--side.ctk--left .ctk-panel { left: 0; transform: translateX(-100%); border-radius: 0 var(--ctk-radius) var(--ctk-radius) 0; }
.ctk--side.is-open .ctk-panel { transform: none; }

/* Popup. */
.ctk--popup .ctk-panel { left: 50%; top: 50%; width: min(calc(var(--ctk-width) + 80px), 94vw); max-height: min(88vh, 760px); border-radius: var(--ctk-radius); transform: translate(-50%, -46%) scale(.97); opacity: 0; }
.ctk--popup.is-open .ctk-panel { transform: translate(-50%, -50%); opacity: 1; }

.ctk-panel-inner { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ctk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--ctk-line); }
.ctk-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.12em; font-weight: 700; line-height: 1.3; color: inherit; }
.ctk-check { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: var(--ctk-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat; }
.ctk-close { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--ctk-soft); color: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.ctk-close:hover { background: var(--ctk-line); }
.ctk-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; overscroll-behavior: contain; }
.ctk-foot { padding: 16px 20px 20px; border-top: 1px solid var(--ctk-line); background: var(--ctk-bg); }

.ctk-img { width: 64px !important; height: 64px !important; object-fit: cover; border-radius: calc(var(--ctk-radius) * .6); background: var(--ctk-soft); flex: 0 0 64px; margin: 0 !important; }
.ctk-name { font-weight: 600; color: inherit; text-decoration: none; }
a.ctk-name:hover, .ctk-name a:hover { text-decoration: underline; }
.ctk-name a { color: inherit; text-decoration: none; }
.ctk-meta { color: var(--ctk-muted); font-size: .92em; }
.ctk .variation { margin: 2px 0; font-size: .85em; color: var(--ctk-muted); }
.ctk .variation dt, .ctk .variation dd, .ctk .variation p { display: inline; margin: 0; float: none; }

.ctk-added { display: flex; gap: 14px; align-items: center; padding: 12px; margin-bottom: 14px; border-radius: var(--ctk-radius); background: var(--ctk-soft); }

.ctk-ship { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--ctk-radius); background: var(--ctk-soft); font-size: .93em; }
.ctk-ship p { margin: 0 0 8px; }
.ctk-ship-track { height: 7px; border-radius: 99px; background: var(--ctk-line); overflow: hidden; }
.ctk-ship-track span { display: block; height: 100%; border-radius: inherit; background: var(--ctk-accent); transition: width .5s ease; }
.ctk-ship.is-done p { font-weight: 600; }

.ctk-items { list-style: none; margin: 0; padding: 0; }
.ctk-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ctk-line); transition: opacity .2s; }
.ctk-item:last-child { border-bottom: 0; }
.ctk-item.is-new { animation: ctk-flash 1.6s ease; }
.ctk-item.is-removing { opacity: .4; }
@keyframes ctk-flash { 0%, 40% { background: color-mix(in srgb, var(--ctk-accent) 10%, transparent); } 100% { background: transparent; } }
.ctk-item-main { flex: 1; min-width: 0; }
.ctk-item-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; text-align: right; }
.ctk-line { font-weight: 600; white-space: nowrap; }
.ctk-remove { padding: 0; border: 0; background: none; color: var(--ctk-muted); font-size: .85em; text-decoration: underline; cursor: pointer; }
.ctk-remove:hover { color: #b91c1c; }
.ctk-qty { display: inline-flex; align-items: center; margin-top: 6px; border: 1px solid var(--ctk-line); border-radius: 999px; }
.ctk .ctk-qty-btn { flex: 0 0 30px; min-height: 0; box-shadow: none; width: 30px; height: 30px; padding: 0; border: 0; background: none; color: inherit; font-size: 17px; line-height: 1; cursor: pointer; border-radius: 50%; }
.ctk-qty-btn:hover { background: var(--ctk-soft); }
.ctk .ctk-qty-input { flex: 0 0 38px; width: 38px !important; min-width: 0 !important; max-width: 38px; height: 30px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: none !important; color: inherit; text-align: center; font: inherit; -moz-appearance: textfield; appearance: textfield; }
.ctk-qty-input::-webkit-inner-spin-button, .ctk-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.ctk-suggest { margin-top: 18px; }
.ctk-suggest h3 { margin: 0 0 10px; font-size: .95em; font-weight: 700; color: inherit; }
.ctk-suggest ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ctk-suggest li { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--ctk-line); border-radius: var(--ctk-radius); }
.ctk-suggest .ctk-img { width: 52px !important; height: 52px !important; flex-basis: 52px; }
.ctk-suggest-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ctk-suggest-main .ctk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctk-price { font-size: .92em; color: var(--ctk-muted); }
.ctk-price del { opacity: .7; }
.ctk-price ins { text-decoration: none; font-weight: 600; color: var(--ctk-text); }

.ctk-coupon { margin-bottom: 12px; font-size: .92em; }
.ctk-coupon summary { cursor: pointer; color: var(--ctk-muted); }
.ctk-coupon-form { display: flex; gap: 8px; margin-top: 8px; }
.ctk-coupon-form input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--ctk-line); border-radius: calc(var(--ctk-radius) * .6); background: var(--ctk-bg); color: inherit; font: inherit; }
.ctk-chip { display: inline-flex; align-items: center; gap: 4px; margin: 0 6px 6px 0; padding: 2px 4px 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ctk-accent) 12%, transparent); font-weight: 600; font-size: .85em; }
.ctk-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; }

.ctk-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.ctk-total strong { font-size: 1.12em; }
.ctk-total--discount strong { font-size: 1em; color: #15803d; }
.ctk-buttons { display: grid; gap: 8px; margin-top: 12px; }
.ctk-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; border: 1px solid transparent; border-radius: var(--ctk-radius); font: inherit; font-weight: 600; text-align: center; text-decoration: none !important; cursor: pointer; transition: filter .15s, background .15s; }
.ctk-btn--primary { background: var(--ctk-accent); color: var(--ctk-accent-text) !important; }
.ctk-btn--primary:hover { filter: brightness(1.08); }
.ctk-btn--ghost { background: transparent; color: var(--ctk-text) !important; border-color: var(--ctk-line); }
.ctk-btn--ghost:hover { background: var(--ctk-soft); }
.ctk-btn--link { min-height: 36px; background: none; color: var(--ctk-muted) !important; text-decoration: underline !important; font-weight: 500; }
.ctk-btn--small { min-height: 34px; padding: 6px 14px; font-size: .88em; background: var(--ctk-accent); color: var(--ctk-accent-text) !important; }
.ctk-btn--small.ctk-btn--ghost { background: transparent; color: var(--ctk-text) !important; }
.ctk-btn[disabled] { opacity: .6; cursor: default; }

.ctk-empty { padding: 40px 10px; text-align: center; color: var(--ctk-muted); }
.ctk-empty-icon { display: block; width: 56px; height: 56px; margin: 0 auto 10px; opacity: .5; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z'/%3E%3Cpath d='M3 6h18M16 10a4 4 0 01-8 0'/%3E%3C/svg%3E") center / contain no-repeat; }
.ctk-msg { margin: 0 0 12px; padding: 10px 12px; border-radius: calc(var(--ctk-radius) * .6); background: #fef2f2; color: #991b1b; font-size: .92em; }
.ctk-loading { position: absolute; inset: 0; background: color-mix(in srgb, var(--ctk-bg) 55%, transparent); }
.ctk-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 3px solid var(--ctk-line); border-top-color: var(--ctk-accent); border-radius: 50%; animation: ctk-spin .8s linear infinite; }
@keyframes ctk-spin { to { transform: rotate(360deg); } }

/* Floating cart button. */
.ctk-float { position: fixed; bottom: 20px; z-index: 999990; }
.ctk-float--bottom-right { right: 20px; }
.ctk-float--bottom-left { left: 20px; }
.ctk-bubble { position: relative; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; background: var(--ctk-accent); color: var(--ctk-accent-text); box-shadow: 0 10px 28px rgba(15, 23, 42, .28); cursor: pointer; transition: transform .2s; }
.ctk-bubble:hover { transform: scale(1.06); }
.ctk-bubble.is-empty { display: none; }
.ctk-float--always .ctk-bubble.is-empty { display: flex; }
.ctk-bubble-icon { width: 26px; height: 26px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z'/%3E%3Cpath d='M3 6h18M16 10a4 4 0 01-8 0'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z'/%3E%3Cpath d='M3 6h18M16 10a4 4 0 01-8 0'/%3E%3C/svg%3E") center / contain no-repeat; }
.ctk-bubble-count { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; border: 2px solid #fff; background: #111827; color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }

@media (max-width: 520px) {
	.ctk--side .ctk-panel { width: 100vw; border-radius: 0; }
	.ctk--popup .ctk-panel { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 90vh; border-radius: var(--ctk-radius) var(--ctk-radius) 0 0; transform: translateY(100%); opacity: 1; }
	.ctk--popup.is-open .ctk-panel { transform: none; }
	.ctk-float { bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.ctk-panel, .ctk-overlay, .ctk-ship-track span { transition: none; }
	.ctk-item.is-new { animation: none; }
}
.ctk .ctk-panel:focus, .ctk .ctk-panel:focus-visible { outline: none !important; box-shadow: 0 24px 60px rgba(15, 23, 42, .25) !important; }
