/* ================================================
   CONFIGURATOR V5 - LANȚ GEANTĂ CU CHARMURI
   Adaptat pentru a se potrivi cu stilul V1-V4
   ================================================ */

/* ================================
   GALERIE CONFIGURATOR V5
   ================================ */
#config_wrapper[rel="v5"] {
	position: relative;
	height: 500px;
	background: #fff;	
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Container dedicat pentru imaginea lanțului - dimensiune cunoscută */
.config-v5-chain-container {
	position: relative;
	max-width: 100%;
	max-height: 100%;
	margin: 0 auto;
}

/* Imaginea lanțului - singură în container, fără transform */
.config-v5-chain-container img {
	display: block;
	width: 100%;
	height: auto;
	position: relative;
}

/* Placeholder când nu e selectat lanțul */
.config-v5-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
}

.placeholder-content {
	text-align: center;
	color: #999;
}

.placeholder-content i {
	font-size: 3em;
	margin-bottom: 10px;
	display: block;
}

.placeholder-content p {
	font-size: 14px;
	margin: 0;
	font-family: 'Santral-Light';
}

/* Container charmuri (overlay absolut față de imaginea lanțului) */
.config-v5-charms-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.config-v5-charm-item {
	position: absolute;
	width: 33%;
	max-width: 264px;
	min-width: 132px;
	transform: translate(-50%, 0);
	pointer-events: auto;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Fallback pentru browsere fara suport aspect-ratio */
@supports not (aspect-ratio: 1.6 / 1) {
	.config-v5-charm-item {
		height: 20.625%;
		padding-bottom: 20.625%;
	}
}

/* Modern browsers cu aspect-ratio */
@supports (aspect-ratio: 1.6 / 1) {
	.config-v5-charm-item {
		aspect-ratio: 1.6 / 1;
		height: auto;
		overflow: hidden; /* FIX iOS: Forțează respectarea aspect-ratio */
	}
}

.config-v5-charm-item img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: 100%; /* FIX iOS: Forțează imaginea să se încadreze în înălțimea containerului */
	object-fit: contain; /* Păstrează proporțiile imaginii */
	display: block;	
	position: relative;
	z-index: 1;
}

/* Buton ștergere charm */
.remove-charm-btn {
	position: absolute;
	top: -10px;
	right: -10px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #000;
	color: white;
	border: 2px solid #fff;
	font-size: 16px;
	font-weight: bold;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	z-index: 100;
	line-height: 1;
	box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.remove-charm-btn:hover {
	background: #fff;
	color: #000;
	border-color: #000;
	transform: scale(1.1);
}

/* Counter charmuri */
.config-v5-counter {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background: #fff;
	color: #000;
	padding: 6px 12px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	z-index: 100;
	font-family: 'Santral-Light';
}

.charm-count-number {
	
	color: #000000;
}

.charm-count-separator {
	margin: 0 3px;
}

.charm-count-max {
	font-size: 1em;
}

.charm-count-label {
	margin-left: 3px;
	font-weight: 400;
	opacity: 0.9;
}

/* Mesaj temporar "charm adăugat" */
.charm-added-message {
	display: none;
    color: #fff;
    font-weight: 600;
    background-color: #000;
    padding: 2px 5px;
    line-height: 16px;
    height: 23px;	
}

/* Clasă pentru a ascunde elementele normale când se afișează mesajul */
.config-v5-counter.showing-message .charm-count-number,
.config-v5-counter.showing-message .charm-count-separator,
.config-v5-counter.showing-message .charm-count-max,
.config-v5-counter.showing-message .charm-count-label {
	display: none;
}

.config-v5-counter.showing-message .charm-added-message {
	display: inline-block;
	animation: fadeInMessage 0.3s ease-in-out;
}

@keyframes fadeInMessage {
	0% {
		opacity: 0;
		transform: translateY(-5px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Loading indicator */
.config-v5-loading {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255,255,255,0.9);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

.loading-spinner {
	border: 3px solid #f3f3f3;
	border-top: 3px solid #000;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: spin 1s linear infinite;
	margin-bottom: 10px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.config-v5-loading p {
	font-size: 12px;
	color: #000;
	font-family: 'Santral-Light';
}

/* ================================
   LISTĂ CHARMURI SELECTATE
   ================================ */
#selected-charms-list-v5 .charm-item-v5 {
	padding: 10px 30px 10px 0;
	border-bottom: solid 1px #e0e0e0;
	font-size: 12px;
	line-height: 16px;
	color: #000;
	position: relative;
	font-family: 'Santral-Light';
}

#selected-charms-list-v5 .charm-item-v5:last-child {
	border-bottom: none;
}

#selected-charms-list-v5 .charm-item-details {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

#selected-charms-list-v5 .charm-item-name {
	font-weight: 600;
	font-size: 12px;
	line-height: 16px;
}

#selected-charms-list-v5 .charm-item-meta {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
}

#selected-charms-list-v5 .charm-item-price {
	color: #666;
	font-size: 11px;
	line-height: 14px;
}

#selected-charms-list-v5 .charm-item-separator {
	color: #666;
	font-size: 11px;
	line-height: 14px;
	user-select: none;
}

#selected-charms-list-v5 .charm-item-availability {
	font-size: 10px;
	line-height: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

#selected-charms-list-v5 .charm-item-availability.in-stock {
	color: #2d7a2d;
}

#selected-charms-list-v5 .charm-item-availability.preorder {
	color: #d68000;
}

#selected-charms-list-v5 .charm-item-availability.out-of-stock {
	color: #c33;
}

#selected-charms-list-v5 .charm-item-remove {
	position: absolute;
	right: 0;
	top: 10px;
	background: #000;
	color: #fff;
	border: solid 1px #000;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	font-size: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

#selected-charms-list-v5 .charm-item-remove:hover {
	background: #fff;
	color: #000;
}

/* ================================
   MESAJE EROARE
   ================================ */
.builder-v5-messages {
	margin-bottom: 15px;
}

.builder-v5-error {
	padding: 10px;
	border: 1px solid #e82020;
	background: #fee;
	color: #c33;
	font-size: 12px;
	line-height: 16px;
	margin-bottom: 10px;
	font-family: 'Santral-Light';
}

.builder-v5-info {
	color: #000;
	font-size: 12px;
	line-height: 16px;
	margin-bottom: 10px;
	font-family: 'Santral-Light';
}

/* ================================
   MODAL PRECOMANDĂ
   ================================ */
.modal-v5 {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-v5-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.7);
}

.modal-v5-content {
	position: relative;
	background: white;
	border: solid 1px #000;
	max-width: 600px;
	width: 90%;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
	z-index: 1;
}

.modal-v5-header {
	padding: 20px;
	border-bottom: solid 1px #e0e0e0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.modal-v5-header h3 {
	margin: 0;
	font-size: 18px;
	line-height: 22px;
	color: #000;
	font-weight: normal;
	text-transform: uppercase;
	font-family: 'MinionPro';
}

.modal-v5-close {
	background: none;
	border: none;
	font-size: 2em;
	color: #999;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	width: 30px;
	height: 30px;
}

.modal-v5-close:hover {
	color: #000;
}

.modal-v5-body {
	padding: 20px;
	font-size: 12px;
	line-height: 16px;
	color: #000;
	font-family: 'Santral-Light';
}

.modal-v5-message {
	font-size: 12px;
	line-height: 18px;
	color: #000;
	margin-bottom: 15px;
}

.preorder-items {
	font-size: 12px;
	line-height: 18px;
	color: #666;
}

.preorder-items ul {
	margin: 10px 0;
	padding-left: 20px;
}

.modal-v5-footer {
	padding: 20px;
	border-top: solid 1px #e0e0e0;
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

.modal-v5-footer .btn-white,
.modal-v5-footer .btn-black {
	min-width: 120px;
}

/* ================================
   RESPONSIVE - TABLET
   ================================ */
@media (max-width: 1024px) {
	#config_wrapper[rel="v5"] {
		height: 400px;
	}
	
	.config-v5-charm-item {
		width: 30.8%;
		max-width: 220px;
		min-width: 110px;
	}
}

/* ================================
   RESPONSIVE - MOBILE
   ================================ */
@media (max-width: 768px) {
	.pd-gal, .pd-det {
		width: 100%;
		float: none;
		padding-left: 0;
	}

    .pd-det {
        width: 90% !important;
        padding: 0;
		margin:5% !important;
        
    }	
	
	#config_wrapper[rel="v5"] {
		height: 150px;
		margin-bottom: 20px;
	}
	
	.config-v5-charm-item {
		width: 28.6%;
		max-width: 154px;
		min-width: 88px;
	}
	
	.remove-charm-btn {
		width: 22px;
		height: 22px;
		font-size: 14px;
		top: -8px;
		right: -8px;
	}
	
	.config-v5-counter {
		bottom: 8px;
		right: 8px;
		padding: 5px 10px;
		font-size: 11px;
	}
	
	.placeholder-content i {
		font-size: 2em;
	}
	
	.placeholder-content p {
		font-size: 12px;
	}
	
	.modal-v5-content {
		width: 95%;
		max-height: 90vh;
	}
	
	.modal-v5-header {
		padding: 15px;
	}
	
	.modal-v5-body {
		padding: 15px;
	}
	
	.modal-v5-footer {
		padding: 15px;
		flex-direction: column;
	}
	
	.modal-v5-footer .btn-white,
	.modal-v5-footer .btn-black {
		width: 100%;
		min-width: auto;
	}
	
	#selected-charms-list-v5 .charm-item-v5 {
		padding: 8px 26px 8px 0;
	}
	
	#selected-charms-list-v5 .charm-item-remove {
		top: 8px;
		width: 18px;
		height: 18px;
		font-size: 12px;
	}
	
	#selected-charms-list-v5 .charm-item-name {
		font-size: 11px;
		line-height: 14px;
	}
	
	#selected-charms-list-v5 .charm-item-price {
		font-size: 10px;
		line-height: 13px;
	}
	
	#selected-charms-list-v5 .charm-item-separator {
		font-size: 10px;
		line-height: 13px;
	}
	
	#selected-charms-list-v5 .charm-item-availability {
		font-size: 9px;
		line-height: 11px;
	}
}

/* ================================
   CHARMURI INDISPONIBILE
   ================================ */
/* Opacitate 50% pentru charmuri indisponibile în preview */
.config-v5-charm-item.charm-unavailable {
	opacity: 0.5;
}

.config-v5-charm-item.charm-unavailable img {
	opacity: 0.5;
}

/* Styling pentru charmuri indisponibile în listă */
#selected-charms-list-v5 .charm-item-v5.charm-item-unavailable {
	opacity: 0.5;
}

#selected-charms-list-v5 .charm-item-availability.unavailable {
	color: #c33;
	font-size: 10px;
	line-height: 12px;
	text-transform: none;
}

/* Mesaj pentru charmuri indisponibile (în loc de buton) */
#unavailable-charms-message-v5 {	
	color: #c33;
	font-size: 14px;
	line-height: 18px;
	text-align: left;
	font-family: 'Santral-Light';
	font-weight: 600;
	margin-bottom: 15px;
}

/* ================================
   UTILITY CLASSES
   ================================ */
.disable-select {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
	-khtml-user-drag: none;
	-moz-user-drag: none;
	-o-user-drag: none;
	user-drag: none;
}

#preorder-items-list-v5{
	margin:4px 0 0 4px
}