/* ==========================================================================
   ALTA PRODUCTO
   ========================================================================== */

/* Upload imagen principal */
.alta-producto .custom-upload {
	border: 2px dashed #ccc;
	width: 150px;
	height: 150px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	transition: all 0.3s ease-in-out
}

.alta-producto .custom-upload:hover {
	border-color: #CE0E71;
	background-color: rgba(206, 14, 113, 0.1);
	transform: scale(1.1);
	box-shadow: 0px 4px 10px rgba(206, 14, 113, 0.2)
}

.alta-producto .custom-upload:hover p {
	color: #CE0E71;
	transform: rotate(360deg);
	transition: transform 0.5s ease-in-out, color 0.3s ease-in-out
}

/* Texto etiqueta imagen */
.alta-producto .product-image-text {
	color: #484847;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 24px
}

/* Categorías (dropdown) */
.alta-producto .category-select-wrapper {
	position: relative
}

.alta-producto .custom-dropdown-text,
.alta-producto .dropdown-tipos {
	border: 1px solid #9E9E9D;
	border-radius: 4px;
	background-color: #fff;
	line-height: 16px;
	font-weight: 400;
	font-size: 12px
}

.alta-producto .category-dropdown-list {
	position: absolute;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 8px;
	padding-left: 30px;
	max-height: 0;
	overflow: hidden;
	z-index: 999;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	opacity: 0;
	transform: translateY(-5px);
	transition: all 0.3s ease
}

.alta-producto .category-dropdown-list.active {
	max-height: 300px;
	overflow-y: auto;
	opacity: 1;
	transform: translateY(0)
}

.alta-producto .category-dropdown-list .form-check {
	margin-bottom: 8px
}

.alta-producto #selected-categories {
	display: inline;
	margin-top: 0 !important;
	margin-bottom: 32px;
	display: inline-block
}

/* Campo URL externa */
.alta-producto #external-url-field {
	display: flex;
	flex-direction: column;
	justify-content: flex-end
}

.alta-producto #external-url-field label {
	margin-bottom: 4px
}

/* Inputs */
.alta-producto .form-control {
	margin-bottom: 32px;
	margin-top: 4px;
	border-color: #9E9E9D;
	border-radius: 4px;
	font-size: 14px !important;
}

.alta-producto .form-control::placeholder {
	font-style: italic
}

/* Layout */
.alta-producto .segittur-product-creator-form {
	margin-top: 24px
}

.alta-producto .title-definition {
	font-size: 24px;
	margin-bottom: 24px;
	margin-top: 24px
}

.alta-producto .save-button {
	margin-bottom: 24px
}

/* Checks / toggles */
.alta-producto .form-check-input:checked {
	background-color: #CE0E71;
	border-color: #CE0E71
}

.alta-producto .virtual {
	display: none
}

.alta-producto #_stock {
	margin-top: 0
}

.alta-producto #_sold_individually {
	margin-bottom: 32px
}

/* Labels específicos */
.alta-producto label[for="_downloadable"] {
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 24px
}

.alta-producto label[for="_upload_apk"] {
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 24px
}

/* Galería */
.alta-producto label[for="gallery-upload"] {
	font-size: 16px;
	font-weight: bold;
	color: #333;
	background-color: #f8f9fa;
	padding: 8px 12px;
	border-radius: 5px;
	display: inline-block;
	cursor: pointer;
	transition: all 0.3s ease-in-out
}

.alta-producto label[for="gallery-upload"]:hover {
	background-color: #e2e6ea;
	color: #CE0E71
}

.alta-producto #gallery-upload {
	display: none
}

.alta-producto .custom-upload-gallery {
	border: 2px dashed #ccc;
	padding: 15px;
	border-radius: 8px;
	background-color: #f8f9fa;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100px;
	text-align: center;
	transition: all 0.3s ease-in-out;
	position: relative
}

/* Nota: hay dos :hover en el original; se mantienen, ya que la 2ª añade fondo/box-shadow */
.alta-producto .custom-upload-gallery:hover {
	background-color: #e2e6ea;
	border-color: #CE0E71
}

.alta-producto #gallery-upload-preview {
	display: flex;
	flex-wrap: nowrap;
	gap: 12px;
	overflow-x: auto;
	padding: 8px;
	justify-content: flex-start;
	align-items: center;
	width: 100%
}

.alta-producto #gallery-upload-preview p {
	font-size: 48px;
	font-weight: bold;
	color: black;
	margin: 0;
	position: absolute
}

.alta-producto .custom-upload-gallery:hover {
	border-color: #CE0E71;
	background-color: rgba(206, 14, 113, 0.1);
	box-shadow: 0px 4px 10px rgba(206, 14, 113, 0.2)
}

.alta-producto .custom-upload-gallery:hover p {
	color: #CE0E71 !important
}

.alta-producto #gallery-upload-preview img {
	max-width: 100px;
	height: auto;
	border-radius: 5px;
	box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease-in-out;
	position: relative;
	flex-shrink: 0
}

.alta-producto #gallery-upload-preview img:hover {
	transform: scale(1.1)
}

/* Textos auxiliares */
.alta-producto .size-text {
	color: #484847;
	font-family: "Nunito Sans";
	font-size: 11px;
	font-style: normal;
	font-weight: 400;
	line-height: 16px;
	margin-top: 8px
}

.alta-producto .no-margin-bottom {
	margin-bottom: 0 !important
}

/* APK */
.alta-producto .custom-upload-apk {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%
}

.alta-producto #apk-file-name {
	flex: 1;
	margin-bottom: 0
}

.alta-producto #apk-upload-btn {
	white-space: nowrap;
	margin-bottom: 0
}


/* ==========================================================================
   EDITAR PRODUCTO
   ========================================================================== */

/* APK */
.editar-producto .custom-upload-apk {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%
}

.editar-producto #apk-file-name {
	flex: 1;
	margin-bottom: 0
}

.editar-producto #apk-upload-btn {
	white-space: nowrap;
	margin-bottom: 0
}

/* Upload imagen principal */
.editar-producto .custom-upload {
	border: 2px dashed #ccc;
	width: 150px;
	height: 150px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
	border-radius: 10px;
	transition: all 0.3s ease-in-out
}

.editar-producto .custom-upload:hover {
	border-color: #CE0E71;
	background-color: rgba(206, 14, 113, 0.1);
	transform: scale(1.1);
	box-shadow: 0px 4px 10px rgba(206, 14, 113, 0.2)
}

.editar-producto .custom-upload:hover p {
	color: #CE0E71;
	transform: rotate(360deg);
	transition: transform 0.5s ease-in-out, color 0.3s ease-in-out
}

/* Texto etiqueta imagen */
.editar-producto .product-image-text {
	color: #484847;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 24px
}

/* Categorías (dropdown) */
.editar-producto .category-select-wrapper {
	position: relative;
	cursor: pointer;
	margin-top: 4px;
	margin-bottom: 12px
}

.editar-producto .custom-dropdown-text,
.editar-producto .dropdown-tipos {
	border: 1px solid #9E9E9D;
	border-radius: 4px;
	background-color: #fff;
	line-height: 16px;
	font-weight: 400;
	font-size: 12px
}

.editar-producto .category-dropdown-list {
	position: absolute;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 8px;
	padding-left: 30px;
	max-height: 0;
	overflow: hidden;
	z-index: 999;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	opacity: 0;
	transform: translateY(-5px);
	transition: all 0.3s ease
}

.editar-producto .category-dropdown-list.active {
	max-height: 300px;
	overflow-y: auto;
	opacity: 1;
	transform: translateY(0)
}

/* Util */
.editar-producto .no-margin-bottom {
	margin-bottom: 0 !important
}

/* Campo URL externa */
.editar-producto #external-url-field {
	display: flex;
	flex-direction: column;
	justify-content: flex-end
}

.editar-producto #external-url-field label {
	margin-bottom: 4px
}

/* Inputs */
.editar-producto .form-control {
	margin-bottom: 32px;
	margin-top: 4px;
	border-color: #9E9E9D;
	border-radius: 4px
}

.editar-producto .form-control::placeholder {
	font-style: italic
}

/* Layout */
.editar-producto .segittur-product-creator-form {
	margin-top: 24px
}

.editar-producto .title-definition {
	font-size: 24px;
	margin-bottom: 24px;
	margin-top: 24px
}

.editar-producto .save-button {
	margin-bottom: 24px
}

.editar-producto button.cancel-button {
	margin-bottom: 24px;
	margin-right: 32px
}

/* Checks / toggles */
.editar-producto .form-check-input:checked {
	background-color: #CE0E71;
	border-color: #CE0E71
}

.editar-producto .virtual {
	display: none
}

.editar-producto #_stock {
	margin-top: 0
}

.editar-producto #_sold_individually {
	margin-bottom: 32px
}

/* Labels específicos */
.editar-producto label[for="_downloadable"] {
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 24px
}

/* Galería */
.editar-producto label[for="gallery-upload"] {
	font-size: 16px;
	font-weight: bold;
	color: #333;
	background-color: #f8f9fa;
	padding: 8px 12px;
	border-radius: 5px;
	display: inline-block;
	cursor: pointer;
	transition: all 0.3s ease-in-out
}

.editar-producto label[for="gallery-upload"]:hover {
	background-color: #e2e6ea;
	color: #CE0E71
}

.editar-producto #gallery-upload {
	display: none
}

.editar-producto .custom-upload-gallery {
	border: 2px dashed #ccc;
	padding: 15px;
	border-radius: 8px;
	background-color: #f8f9fa;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100px;
	text-align: center;
	transition: all 0.3s ease-in-out;
	position: relative;
	width: 50%
}

/* Nota: hay dos :hover en el original; se mantienen, ya que la 2ª añade fondo/box-shadow */
.editar-producto .custom-upload-gallery:hover {
	background-color: #e2e6ea;
	border-color: #CE0E71
}

.editar-producto #gallery-upload-preview {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: nowrap;
	overflow-x: auto;
	width: 100%;
	height: 100%;
	position: relative
}

.editar-producto #gallery-upload-preview p {
	font-size: 48px;
	font-weight: bold;
	color: black;
	margin: 0;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%)
}

.editar-producto .custom-upload-gallery:hover {
	border-color: #CE0E71;
	background-color: rgba(206, 14, 113, 0.1);
	box-shadow: 0px 4px 10px rgba(206, 14, 113, 0.2)
}

.editar-producto .custom-upload-gallery:hover p {
	color: #CE0E71 !important
}

.editar-producto #gallery-upload-preview img {
	max-width: 100px;
	height: auto;
	border-radius: 5px;
	box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease-in-out;
	position: relative;
	flex-shrink: 0;
	background: #fff
}

.editar-producto #gallery-upload-preview img:hover {
	transform: scale(1.1)
}

/* Textos auxiliares */
.editar-producto .size-text {
	color: #484847;
	font-family: "Nunito Sans";
	font-size: 11px;
	font-style: normal;
	font-weight: 400;
	line-height: 16px;
	margin-top: 8px
}

/* Cita admin */
.editar-producto .cita {
	position: relative;
	margin: 1.5em 0;
	padding: 1.2em 1.5em;
	background-color: #f0f8ff;
	border-left: 5px solid #0073aa;
	border-radius: 4px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	font-style: italic;
	color: #222
}

.editar-producto .cita::before {
	content: "“";
	position: absolute;
	top: -10px;
	left: 10px;
	font-size: 3rem;
	line-height: 1;
	color: rgba(0, 115, 170, 0.2)
}

.editar-producto .row .col-12>strong {
	display: block;
	margin-bottom: 0.3em;
	font-size: 1.1rem;
	color: #0073aa
}


/* ==========================================================================
   ESTADOS Y APK
   ========================================================================== */

.estado {
	display: inline-block;
	padding: 4px 8px;
	font-size: 14px;
	border-radius: 4px;
	font-weight: 400;
	line-height: 1;
	text-align: center;
	white-space: nowrap;
	vertical-align: baseline
}

.estado-stock {
	color: #006C7A;
	font-size: 11px;
	font-style: normal;
	font-weight: 400;
	border: 1px solid #61C9D8;
	background: #E3FFFF
}

.estado-pending {
	color: #795700;
	border: 1px solid #E4AE2A;
	background: #FFF7E0;
	font-size: 11px;
	font-style: normal;
	font-weight: 400
}

.estado-default {
	background-color: #e0e0e0;
	border: 1px solid #bdbdbd;
	color: #333
}

.estado-incident {
	color: #B10413;
	background-color: #FFF3F1;
	border: 1px solid #B10413;
	font-size: 11px;
	font-style: normal;
	font-weight: 400;
	animation: blinkFade 1.5s ease-in-out infinite
}

@keyframes blinkFade {
	0%,
	100% {
		opacity: 1
	}

	50% {
		opacity: 0
	}
}

/* Bloque APK */
.apk-field {
	margin-top: 32px;
	padding-top: 16px;
	border-top: 1px solid #dee2e6
}

.apk-field .download-card {
	background-color: #fff;
	border-radius: 12px;
	padding: 12px 16px;
	border: 1px solid #e0e0e0;
	margin-bottom: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: box-shadow 0.2s ease, transform 0.2s ease
}

.apk-field .download-card:hover {
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px)
}

.apk-field .file-link {
	color: #0d6efd;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.2s ease
}

.apk-field .file-link:hover {
	color: #0a58ca;
	text-decoration: underline
}

.apk-field .delete-downloadable {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	font-size: 0.875rem;
	background-color: transparent;
	border: 1px solid #dc3545;
	border-radius: 4px;
	color: #dc3545;
	transition: background-color 0.2s ease, color 0.2s ease
}

.apk-field .delete-downloadable:hover {
	background-color: #dc3545;
	color: #fff
}

.apk-field .fade-out {
	opacity: 0;
	transform: scale(0.95);
	transition: opacity 0.3s ease, transform 0.3s ease
}

/* Animaciones / spinners */
@keyframes segitturPulse {
	0% {
		box-shadow: 0 0 0 0 rgba(27, 106, 214, .35)
	}

	70% {
		box-shadow: 0 0 0 12px rgba(27, 106, 214, 0)
	}

	100% {
		box-shadow: 0 0 0 0 rgba(27, 106, 214, 0)
	}
}

.spinner-border {
	display: inline-block;
	width: 1rem;
	height: 1rem;
	vertical-align: -.125em;
	border: .15em solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: segitturSpin .75s linear infinite
}

@keyframes segitturSpin {
	to {
		transform: rotate(360deg)
	}
}


/* ==========================================================================
   SINCRONIZACIÓN / UTILIDADES
   ========================================================================== */

/* Asterisco requerido (se deja la versión larga; incluye todas las clases) */
.segittur-product-creator-form .form-label.required::after,
.segittur-product-creator-form .title-definition.required::after,
.segittur-product-editor-form .form-label.required::after,
.segittur-product-editor-form .title-definition.required::after,
.products-editor-form .form-label.required::after,
.products-editor-form .title-definition.required::after {
	content: " *";
	color: #dc3545;
	font-weight: 700;
	margin-left: 2px
}

.segittur-btn .label {
	overflow: hidden;
	text-overflow: ellipsis
}

.pulse {
	animation: segitturPulse 1.4s ease-in-out infinite
}

@media(prefers-color-scheme:dark) {
	:root {
		--segittur-outline-bg: rgba(27, 106, 214, .18);
		--segittur-focus: 0 0 0 3px rgba(27, 106, 214, .35)
	}

	.segittur-btn {
		box-shadow: 0 2px 10px rgba(0, 0, 0, .35)
	}
}

/* Base labels */
.form-label {
	font-family: 'Nunito Sans';
	font-weight: 400;
	font-size: 14px !important;
	line-height: 16px
}


/* ==========================================================================
   DEBUG PANEL
   ========================================================================== */

.debug-toggle button {
	background-color: #0073aa;
	color: white;
	border: none;
	padding: 6px 12px;
	font-size: 14px;
	cursor: pointer;
	border-radius: 3px;
	transition: background-color 0.3s ease;
	outline: none
}

.debug-toggle button:hover,
.debug-toggle button:focus {
	background-color: #005177
}

.debug-toggle div {
	background: #f9f9f9;
	border: 1px solid #ccc;
	padding: 10px;
	margin-top: 5px;
	font-family: monospace;
	font-size: 13px;
	color: #333;
	white-space: pre-wrap
}


/* ==========================================================================
   MISC (componentes compartidos: categorías)
   ========================================================================== */

.product_category {
	position: relative;
	margin-top: 4px;
}

.category-select-wrapper {
	cursor: pointer
}

.category-dropdown-list {
	position: absolute;
	padding-left: 25px !important;
	left: 0;
	width: 100%;
	max-height: 200px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	z-index: 50;
	display: none
}

.category-dropdown-list.active {
	display: block
}

.category-dropdown-list .form-check {
	padding: 4px 8px
}

/* Ajuste tamaño “Seleccionadas” */
.product_category small {
	font-size: 14px;
	line-height: 16px;
	padding-top: 10px !important;
}

.product_category #selected-categories {
	font-size: 14px;
	line-height: 16px;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media(max-width:991px) {
	.alta-producto #apk-upload-btn {
		padding: 8px 14px;
		font-size: 14px
	}
}

@media(max-width:768px) {
	.alta-producto #apk-upload-btn {
		padding: 6px 12px;
		font-size: 13px
	}
}

@media(max-width:576px) {
	.alta-producto #apk-upload-btn {
		padding: 5px 10px;
		font-size: 12px;
		width: 100%
	}

	.alta-producto .custom-upload-apk {
		flex-direction: column;
		align-items: stretch
	}

	.alta-producto #apk-file-name {
		width: 100%;
		margin-bottom: 8px
	}
}

@media(max-width:576px) {
	.editar-producto #apk-upload-btn {
		padding: 5px 10px;
		font-size: 12px;
		width: 100%
	}

	.editar-producto .custom-upload-apk {
		flex-direction: column;
		align-items: stretch
	}

	.editar-producto #apk-file-name {
		width: 100%;
		margin-bottom: 8px
	}
}

@media(max-width:576px) {
	.editar-producto .cita {
		padding: 1em;
		border-left-width: 4px
	}

	.editar-producto .cita::before {
		font-size: 2.5rem;
		top: -8px;
		left: 8px
	}
}

@media(max-width:520px) {
	.segittur-sync-actions {
		flex-wrap: wrap
	}

	.segittur-sync-actions .segittur-btn {
		flex: 1 1 100%
	}
}


/* ==========================================================================
   BOTONES (eliminar imágenes)
   ========================================================================== */

button.remove-gallery-image {
	border-radius: 100%;
	padding: 13px 9px;
	margin: 0px;
	line-height: 0;
	font-size: 12px;
	background: var(--primary-color);
	border: none;
	color: #fff;
	font-weight: 700
}

button#remove-header-image {
	border-radius: 100%;
	padding: 13px 9px;
	margin: 0px;
	line-height: 0;
	font-size: 12px;
	background: var(--primary-color);
	border: none;
	color: #fff;
	font-weight: 700
}

button#remove-product-image {
	border-radius: 100%;
	padding: 13px 9px;
	margin: 0px;
	line-height: 0;
	font-size: 12px;
	background: var(--primary-color);
	border: none;
	color: #fff;
	font-weight: 700
}


/* ==========================================================================
   VALIDACIÓN / ERRORES
   ========================================================================== */

.custom-upload.is-invalid,
.custom-upload-gallery.is-invalid,
.product_category.is-invalid,
#external-url-field.is-invalid,
#upload-apk-container.is-invalid,
#downloadable-fields.is-invalid {
	border: 1px solid #dc3545 !important;
	border-radius: 8px;
	box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, .08);
	padding: 4px
}

.error-hint {
	color: #dc3545;
	font-size: 0.875rem;
	margin-top: 6px
}


/* ==========================================================================
   LANGUAGE TAB
   ========================================================================== */

.language-tabs-wrapper {
	margin-top: 2rem;
}

.language-tabs-wrapper .nav-tabs {
	border-bottom: 1px solid #dee2e6;
}

.language-tabs-wrapper .nav-tabs .nav-link {
	border: 0;
	border-bottom: 2px solid transparent;
	font-weight: 500;
	padding: 0.5rem 1rem;
}

.language-tabs-wrapper .nav-tabs .nav-link.active {
	background-color: #ffffff;
	border-color: #0d6efd;
	color: #0d6efd;
}

.language-tabs-wrapper .tab-content {
	background-color: #f5f7fb;
	border: 1px solid #dee2e6;
	border-top: none;
	padding: 1.5rem;
	border-radius: 0 0 0.5rem 0.5rem;
}

.language-tabs-wrapper .tab-pane {
	background-color: #f5f7fb;
}

.language-tabs-wrapper .tab-pane .mb-3,
.language-tabs-wrapper .tab-pane .row.mb-3 {
	margin-bottom: 1.25rem !important;
}
