/**
 * Frontend Styles
 * @package WarenkorbTeilen
 */

/* ==================================
   CSS Variables
   ================================== */
:root {
	--wkt-primary: #2271b1;
	--wkt-primary-dark: #135e96;
	--wkt-success: #46b450;
	--wkt-text: #1d2327;
	--wkt-text-light: #666;
	--wkt-border: #e8e8e8;
	--wkt-bg: #f6f7f7;
	--wkt-radius: 8px;
	--wkt-transition: 0.2s ease;
}

/* ==================================
   Share Cart Button
   ================================== */

.wkt-share-button-wrapper {
	display: block;
	margin: 15px 0;
}

.wkt-share-button-wrapper.wkt-share-button-after-table {
	text-align: right;
	padding: 15px 0;
}

.wkt-share-button-wrapper.wkt-share-button-before-checkout {
	margin-bottom: 15px;
}

.wkt-share-cart-button {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: linear-gradient(135deg, #2271b1 0%, #135e96 100%) !important;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.wkt-share-cart-button:hover {
	background: linear-gradient(135deg, #135e96 0%, #0a4b78 100%);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.wkt-share-cart-button .wkt-share-icon {
	display: flex;
	align-items: center;
}

.wkt-share-cart-button .wkt-share-icon svg {
	width: 16px;
	height: 16px;
}

/* Ensure visibility in various WooCommerce layouts */
.woocommerce-cart .wkt-share-cart-button,
.woocommerce .wkt-share-cart-button,
#wkt-share-cart-btn {
	display: inline-flex !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* ==================================
   Share Cart Modal
   ================================== */

.wkt-share-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: wktFadeIn 0.2s ease;
}

@keyframes wktFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.wkt-share-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
}

.wkt-share-modal-content {
	position: relative;
	background: #fff;
	border-radius: 16px;
	max-width: 480px;
	width: 90%;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: wktSlideUp 0.3s ease;
	overflow: hidden;
}

@keyframes wktSlideUp {
	from { transform: translateY(20px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

.wkt-share-modal-header {
	background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
	color: #fff;
	padding: 24px;
	text-align: center;
	position: relative;
}

.wkt-share-modal-icon {
	width: 56px;
	height: 56px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 12px;
}

.wkt-share-modal-icon svg {
	width: 28px;
	height: 28px;
}

.wkt-share-modal-header h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	color: #fff;
}

.wkt-share-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	background: rgba(255, 255, 255, 0.2);
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s;
}

.wkt-share-modal-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.wkt-share-modal-body {
	padding: 24px;
}

/* Loading State */
.wkt-share-loading {
	text-align: center;
	padding: 40px 0;
}

.wkt-share-spinner {
	width: 48px;
	height: 48px;
	border: 3px solid #e8e8e8;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: wktSpin 0.8s linear infinite;
	margin: 0 auto 16px;
}

@keyframes wktSpin {
	to { transform: rotate(360deg); }
}

.wkt-share-loading p {
	color: #666;
	margin: 0;
}

/* Initial State */
.wkt-share-initial {
	text-align: center;
}

.wkt-share-initial p {
	color: #666;
	line-height: 1.6;
	margin-bottom: 20px;
}

.wkt-share-initial .button-primary {
	padding: 12px 32px;
	font-size: 15px;
}

/* Success State */
.wkt-share-success {
	text-align: center;
}

.wkt-share-success-icon {
	color: #46b450;
	margin-bottom: 12px;
}

.wkt-share-success-message {
	font-size: 16px;
	font-weight: 500;
	color: #1d2327;
	margin-bottom: 20px;
}

.wkt-share-link-container {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}

.wkt-share-link-input {
	flex: 1;
	padding: 12px;
	border: 2px solid #dcdcde;
	border-radius: 8px;
	font-size: 13px;
	background: #f6f7f7;
}

.wkt-share-link-input:focus {
	border-color: #2271b1;
	outline: none;
}

.wkt-copy-share-link {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 16px;
	white-space: nowrap;
}

.wkt-copy-share-link .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.wkt-copy-success {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: #46b450;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 20px;
}

.wkt-copy-success .dashicons {
	font-size: 18px;
}

/* Social Share Buttons */
.wkt-share-buttons {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #e8e8e8;
}

.wkt-share-buttons-label {
	font-size: 13px;
	color: #666;
	margin-bottom: 12px;
}

.wkt-share-buttons-row {
	display: flex;
	justify-content: center;
	gap: 12px;
}

.wkt-share-button {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 12px 20px;
	border-radius: 8px;
	text-decoration: none;
	font-size: 12px;
	font-weight: 500;
	transition: all 0.2s;
}

.wkt-share-button svg {
	width: 24px;
	height: 24px;
}

.wkt-share-whatsapp {
	background: #e8f5e9;
	color: #25d366;
}

.wkt-share-whatsapp:hover {
	background: #25d366;
	color: #fff;
}

.wkt-share-email {
	background: #e3f2fd;
	color: #1976d2;
}

.wkt-share-email:hover {
	background: #1976d2;
	color: #fff;
}

.wkt-share-facebook {
	background: #e8eaf6;
	color: #1877f2;
}

.wkt-share-facebook:hover {
	background: #1877f2;
	color: #fff;
}

/* Error State */
.wkt-share-error {
	text-align: center;
	padding: 20px 0;
}

.wkt-share-error-icon {
	color: #d63638;
	margin-bottom: 12px;
}

.wkt-share-error-message {
	color: #d63638;
	margin-bottom: 20px;
}

/* ==================================
   Shared Cart Landing Page
   ================================== */

.wkt-shared-cart-page {
	padding: 40px 20px;
	max-width: 900px;
	margin: 0 auto;
}

.wkt-shared-cart-container {
	position: relative;
}

.wkt-shared-cart-header {
	text-align: center;
	margin-bottom: 40px;
}

.wkt-shared-cart-icon {
	width: 80px;
	height: 80px;
	background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
	color: #fff;
}

.wkt-shared-cart-header h1 {
	font-size: 28px;
	font-weight: 600;
	color: #1d2327;
	margin: 0 0 8px 0;
}

.wkt-shared-cart-meta {
	font-size: 14px;
	color: #666;
	margin: 0;
}

/* Cart Items Table */
.wkt-shared-cart-items {
	margin-bottom: 30px;
}

.wkt-shared-cart-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wkt-shared-cart-table thead {
	background: #f6f7f7;
}

.wkt-shared-cart-table th {
	padding: 16px;
	text-align: left;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	border-bottom: 2px solid #e8e8e8;
}

.wkt-shared-cart-table td {
	padding: 16px;
	vertical-align: middle;
	border-bottom: 1px solid #f0f0f0;
}

.wkt-shared-cart-table tbody tr:last-child td {
	border-bottom: none;
}

.wkt-shared-cart-table .product-thumbnail {
	width: 100px;
}

.wkt-product-image {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 8px;
}

.wkt-product-placeholder {
	width: 80px;
	height: 80px;
	background: #f6f7f7;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ccc;
}

.wkt-product-placeholder .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
}

.wkt-shared-cart-table .product-name a {
	font-weight: 600;
	color: #1d2327;
	text-decoration: none;
}

.wkt-shared-cart-table .product-name a:hover {
	color: #2271b1;
}

.wkt-item-configuration {
	margin-top: 12px;
	padding: 12px;
	background: #f9f9f9;
	border-radius: 6px;
	font-size: 12px;
}

.wkt-item-configuration strong {
	display: block;
	margin-bottom: 6px;
	color: #1d2327;
}

.wkt-item-configuration ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wkt-item-configuration li {
	padding: 2px 0;
	color: #666;
}

/* Definition list style for formatted configuration */
.wkt-config-list {
	margin: 0;
	padding: 0;
}

.wkt-config-list dt {
	display: inline;
	font-weight: 600;
	color: #1d2327;
}

.wkt-config-list dd {
	display: inline;
	margin: 0;
	margin-left: 4px;
	color: #666;
}

.wkt-config-list dd::after {
	content: '';
	display: block;
	margin-bottom: 4px;
}

.wkt-config-list dd:last-child::after {
	margin-bottom: 0;
}

.wkt-config-price {
	color: var(--wkt-primary, #2271b1);
	font-weight: 500;
	font-size: 11px;
}

.wkt-item-variation {
	margin-top: 8px;
	font-size: 12px;
}

.wkt-item-variation .variation-item {
	display: inline-block;
	background: #e8e8e8;
	padding: 2px 8px;
	border-radius: 4px;
	margin-right: 4px;
}

.quantity-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	background: #f6f7f7;
	border-radius: 6px;
	font-weight: 600;
}

.wkt-shared-cart-table tfoot {
	background: #f6f7f7;
}

.wkt-cart-total .total-label {
	text-align: right;
	font-size: 16px;
	font-weight: 600;
}

.wkt-cart-total .total-value {
	font-size: 20px;
	color: var(--wkt-primary);
}

/* Action Button */
.wkt-shared-cart-actions {
	text-align: center;
	margin-bottom: 30px;
}

.wkt-load-shared-cart {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 16px 40px;
	font-size: 16px;
	font-weight: 600;
}

.wkt-load-shared-cart .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.wkt-action-hint {
	font-size: 13px;
	color: #666;
	margin-top: 12px;
}

/* Loading Overlay */
.wkt-shared-cart-loading {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.95);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	z-index: 10;
}

.wkt-loading-spinner {
	width: 48px;
	height: 48px;
	border: 4px solid #e8e8e8;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: wktSpin 0.8s linear infinite;
	margin-bottom: 16px;
}

/* Success State */
.wkt-shared-cart-success {
	text-align: center;
	padding: 60px 20px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wkt-success-icon {
	color: #46b450;
	margin-bottom: 20px;
}

.wkt-shared-cart-success h2 {
	font-size: 24px;
	font-weight: 600;
	color: #1d2327;
	margin: 0 0 12px 0;
}

.wkt-success-message {
	color: #666;
	margin-bottom: 24px;
}

/* Info Box */
.wkt-shared-cart-info {
	background: #fff8e1;
	border: 1px solid #ffe082;
	border-radius: 8px;
	padding: 16px;
}

.wkt-shared-cart-info p {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-size: 13px;
	color: #5d4037;
}

.wkt-shared-cart-info .dashicons {
	color: #f57c00;
	flex-shrink: 0;
}

/* Error Page */
.wkt-shared-cart-error {
	text-align: center;
	padding: 80px 20px;
	max-width: 500px;
	margin: 0 auto;
}

.wkt-error-icon {
	color: #d63638;
	margin-bottom: 20px;
}

.wkt-shared-cart-error h1 {
	font-size: 24px;
	color: #1d2327;
	margin: 0 0 12px 0;
}

.wkt-shared-cart-error p {
	color: #666;
	margin-bottom: 24px;
}

/* ==========================================
   Admin Editing Features for Shared Cart
   ========================================== */

/* Admin Notice */
.wkt-admin-notice {
	background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
	color: #fff;
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
}

.wkt-admin-notice .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.wkt-admin-notice strong {
	margin-right: 4px;
}

/* Editable Price */
.wkt-editable-price {
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
	transition: background-color 0.2s;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.wkt-editable-price:hover {
	background: #f0f6fc;
}

.wkt-price-edited {
	color: #2271b1;
	font-weight: 600;
}

.wkt-edited-badge {
	font-size: 12px;
	color: #2271b1;
	opacity: 0.8;
}

/* Price Edit Form */
.wkt-price-edit-form {
	display: none;
	align-items: center;
	gap: 6px;
}

.wkt-price-input {
	width: 100px;
	padding: 6px 10px;
	border: 2px solid #2271b1;
	border-radius: 4px;
	font-size: 14px;
	text-align: right;
}

.wkt-price-input:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.wkt-save-price,
.wkt-cancel-price {
	padding: 6px 10px !important;
	min-height: auto !important;
	line-height: 1 !important;
}

.wkt-save-price {
	background: #2271b1 !important;
	color: #fff !important;
	border-color: #2271b1 !important;
}

.wkt-cancel-price {
	background: #f0f0f0 !important;
	color: #666 !important;
}

/* Item Note Display */
.wkt-item-note {
	margin-top: 10px;
	padding: 10px 12px;
	background: #e7f5ff;
	border-left: 3px solid #2271b1;
	border-radius: 4px;
	font-size: 13px;
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.wkt-item-note .dashicons {
	color: #2271b1;
	font-size: 16px;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	margin-top: 2px;
}

.wkt-item-note .note-text {
	color: #1d2327;
	font-style: italic;
}

/* Admin Note Edit */
.wkt-admin-note-edit {
	margin-top: 12px;
	padding: 12px;
	background: #f9f9f9;
	border: 1px dashed #ccc;
	border-radius: 6px;
}

.wkt-admin-note-edit label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #666;
	margin-bottom: 8px;
}

.wkt-admin-note-edit .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.wkt-note-input {
	width: 100%;
	min-height: 60px;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 13px;
	resize: vertical;
	margin-bottom: 8px;
}

.wkt-note-input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.wkt-save-note {
	background: #2271b1 !important;
	color: #fff !important;
	border-color: #2271b1 !important;
}

.wkt-save-note:hover {
	background: #135e96 !important;
}

/* Inline Notice */
.wkt-inline-notice {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 16px;
	font-size: 14px;
	transition: opacity 0.3s;
}

.wkt-notice-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.wkt-notice-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Global Cart Note Display */
.wkt-global-note-display {
	margin: 20px 0;
	padding: 16px 20px;
	background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
	border-left: 4px solid #4a7c59;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wkt-global-note-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.wkt-global-note-header .dashicons {
	color: #4a7c59;
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.wkt-global-note-header strong {
	color: #4a7c59;
	font-size: 14px;
}

.wkt-global-note-content {
	color: #1d2327;
	font-size: 14px;
	line-height: 1.6;
}

/* Global Cart Note Editor (Admin) */
.wkt-global-note-edit {
	margin: 24px 0;
	padding: 20px;
	background: #fff8e7;
	border: 2px dashed #f0b429;
	border-radius: 8px;
}

.wkt-global-note-edit .wkt-global-note-header {
	margin-bottom: 8px;
}

.wkt-global-note-edit .wkt-global-note-header .dashicons {
	color: #d18700;
}

.wkt-global-note-edit .wkt-global-note-header strong {
	color: #d18700;
}

.wkt-global-note-hint {
	font-size: 12px;
	color: #666;
	margin: 0 0 12px 0;
	font-style: italic;
}

.wkt-global-note-input {
	width: 100%;
	min-height: 100px;
	padding: 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	resize: vertical;
	margin-bottom: 12px;
	font-family: inherit;
}

.wkt-global-note-input:focus {
	outline: none;
	border-color: #4a7c59;
	box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15);
}

#wkt-save-global-note {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	background: #4a7c59;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s, transform 0.1s;
}

#wkt-save-global-note:hover {
	background: #3d6a4a;
}

#wkt-save-global-note:active {
	transform: scale(0.98);
}

#wkt-save-global-note:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

#wkt-save-global-note .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Responsive */
@media (max-width: 768px) {
	.wkt-share-modal-content {
		width: 95%;
		max-height: 90vh;
	}

	.wkt-share-buttons-row {
		flex-direction: column;
	}

	.wkt-share-button {
		flex-direction: row;
		justify-content: center;
	}

	.wkt-shared-cart-page {
		padding: 20px 15px;
	}

	.wkt-shared-cart-table {
		display: block;
		overflow-x: auto;
	}

	.wkt-product-image {
		width: 60px;
		height: 60px;
	}

	.wkt-shared-cart-table th,
	.wkt-shared-cart-table td {
		padding: 12px 8px;
	}

	.wkt-load-shared-cart {
		width: 100%;
		justify-content: center;
	}

	.wkt-admin-note-edit textarea {
		min-width: 100%;
	}
}
