/**
 * Tire Dimension Selector Styles
 * Modal-style step-by-step tire dimension selection with curved text
 */

/* Dimension Selector Wrapper */
.tire-dimension-selector-wrapper {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 0px;
	padding: 1.5rem;
	margin-bottom: 2rem;
}

/* Search Row */
.dimension-search-row {
	padding: 1rem 0;
	padding-top: 0;
	border-bottom: 1px solid #f0f0f0;
}


.quick-search-box .input-group-text {
    background: #0149ae;
    border-right: none;
    color: #fff;
    border-radius: 0px;
	cursor: pointer;
}


.quick-search-box .form-control:focus {
	border-color: none;
	box-shadow: none;
}
button#toggle-dimension-selector {
    background-color: #0149ae;
    color: #ffffff;
    font-weight: 400;
    transform: unset;
    box-shadow: unset;
    border-radius: 0px;
    border: 1px solid #0149ae;
}
button#toggle-dimension-selector:hover, button#toggle-dimension-selector:focus {
    background-color: #ffffff;
    color: #0149ae;
	border: 1px solid #0149ae;
}
input#tire-quick-search {
    border-radius: 0px;
}
.product_price.text-right.mb-3 {
    margin-bottom: 10px !important;
}
.dimension-separator {
	color: #999;
	font-style: italic;
	margin: 0 1rem;
}

.dimension-selector-toggle {
	padding: 0.75rem 1.5rem;
	font-weight: 600;
	transition: all 0.3s ease;
}

.dimension-selector-toggle:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Modal Styles */
.dimension-selector-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease;
}

.modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(5px);
}

.modal-content {
	position: relative;
	background: #fff;
	border-radius: 16px;
	padding: 0;
	max-width: 900px;
	width: 90%;
	min-width: 600px;
	max-height: 90vh;
	min-height: 500px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	z-index: 1;
	animation: slideUp 0.4s ease;
	display: flex;
	flex-direction: column;
}

.dimension-selector-steps {
	flex: 1;
	overflow-y: auto;
}

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

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

.modal-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 40px;
	height: 40px;
	border: none;
	background: #f0f0f0;
	border-radius: 50%;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	color: #666 !important;
	transition: all 0.3s ease;
	z-index: 10000;
	visibility: visible !important;
	opacity: 1 !important;
}

.modal-close:hover {
	background: #e0e0e0;
	color: #333 !important;
	transform: rotate(90deg);
}

.modal-close i {
	display: inline-block !important;
	visibility: visible !important;
	opacity: 1 !important;
	color: inherit !important;
	font-size: inherit;
	line-height: 1;
	width: auto;
	height: auto;
}

/* Ensure button is always on top and visible */
.modal-content {
	position: relative;
}

.modal-content .modal-close {
	position: absolute !important;
	top: 1rem !important;
	right: 1rem !important;
}

/* Dimension Steps Container */
.dimension-selector-steps {
	margin-top: 0;
	padding-top: 0;
	position: relative;
	height: 600px;
	overflow: hidden;
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Dimension Step */
.dimension-step {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: none;
	flex-direction: column;
	opacity: 0;
	visibility: hidden;
	transform: translateX(30px);
	transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
	pointer-events: none;
}

.dimension-step.active {
	display: flex;
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
	pointer-events: auto;
	z-index: 10;
}

/* Animation removed - using transition instead for smoother sliding */

/* Step Header - Dark Background at Top */
.step-header-top {
	background: #333;
	width: 100%;
	padding: 1rem 1.5rem;
	margin: 0;
	margin-bottom: 2rem;
	position: relative;
	flex-shrink: 0;
}

.step-header-content {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	flex-wrap: nowrap;
	gap: 1rem;
	max-width: 1200px;
	margin: 0 auto;
}

.btn-back-step {	
    padding: 0.5rem 1rem;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: auto;
    white-space: nowrap;
}

.btn-back-step[style*="display: none"] {
	display: none !important;
}

.btn-back-step:not([style*="display: none"]) {
	display: inline-flex !important;
	visibility: visible !important;
	opacity: 1 !important;
}

.btn-back-step:hover {
	background: #333;
    border-color: #333;
    color: #ffffff;
}

.step-title {
	font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-content {
	position: relative;
	width: 100%;
	padding: 0.5rem 1.5rem 2rem 1.5rem;
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.step-content .row {
	margin-left: 0;
	margin-right: 0;
}

.step-content .row > [class*="col-"] {
	padding-left: 15px;
	padding-right: 15px;
}

/* 60-40 Layout */
.dimension-options-col {
	width: 60%;
	flex: 0 0 60%;
	max-width: 60%;
}

.tire-preview-col {
	width: 40%;
	flex: 0 0 40%;
	max-width: 40%;
}
.dimension-options-grid {
    padding: 5px !important;
}
/* Dimension Options Grid - Centered */
.dimension-options-grid {
	display: grid;	
	grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
	gap: 0.75rem;
	padding: 1rem 0;
	max-height: 400px;
	overflow-y: auto;
	justify-content: center;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	flex-shrink: 0;
}

.dimension-option {
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 0.5rem 0.75rem;
	font-size: 1rem;
	font-weight: 600;
	color: #333;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	text-align: center;
	min-height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	pointer-events: auto !important;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	z-index: 10;
	opacity: 1;
	transform: translateY(0);
}

.dimension-option:hover {
	border-color: #0149ae;
    background: #0149ae;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 73, 174, 0.3);
}

.dimension-option.selected {
	background: #0149ae;
	border-color: #0149ae;
	color: #ffffff;
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(1, 73, 174, 0.4);
	font-weight: 700;
}

.dimension-option.active {
	background: #f0f7ff;
	border-color: #0149ae;
	transform: scale(0.98);
}

.dimension-option.selected::after {
	content: "✓";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.75rem;
    background: #28a745;
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 1px solid #fff;
}

/* Tire Preview - New Layout: Tire on Top */
.tire-preview-top {
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;	
	border-radius: 8px;
}

.tire-preview {
	position: relative;
	width: 100%;
	max-width: 700px;
	height: fit-content;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tire-image-container {
	position: relative;
	width: 100%;
	max-width: 500px;
	margin: 0 auto;
	border-radius: 12px;
	overflow: visible;
	background: transparent;
}

.tire-image {
	width: 100%;
	max-width: 700px;
	height: auto;
	display: block;
	object-fit: contain;
	filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

/* Options Container - Centered */
.dimension-options-container {
	width: 100%;
	padding: 1rem 0;
	display: flex;
	justify-content: center;
	align-items: center;
}

.dimension-options-container .dimension-options-grid {
	margin: 0 auto;
	justify-items: center;
}


/* Curved Text SVG */
.tire-spec-curved {
	position: absolute;
	/* top: 50%; */
	left: 50%;
	transform: translate(-50%, -50%);
	width: 85%;
	height: auto;
	pointer-events: none;
	z-index: 10;
	overflow: visible;
	display: block !important;
	visibility: visible !important;
}

/* Hide SVG on step 1 initially (when no width is selected) */
.dimension-step[data-step="1"] .tire-spec-curved {
	display: none !important;
	visibility: hidden !important;
	opacity: 0;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show SVG when width is selected (step 1 with selection) */
.dimension-step[data-step="1"] .tire-spec-curved.show-spec {
	display: block !important;
	visibility: visible !important;
	opacity: 1;
}

.tire-spec-text-curved {
	font-size: 20px;
	font-weight: 700;
	fill: #ffffff !important;
	font-family: 'Arial', 'Helvetica', sans-serif;
	letter-spacing: 2px;
	stroke: rgba(0, 0, 0, 0.8);
	stroke-width: 2px;
	paint-order: stroke fill;
	dominant-baseline: middle;
	text-anchor: middle;
	display: block !important;
	visibility: visible !important;
}

.tire-spec-text-curved textPath {
	fill: #ffffff !important;
	stroke: rgba(0, 0, 0, 0.8);
	stroke-width: 2px;
}

/* Loading Options */
.loading-options {
	grid-column: 1 / -1;
	text-align: center;
	padding: 3rem 2rem;
	color: #666;
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.loading-options .spinner-border {
	width: 2rem;
	height: 2rem;
	border-width: 0.25em;
}

/* Enhanced Loader */
.dimension-loader {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}

.loader-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid #f0f0f0;
	border-top: 4px solid #0149ae;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

.loader-text {
	margin: 0;
	color: #0149ae;
	font-weight: 600;
	font-size: 0.95rem;
	animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

/* Step Transitions */
/* Removed duplicate animation - using transition-based sliding defined above */

/* Step Actions */
.step-actions {
	display: flex;
	gap: 1rem;
	justify-content: center;
	padding-top: 1rem;
	border-top: 1px solid #e0e0e0;
	margin-top: 0rem !important;
	opacity: 1;
	visibility: visible;
}

/* Ensure step 5 actions are always visible */
.dimension-step[data-step="5"] .step-actions {
	display: flex !important;
}

.btn-skip-filter,
.btn-apply-filter {
	padding: 0.75rem 2rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	transition: all 0.3s ease;
	border-radius: 0px;
}

.btn-apply-filter {
	background: #0149ae;
    border-color: #0149ae;
    color: #fff;
}

.btn-apply-filter:hover {
	background: #333;
	border-color: #333;
}

.btn-skip-filter {
	background: #6c757d;
	border-color: #6c757d;
	color: #fff;
}

.btn-skip-filter:hover {
	background: #5a6268;
	border-color: #5a6268;
	color: #fff;
}
.dimension-option {
    width: 100%;
}
/* Responsive */
@media (max-width: 768px) {
    .tire-preview-top {
    margin-bottom: 0 !important;
}
	.modal-content {
		padding: 0;
		width: 95%;
		max-height: 95vh;
		min-width: 320px;
	}
	.btn-back-step {
    padding: 5px 10px;
}
	.dimension-selector-steps {
		height: 500px;
	}
	
	.step-content {
		padding: 2rem 1rem 2rem 1rem;
	}
	
	.dimension-options-grid {
		max-height: 300px;
	}
	.dimension-search-row .row {
    padding: 0 15px;
}
	.modal-content .modal-close {
		top: 10px !important;
		right: 0.5rem;
		width: 30px;
		height: 30px;
		display: flex !important;
		z-index: 10000;
		visibility: visible !important;
		opacity: 1 !important;
	}
	
	.modal-close i {
		display: inline-block !important;
		visibility: visible !important;
		opacity: 1 !important;
	}
	
	.dimension-search-row {
		padding: 0.75rem 0;
	}
	
	.dimension-search-row .row {
		flex-direction: column;
	}
	
	.dimension-search-row .col-12.col-md-5,
	.dimension-search-row .col-12.col-md-2 {
		width: 100%;
		text-align: center;
		padding-left: 0;
		padding-right: 0;
	}
	
	.dimension-separator {
		display: block;
		margin: 0.5rem 0;
		padding: 0.5rem 0;
	}
	
	.dimension-selector-toggle {
		width: 100%;
		margin-top: 0.5rem;
	}
	
	.step-title {
		font-size: 1.3rem;
	}
	
	.dimension-options-grid {
		grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
		gap: 0.5rem;
		min-height: 150px;
	}
	
	.dimension-option {
		padding: 0.5rem 0.5rem;
		font-size: 0.9rem;
		min-height: 40px;
	}
	
	.step-header-top {
		padding: 0.75rem 1rem;
		margin-bottom: 0rem;
	}
	
	.step-header-content {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}

	
	.step-title {
		width: 100%;
		text-align: left;
		font-size: 1.2rem;
	}
	
	.tire-preview {
		position: relative;
		top: 0;
		margin-top: 1.5rem;
	}
	
	.tire-image-container {
		max-width: 100%;
		margin: 0 auto;
	}
	
	.tire-spec-text-curved {
		font-size: 18px;
	}
	
	.step-content .row {
		flex-direction: column;
	}
	
	.step-content .dimension-options-col,
	.step-content .tire-preview-col {
		width: 100%;
		max-width: 100%;
		flex: 0 0 100%;
		padding-left: 0;
		padding-right: 0;
	}
	
	.step-actions {
		flex-direction: column;
		gap: 0.75rem;
	}
	
	.btn-skip-filter,
	.btn-apply-filter {
		width: 100%;
	}
}