/* ============================================================
   Kurnia Image Fix & Layout Enhancements – v1.4.5
   Uses html + body + .elementor prefix to achieve specificity
   [0,2,2] which beats Elementor element-ID selectors [0,2,0].
   ============================================================ */

/* Grid-view: square wrapper */
html body .elementor .kurnia-woo-product-image-wrapper {
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 100% !important;
    background-color: #f7f7f7 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

/* List-view: fixed-size square */
html body .elementor .kurnia-woo-products-grid.layout-list .kurnia-woo-product-image-wrapper {
    width: 140px !important;
    height: 140px !important;
    padding-bottom: 0 !important;
    flex-shrink: 0 !important;
    margin-bottom: 0 !important;
}

/* Direct image link fills wrapper */
html body .elementor .kurnia-woo-product-image-wrapper > a {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* The product image */
html body .elementor .kurnia-woo-product-image-wrapper > a > img,
html body .elementor .kurnia-woo-product-image-wrapper > a img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

/* ── Out-of-Stock Disabled Button ─────────────────────────── */
html body .elementor .kurnia-woo-btn-cart.disabled {
    opacity: 0.4 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

/* ── Price Range Slider Centering Fix ────────────────────── */
html body .elementor .kurnia-dual-range {
    position: relative !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
}
html body .elementor .kurnia-dual-range .kurnia-range-track,
html body .elementor .kurnia-dual-range .kurnia-range-fill {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    height: 4px !important;
}
html body .elementor .kurnia-dual-range input[type="range"] {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── List Layout Structural Overrides ─────────────────────── */
html body .elementor .kurnia-woo-products-grid.layout-list {
    grid-template-columns: 1fr !important;
}
html body .elementor .kurnia-woo-products-grid.layout-list .kurnia-woo-product-card {
    flex-direction: row !important;
    align-items: center !important;
    gap: 20px !important;
    display: flex !important;
    width: 100% !important;
}
html body .elementor .kurnia-woo-products-grid.layout-list .kurnia-woo-product-content {
    justify-content: center !important;
    flex: 1 !important;
}

/* List-view action buttons: always visible, right-centered */
html body .elementor .kurnia-woo-products-grid.layout-list .kurnia-woo-product-card > .kurnia-woo-product-hover-actions {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

/* ── Pagination Bottom Center ────────────────────────────── */
html body .elementor .kurnia-woo-pagination {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    margin-top: 30px !important;
    margin-bottom: 10px !important;
}

/* Quick View Wishlist Button Active State */
.kurnia-qv-wishlist-btn i { color: #777; transition: color 0.3s; }
.kurnia-qv-wishlist-btn.active i { color: #e74c3c !important; }

.kurnia-qv-modal form.cart {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.kurnia-qv-modal div.quantity {
    display: inline-flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 3px;
    height: var(--button-height, 40px);
}

.kurnia-qv-modal div.quantity .qty-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    width: 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 0 !important;
    min-width: 0 !important;
}

.kurnia-qv-modal div.quantity input.qty {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    height: 100%;
    width: 45px;
    text-align: center;
    font-weight: 500;
    font-size: 15px;
    color: #000;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield;
}

.kurnia-qv-modal div.quantity input.qty::-webkit-outer-spin-button,
.kurnia-qv-modal div.quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.kurnia-qv-modal .single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--button-height, 40px);
    border: none;
    border-radius: 4px;
    padding: 0 16px;
    font-weight: 600;
    cursor: pointer;
}