/*
 Theme Name: Wiimbala Divi Child
 Theme URI: https://wiimbala.local
 Description: Child theme para ajustes locales de WooCommerce y Fancy Product Designer.
 Author: Wiimbala
 Version: 1.0.0
 Template: Divi
 Text Domain: wiimbala-divi-child
*/

/* WooCommerce product images no cropping */
.woocommerce ul.products li.product img {
	object-fit: contain !important;
	height: auto !important;
	max-height: 300px;
	background: #fff;
}

.woocommerce div.product div.images img {
	object-fit: contain !important;
}

/* Shop layout */
.wiimbala-shop-layout {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 32px;
	width: min(1280px, 96%);
	margin: 0 auto;
	padding: 24px 0 40px;
}

.wiimbala-shop-sidebar {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 20px;
	height: fit-content;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.wiimbala-shop-sidebar .widget {
	margin-bottom: 24px;
}

.wiimbala-shop-sidebar .widget:last-child {
	margin-bottom: 0;
}

.wiimbala-shop-sidebar .widget-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 12px;
	color: #0f172a;
}

.wiimbala-shop-sidebar ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.wiimbala-shop-sidebar li {
	margin: 0 0 8px;
}

.wiimbala-shop-sidebar a {
	color: #334155;
	text-decoration: none;
}

.wiimbala-shop-sidebar a:hover {
	color: #0ea5a6;
}

.wiimbala-shop-products .woocommerce-result-count,
.wiimbala-shop-products .woocommerce-ordering {
	margin-bottom: 16px;
}

.woocommerce ul.products li.product {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 14px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.woocommerce ul.products li.product:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 16px;
	line-height: 1.35;
	min-height: 44px;
}

#wiimbala-quote-btn-fallback {
	display: inline-block;
	margin-top: 12px;
	background: #0f766e;
	color: #fff;
	border: 1px solid #0f766e;
	padding: 10px 16px;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
}

#wiimbala-quote-btn-fallback:hover {
	background: #0d5f59;
	border-color: #0d5f59;
}

@media (max-width: 980px) {
	.wiimbala-shop-layout {
		grid-template-columns: 1fr;
		gap: 18px;
	}
}

/* ===========================
   FPD UI CLEAN MODE
=========================== */

/* Ocultar herramientas avanzadas */
.fpd-tools .fpd-advanced-tools,
.fpd-tools .fpd-layers-panel,
.fpd-tools .fpd-products,
.fpd-tools .fpd-module-tabs,
.fpd-tools .fpd-color-selection,
.fpd-tools .fpd-text-edit-options {
	display: none !important;
}

/* Estetica limpia */
.fpd-container {
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	background: #ffffff;
}

/* Botones mas modernos */
.fpd-tools button {
	border-radius: 8px !important;
}

.wiimbala-design-steps {
	display: flex;
	justify-content: space-between;
	margin-bottom: 20px;
	font-weight: 600;
	font-size: 14px;
	color: #444;
}

.wiimbala-quote-button {
	background: #111 !important;
	color: #fff !important;
	padding: 14px 22px !important;
	margin-left: 10px !important;
	margin-top: 12px !important;
	display: inline-block !important;
	border-radius: 10px !important;
	font-weight: 600;
	transition: all .2s ease;
}

.wiimbala-quote-button:hover {
	background: #000 !important;
	transform: translateY(-1px);
}

.wiimbala-loader {
	position: fixed;
	inset: 0;
	background: rgba(255, 255, 255, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 600;
	z-index: 99999;
}

/* ===========================
   WIIMBALA MODAL FIX
=========================== */

#wiimbala-quote-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 999999;
}

.wiimbala-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.wiimbala-box {
    position: relative;
    width: 500px;
    max-width: 92%;
    background: #fff;
    margin: auto;
    top: 50%;
    transform: translateY(-50%);
    padding: 35px;
    border-radius: 14px;
    box-shadow: 0 30px 70px rgba(0,0,0,.25);
}

.wiimbala-close {
    position: absolute;
    right: 15px;
    top: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.wiimbala-box input,
.wiimbala-box textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.wiimbala-submit {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-weight: 600;
    border: none;
}

body.wiimbala-modal-open {

	overflow: hidden;
}

/* ===========================
   CART COUNT BADGE
=========================== */

.cart-icon {
	position: relative;
}

#et-top-navigation .et-cart-info {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	margin-right: 14px;
	overflow: visible;
}

#et-top-navigation .et-cart-info > span:first-child {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

#et-top-navigation .et-cart-info > span:first-child:before {
	font-size: 20px;
}

#et-top-navigation .et-cart-info .wiimbala-cart-count {
	position: absolute;
	top: 2px;
	right: -8px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: #111827;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 3px 10px rgba(15, 23, 42, 0.28);
}

#et-top-navigation .et-cart-info .wiimbala-cart-count:empty {
	display: none;
}

@media (max-width: 980px) {
	#et-top-navigation .et-cart-info {
		margin-right: 8px;
		min-width: 28px;
		height: 28px;
	}

	#et-top-navigation .et-cart-info > span:first-child:before {
		font-size: 18px;
	}

	#et-top-navigation .et-cart-info .wiimbala-cart-count {
		top: -5px;
		right: -7px;
		min-width: 16px;
		height: 16px;
		font-size: 10px;
		padding: 0 4px;
	}
}

/* ===========================
   QUOTE LOADING OVERLAY
=========================== */

#quote-loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #ffffff;
	z-index: 1000000;
	display: none;
	align-items: center;
	justify-content: center;
}

.quote-loading-content {
	text-align: center;
	font-size: 18px;
	color: #333;
	font-weight: 500;
}

.quote-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #ddd;
	border-top: 4px solid #000;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 20px auto;
}

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

.fpd-product-view[data-title="base"] {
	display: none !important;
}
