/* Ferrein Cotizador */
:root {
	--fcot-primary: #0067b2;
	--fcot-primary-dark: #00528e;
	--fcot-text: #1f2937;
	--fcot-muted: #6b7280;
	--fcot-border: #e5e7eb;
	--fcot-soft: #f3f6fa;
	--fcot-radius: 8px;
}

/* ---------- Botón "Añadir a la cotización" ---------- */
button.fcot-btn,
form.cart button.fcot-btn,
.product-cart-button button.fcot-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 50px;
	padding: 1px 18px;
	margin: 0;
	border: 1.5px solid var(--fcot-primary);
	border-radius: var(--fcot-radius);
	background: #fff;
	color: var(--fcot-primary);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
	transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}
button.fcot-btn:hover,
button.fcot-btn:focus-visible {
	background: var(--fcot-primary);
	color: #fff;
}
form.cart button.fcot-btn.fcot-single { flex: 1 0 0%; }

/* Producto solo-cotización: botón principal relleno */
button.fcot-btn.fcot-primary,
form.cart button.fcot-btn.fcot-primary {
	background: var(--fcot-primary);
	color: #fff;
}
button.fcot-btn.fcot-primary:hover { background: var(--fcot-primary-dark); border-color: var(--fcot-primary-dark); }

button.fcot-btn.is-loading { opacity: .6; pointer-events: none; }
button.fcot-btn.is-loading .fcot-ico { animation: fcot-spin .8s linear infinite; }
@keyframes fcot-spin { to { transform: rotate(360deg); } }

/* Variable: si el botón solo debe aparecer cuando hace falta (precio $0 o sin stock) */
form.variations_form:not(.fcot-variation-quote-only) button.fcot-btn.fcot-only-when-needed { display: none; }

/* Variable con precio 0: ocultar "Agregar al carrito" y destacar cotizar */
form.variations_form.fcot-variation-quote-only .single_add_to_cart_button { display: none !important; }
form.variations_form.fcot-variation-quote-only button.fcot-btn {
	background: var(--fcot-primary);
	color: #fff;
}

.fcot-quote-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; margin-bottom: 1.5rem; }

/* Listados */
.product-cart-button button.fcot-loop-btn,
button.fcot-loop-btn,
a.fcot-loop-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: auto;
	min-height: 38px;
	padding: 8px 14px;
	font-size: 13px;
}
a.fcot-loop-btn { border: 1.5px solid var(--fcot-primary); border-radius: var(--fcot-radius); background: #fff; color: var(--fcot-primary); font-weight: 600; text-decoration: none; }
a.fcot-loop-btn:hover { background: var(--fcot-primary); color: #fff; }

.fcot-price-label { font-weight: 600; color: var(--fcot-primary); }

@media (max-width: 480px) {
	form.cart button.fcot-btn.fcot-single:not(.fcot-primary) { flex-basis: 100%; }
}

/* ---------- Botón flotante ---------- */
.fcot-float {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 9990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 999px;
	background: var(--fcot-primary);
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.fcot-float[hidden] { display: none; }
.fcot-float:hover { background: var(--fcot-primary-dark); }
.fcot-float-count {
	min-width: 22px; height: 22px; padding: 0 6px;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 999px; background: #fff; color: var(--fcot-primary); font-size: 12px;
}
@media (max-width: 767px) {
	.fcot-float { bottom: 80px; left: 12px; } /* sobre el menú inferior del tema */
	.fcot-float-txt { display: none; }
}

/* ---------- Toast ---------- */
.fcot-toast {
	position: fixed; left: 50%; bottom: 24px; z-index: 99999;
	display: flex; align-items: center; gap: 14px;
	max-width: calc(100% - 32px); padding: 12px 18px;
	border-radius: var(--fcot-radius); background: #111827; color: #fff;
	font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
	transform: translate(-50%, 140%); opacity: 0;
	transition: transform .25s ease, opacity .25s ease;
}
.fcot-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.fcot-toast.is-error { background: #b42318; }
.fcot-toast a { color: #93c5fd; font-weight: 600; white-space: nowrap; text-decoration: none; }

/* ---------- Página de cotización ---------- */
.fcot-page { color: var(--fcot-text); margin: 1rem 0 3rem; }
.fcot-page h3 { font-size: 1.15rem; margin: 0 0 1rem; }
.fcot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.fcot-items, .fcot-form { background: #fff; border: 1px solid var(--fcot-border); border-radius: 12px; padding: 24px; }
.fcot-form { position: sticky; top: 120px; }

.fcot-table { width: 100%; border-collapse: collapse; margin: 0; }
.fcot-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--fcot-muted); font-weight: 600; text-align: left; padding: 0 8px 10px; border-bottom: 1px solid var(--fcot-border); }
.fcot-table td { padding: 14px 8px; border-bottom: 1px solid var(--fcot-border); vertical-align: middle; }
.fcot-thumb { width: 72px; }
.fcot-thumb img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: var(--fcot-soft); }
.fcot-name a { color: var(--fcot-text); font-weight: 600; text-decoration: none; }
.fcot-name small { display: block; color: var(--fcot-muted); margin-top: 2px; }
.fcot-price { white-space: nowrap; }
.fcot-price em { color: var(--fcot-primary); font-style: normal; font-weight: 600; }
.fcot-item-qty { width: 76px; height: 40px; padding: 0 8px; border: 1px solid var(--fcot-border); border-radius: 6px; text-align: center; }
.fcot-remove-btn { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--fcot-soft); color: var(--fcot-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.fcot-remove-btn:hover { background: #fee2e2; color: #b42318; }
.fcot-total { margin: 16px 0 0; text-align: right; }
.fcot-total span { color: var(--fcot-muted); font-size: 13px; }
.fcot-note { margin: 12px 0 0; color: var(--fcot-muted); font-size: 13px; }

.fcot-field { margin: 0 0 14px; }
.fcot-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.fcot-field abbr { color: #b42318; text-decoration: none; border: 0; }
.fcot-field input, .fcot-field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--fcot-border); border-radius: 6px; font: inherit; background: #fff; }
.fcot-field input:focus, .fcot-field textarea:focus { outline: 2px solid rgba(0, 103, 178, .25); border-color: var(--fcot-primary); }
.fcot-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.fcot-msg { margin: 0 0 12px; padding: 10px 12px; border-radius: 6px; background: #fef3f2; color: #b42318; font-size: 14px; }
.fcot-msg[hidden] { display: none; }
.fcot-form .fcot-submit { width: 100%; height: 50px; border-radius: var(--fcot-radius); background: var(--fcot-primary); color: #fff; border: 0; font-weight: 600; cursor: pointer; }
.fcot-form .fcot-submit:hover { background: var(--fcot-primary-dark); }
.fcot-form .fcot-submit:disabled { opacity: .6; }

.fcot-empty, .fcot-thanks { text-align: center; padding: 48px 16px; border: 1px dashed var(--fcot-border); border-radius: 12px; }
.fcot-empty .fcot-ico, .fcot-thanks .fcot-ico { width: 44px; height: 44px; color: var(--fcot-primary); margin-bottom: 8px; }
.fcot-thanks h3 { margin-bottom: .5rem; }

@media (max-width: 900px) {
	.fcot-grid { grid-template-columns: 1fr; }
	.fcot-form { position: static; }
}
@media (max-width: 600px) {
	.fcot-items, .fcot-form { padding: 16px; }
	.fcot-table thead { display: none; }
	.fcot-table tr { display: grid; grid-template-columns: 64px 1fr auto; grid-template-areas: "img name rm" "img price qty"; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--fcot-border); }
	.fcot-table td { border: 0; padding: 0; }
	.fcot-thumb { grid-area: img; width: auto; }
	.fcot-name { grid-area: name; }
	.fcot-price { grid-area: price; align-self: center; }
	.fcot-qty-cell { grid-area: qty; }
	.fcot-remove { grid-area: rm; text-align: right; }
}

/* Aceptación de términos */
.fcot-terms label { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 13px; line-height: 1.45; cursor: pointer; }
.fcot-terms input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; padding: 0; accent-color: var(--fcot-primary); cursor: pointer; }
.fcot-terms a { color: var(--fcot-primary); text-decoration: underline; }
.fcot-terms.is-invalid label { color: #b42318; }
.fcot-terms.is-invalid input[type="checkbox"] { outline: 2px solid #b42318; outline-offset: 1px; }

/* Mi cuenta → Cotizaciones */
.fcot-account-note { margin: -6px 0 16px; }
.fcot-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef2f7; color: #374151; white-space: nowrap; }
.fcot-status-recibida { background: #e8f1fb; color: #0067b2; }
.fcot-status-en-revision { background: #fff4e5; color: #b54708; }
.fcot-status-enviada { background: #ecfdf3; color: #067647; }
.fcot-status-aceptada { background: #d1fadf; color: #05603a; }
.fcot-status-rechazada, .fcot-status-vencida { background: #fef3f2; color: #b42318; }
.fcot-account-meta { margin-bottom: 1rem; }
.fcot-customer-note { margin: 0 0 1.25rem; padding: 12px 14px; border-left: 3px solid var(--fcot-primary); background: var(--fcot-soft); border-radius: 0 6px 6px 0; }
.fcot-account h3 { margin-top: 1.5rem; font-size: 1.05rem; }
.fcot-account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.5rem; }
.fcot-pagination { display: flex; gap: 8px; margin-top: 1rem; }
