/* === RESET VE GENEL === */
.wbtp-designer-app {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.5;
	color: #1f2937;
	max-width: 100%;
}

.wbtp-designer-app * {
	box-sizing: border-box;
}

/* === PRODUCT PAGE BUTTON === */
.wbtp-product-actions {
	margin: 20px 0;
}

.wbtp-open-designer-btn {
	background: linear-gradient(135deg, #6366f1, #4f46e5);
	color: #ffffff;
	border: none;
	border-radius: 8px;
	padding: 16px 32px;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
}

.wbtp-open-designer-btn:hover {
	background: linear-gradient(135deg, #4f46e5, #4338ca);
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.wbtp-open-designer-btn:active {
	transform: translateY(0);
}

.wbtp-btn-icon {
	font-size: 20px;
}

/* WooCommerce varsayılan sepete ekle formunu gizle (bileklik tasarla aktif ürünlerde) */
.single-product .wbtp-product-actions + * .cart,
.single-product .wbtp-product-actions ~ * .cart,
body.single-product .wbtp-product-actions ~ form.cart {
	display: none !important;
}

/* === MODAL === */
.wbtp-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 99999;
	overflow-y: auto;
	padding: 10px;
	box-sizing: border-box;
}

.wbtp-modal.active {
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

.wbtp-modal-content {
	background: #ffffff;
	border-radius: 12px;
	width: 100%;
	max-width: 1200px;
	max-height: calc(100vh - 20px);
	overflow-y: auto;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
	position: relative;
	margin-top: 10px;
}

@media (max-width: 768px) {
	.wbtp-modal {
		padding: 0;
		align-items: stretch;
	}
	
	.wbtp-modal-content {
		width: 100%;
		max-width: none;
		height: 100vh;
		max-height: none;
		margin-top: 0;
		border-radius: 0;
		display: flex;
		flex-direction: column;
	}
	
	.wbtp-modal-body {
		flex: 1;
		overflow-y: auto;
	}
}

.wbtp-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid #e5e7eb;
	background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.wbtp-modal-header h2 {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	color: #111827;
}

.wbtp-modal-close {
	background: none;
	border: none;
	font-size: 32px;
	color: #6b7280;
	cursor: pointer;
	padding: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
}

.wbtp-modal-close:hover {
	background: #f3f4f6;
	color: #374151;
}

.wbtp-modal-body {
	padding: 0;
}

/* Modal içinde app grid'i düzenle */
.wbtp-modal .wbtp-app-grid {
	grid-template-columns: 1fr;
	gap: 16px;
	padding: 20px;
	max-width: none;
	margin: 0;
}

.wbtp-modal .wbtp-panel-left {
	order: 1;
	max-width: none;
}

.wbtp-modal .wbtp-panel-center {
	order: 2;
	max-width: none;
}

.wbtp-modal .wbtp-panel-right {
	order: 3;
	max-width: none;
}

/* Modal'da stone list'i yatay yap */
.wbtp-modal .wbtp-stone-list {
	grid-template-columns: repeat(6, 1fr);
	max-height: 200px;
}

/* Modal'da canvas boyutunu responsive yap */
.wbtp-modal .wbtp-canvas-wrap {
	min-height: 400px;
}

.wbtp-modal #wbtp-fabric-canvas {
	max-width: 100% !important;
	height: auto !important;
}

@media (max-width: 1000px) {
	.wbtp-modal-content {
		width: 98%;
		margin: 10px auto;
		max-height: 95vh;
	}
	
	.wbtp-modal .wbtp-app-grid {
		grid-template-columns: 1fr;
		gap: 12px;
		padding: 12px;
	}
	
	.wbtp-modal .wbtp-stone-list {
		grid-template-columns: repeat(4, 1fr);
		max-height: 150px;
	}
	
	.wbtp-modal .wbtp-canvas-wrap {
		min-height: 300px;
	}
}

@media (max-width: 600px) {
	.wbtp-modal-content {
		margin: 5px;
		max-width: calc(100vw - 10px);
		max-height: calc(100vh - 10px);
		border-radius: 8px;
	}
	
	.wbtp-modal-header {
		padding: 12px 16px;
	}
	
	.wbtp-modal-header h2 {
		font-size: 18px;
	}
	
	.wbtp-modal .wbtp-app-grid {
		padding: 8px;
		gap: 8px;
	}
	
	.wbtp-modal .wbtp-panel {
		padding: 12px;
	}
	
	.wbtp-modal .wbtp-stone-list {
		grid-template-columns: repeat(3, 1fr);
		max-height: 120px;
	}
	
	.wbtp-modal .wbtp-canvas-wrap {
		min-height: 250px;
		padding: 8px;
	}
	
	.wbtp-modal #wbtp-fabric-canvas {
		width: 100% !important;
		max-width: calc(100vw - 50px) !important;
	}
}

/* === ANA LAYOUT === */
.wbtp-app-grid {
	display: grid;
	grid-template-columns: 250px 1fr 250px;
	gap: 12px;
	align-items: start;
	max-width: 1200px;
	margin: 0 auto;
	padding: 12px;
	min-height: 500px;
}

/* === RESPONSIVE BREAKPOINTS === */
@media (max-width: 1000px) {
	.wbtp-app-grid {
		grid-template-columns: 1fr;
		gap: 12px;
		max-width: 800px;
	}
	
	.wbtp-panel-left {
		order: 1;
	}
	
	.wbtp-panel-center {
		order: 2;
	}
	
	.wbtp-panel-right {
		order: 3;
	}
}

@media (max-width: 1024px) {
	.wbtp-app-grid {
		grid-template-columns: 220px 1fr 220px;
		gap: 8px;
		padding: 8px;
	}
}

@media (max-width: 480px) {
	.wbtp-app-grid {
		padding: 8px;
		gap: 12px;
	}
}

/* === PANEL STYLES === */
.wbtp-panel {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	transition: box-shadow 0.2s ease;
}

.wbtp-panel:hover {
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wbtp-panel h3 {
	margin: 0 0 16px 0;
	font-size: 16px;
	font-weight: 600;
	color: #111827;
	border-bottom: 1px solid #f3f4f6;
	padding-bottom: 6px;
}

/* === FORM ELEMENTS === */
.wbtp-field {
	display: block;
	margin-bottom: 16px;
}

.wbtp-field span {
	display: block;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 6px;
	color: #374151;
}

.wbtp-field select,
.wbtp-field input[type="text"] {
	width: 100%;
	padding: 10px 12px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	font-size: 14px;
	transition: border-color 0.2s ease;
	background: #ffffff;
}

.wbtp-field select:focus,
.wbtp-field input[type="text"]:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* === STONE LIST === */
.wbtp-stone-list {
	max-height: 350px;
	overflow-y: auto;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	padding-right: 4px;
}

.wbtp-stone-list::-webkit-scrollbar {
	width: 6px;
}

.wbtp-stone-list::-webkit-scrollbar-track {
	background: #f1f5f9;
	border-radius: 3px;
}

.wbtp-stone-list::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 3px;
}

.wbtp-stone-list::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

.wbtp-stone-item {
	border: 2px solid #f3f4f6;
	border-radius: 8px;
	padding: 8px;
	text-align: center;
	cursor: grab;
	transition: all 0.2s ease;
	background: #ffffff;
}

.wbtp-stone-item:hover {
	border-color: #e5e7eb;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wbtp-stone-item:active {
	cursor: grabbing;
}

.wbtp-stone-item.is-out {
	opacity: 0.5;
	cursor: not-allowed;
	filter: grayscale(0.5);
}

.wbtp-stone-item.is-out:hover {
	transform: none;
	box-shadow: none;
}

.wbtp-stone-item.is-selected {
	border-color: #6366f1;
	background: linear-gradient(145deg, #ffffff, #f8fafc);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.wbtp-stone-item img {
	width: 100%;
	height: 50px;
	object-fit: cover;
	border-radius: 4px;
	margin-bottom: 6px;
}

.wbtp-stone-name {
	font-size: 12px;
	font-weight: 500;
	margin-bottom: 4px;
	color: #374151;
	line-height: 1.3;
}

.wbtp-stone-price {
	font-size: 12px;
	font-weight: 700;
	color: #6366f1;
}

/* === TOOLBAR === */
.wbtp-toolbar {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
	flex-wrap: wrap;
	justify-content: center;
}

.wbtp-toolbar button {
	border: 2px solid #e5e7eb;
	background: #ffffff;
	border-radius: 8px;
	padding: 8px 12px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
	min-width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wbtp-toolbar button:hover {
	border-color: #6366f1;
	color: #6366f1;
	transform: translateY(-1px);
}

.wbtp-toolbar button:active {
	transform: translateY(0);
}

/* === CANVAS AREA === */
.wbtp-canvas-wrap {
	border: 2px dashed #d1d5db;
	border-radius: 8px;
	display: flex;
	justify-content: center;
	align-items: center;
	background: linear-gradient(145deg, #f9fafb, #ffffff);
	padding: 12px;
	min-height: 420px;
	position: relative;
	overflow: hidden;
}

#wbtp-fabric-canvas {
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	background: #ffffff;
}

.wbtp-progress {
	text-align: center;
	font-size: 14px;
	color: #6b7280;
	margin-top: 12px;
	font-weight: 500;
	padding: 8px 16px;
	background: #f3f4f6;
	border-radius: 20px;
	display: inline-block;
}

/* === PRICE TABLE === */
.wbtp-price-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
}

.wbtp-price-table td {
	padding: 12px 0;
	border-bottom: 1px solid #f3f4f6;
	font-size: 14px;
}

.wbtp-price-table td:first-child {
	color: #6b7280;
	font-weight: 500;
}

.wbtp-price-table td:last-child {
	text-align: right;
	font-weight: 600;
	color: #111827;
}

.wbtp-price-table .total td {
	font-weight: 700;
	font-size: 18px;
	border-bottom: none;
	padding-top: 16px;
	color: #111827;
}

/* === BUTTONS === */
.wbtp-btn-primary {
	width: 100%;
	padding: 14px 20px;
	background: linear-gradient(135deg, #6366f1, #4f46e5);
	color: #ffffff;
	border: none;
	border-radius: 10px;
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.wbtp-btn-primary:hover {
	background: linear-gradient(135deg, #4f46e5, #4338ca);
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.wbtp-btn-primary:active {
	transform: translateY(0);
}

.wbtp-btn-primary:disabled {
	background: #9ca3af;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.wbtp-extra-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 16px;
}

.wbtp-extra-actions button {
	padding: 10px 12px;
	border: 2px solid #e5e7eb;
	background: #ffffff;
	border-radius: 8px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.wbtp-extra-actions button:hover {
	border-color: #6366f1;
	color: #6366f1;
	background: #f8fafc;
}

/* === MOBILE HINT === */
.wbtp-mobile-hint {
	font-size: 12px;
	color: #6b7280;
	margin-top: 12px;
	padding: 8px 12px;
	background: #f3f4f6;
	border-radius: 8px;
	display: none;
	text-align: center;
	line-height: 1.4;
}

/* === LOADING STATE === */
.wbtp-loading {
	text-align: center;
	padding: 60px 20px;
	color: #6b7280;
	font-size: 16px;
	font-weight: 500;
}

/* === MOBILE STYLES === */
@media (max-width: 768px) {
	.wbtp-mobile-hint {
		display: block;
	}
	
	.wbtp-panel {
		padding: 16px;
	}
	
	.wbtp-stone-list {
		grid-template-columns: repeat(3, 1fr);
		max-height: 300px;
		gap: 8px;
	}
	
	.wbtp-stone-item {
		padding: 8px;
	}
	
	.wbtp-stone-item img {
		height: 45px;
	}
	
	.wbtp-canvas-wrap {
		padding: 12px;
		min-height: 400px;
	}
	
	#wbtp-fabric-canvas {
		max-width: 100%;
		height: auto !important;
		width: auto !important;
	}
	
	.wbtp-toolbar {
		justify-content: space-between;
	}
	
	.wbtp-toolbar button {
		flex: 1;
		max-width: 60px;
		padding: 8px 4px;
		font-size: 12px;
	}
	
	.wbtp-extra-actions {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.wbtp-stone-list {
		grid-template-columns: repeat(2, 1fr);
	}
	
	.wbtp-canvas-wrap {
		padding: 8px;
		min-height: 350px;
	}
	
	.wbtp-panel h3 {
		font-size: 16px;
	}
}
